Skip to content

Commit

Permalink
Merge pull request #21 from Eskaan/main
Browse files Browse the repository at this point in the history
Replace optional values with defaults when unset
  • Loading branch information
hertg authored Jun 5, 2023
2 parents c37d0c5 + 696b2ba commit a344b3d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions leftwm-layouts/src/layouts/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type LayoutName = String;
/// The [`Layout`] allows to describe various types of "fixed" layouts used by a dynamic tiling manager.
/// Those include layouts like `MainAndStack`, `Fibonacci`, `Dwindle`, `CenterMain`, etc.
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
#[serde(default)]
pub struct Layout {
/// Name and identifier of the layout.
/// This is user chosen and no two layouts can have the same name.
Expand Down Expand Up @@ -320,6 +321,7 @@ impl Default for Layout {
/// in a `MainAndStack` layout configuration, the [`Flip`] property could be set to [`Flip::Vertical`],
/// which results in the columns being flipped, **but not their contents**.
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
#[serde(default)]
pub struct Columns {
/// How the columns should be flipped, does not apply to their contents
pub flip: Flip,
Expand Down Expand Up @@ -364,6 +366,7 @@ impl Default for Columns {

/// Configurations concerning the `main` column
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
#[serde(default)]
pub struct Main {
/// The default amount of windows to occupy the `main` column (default: `1`)
pub count: usize,
Expand Down Expand Up @@ -399,6 +402,7 @@ impl Default for Main {

/// Configurations concerning the `stack` column
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
#[serde(default)]
pub struct Stack {
/// Flip modifier to apply only to the `stack` columns' contents
pub flip: Flip,
Expand Down Expand Up @@ -426,6 +430,7 @@ impl Default for Stack {

/// Configurations concerning the `second_stack` column
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
#[serde(default)]
pub struct SecondStack {
/// Flip modifier to apply only to the `second_stack` columns' contents
pub flip: Flip,
Expand Down

0 comments on commit a344b3d

Please sign in to comment.