diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2022-10-31 19:04:14 +0100 |
---|---|---|
committer | Michael Stapelberg <stapelberg@users.noreply.github.com> | 2022-11-01 17:55:46 +0100 |
commit | a5791b2e647e13c64ddfb54ecbe2ab51b59384ca (patch) | |
tree | acee77a3ea668696aa18fc2f814dd4e4a676e382 | |
parent | b2c696f680cd76d1e5c4ae2466e14ae994d9dff3 (diff) | |
download | i3-a5791b2e647e13c64ddfb54ecbe2ab51b59384ca.tar.gz i3-a5791b2e647e13c64ddfb54ecbe2ab51b59384ca.zip |
gaps: allow optional px suffix
-rw-r--r-- | docs/userguide | 8 | ||||
-rw-r--r-- | parser-specs/commands.spec | 6 | ||||
-rw-r--r-- | parser-specs/config.spec | 8 | ||||
-rw-r--r-- | testcases/t/319-gaps.t | 2 |
4 files changed, 18 insertions, 6 deletions
diff --git a/docs/userguide b/docs/userguide index 9d578031..5005005e 100644 --- a/docs/userguide +++ b/docs/userguide @@ -1455,15 +1455,15 @@ to most specific as some directives can overwrite others. *Syntax*: ----------------------- # Inner gaps for all windows: space between two adjacent windows (or split containers). -gaps inner <gap_size_in_px> +gaps inner <gap_size>[px] # Outer gaps for all windows: space along the screen edges. -gaps outer|horizontal|vertical|top|left|bottom|right <gap_size_in_px> +gaps outer|horizontal|vertical|top|left|bottom|right <gap_size>[px] # Inner and outer gaps for all windows on a specific workspace. # <ws> can be a workspace number or name. -workspace <ws> gaps inner <gap_size_in_px> -workspace <ws> gaps outer|horizontal|vertical|top|left|bottom|right <gap_size_in_px> +workspace <ws> gaps inner <gap_size>[px] +workspace <ws> gaps outer|horizontal|vertical|top|left|bottom|right <gap_size>[px] # Enabling “Smart Gaps” means no gaps will be shown when there is # precisely one window or split container on the workspace. diff --git a/parser-specs/commands.spec b/parser-specs/commands.spec index c618dfda..c0171d2e 100644 --- a/parser-specs/commands.spec +++ b/parser-specs/commands.spec @@ -111,6 +111,12 @@ state GAPS_WITH_SCOPE: state GAPS_WITH_MODE: value = word + -> GAPS_END + +state GAPS_END: + 'px' + -> + end -> call cmd_gaps($type, $scope, $mode, $value) state BORDER_WIDTH: diff --git a/parser-specs/config.spec b/parser-specs/config.spec index d879d219..6107c959 100644 --- a/parser-specs/config.spec +++ b/parser-specs/config.spec @@ -68,13 +68,19 @@ state IGNORE_LINE: line -> INITIAL -# gaps inner|outer|horizontal|vertical|top|right|bottom|left <px> +# gaps inner|outer|horizontal|vertical|top|right|bottom|left <gap_size>[px] state GAPS: scope = 'inner', 'outer', 'horizontal', 'vertical', 'top', 'right', 'bottom', 'left' -> GAPS_WITH_SCOPE state GAPS_WITH_SCOPE: value = number + -> GAPS_END + +state GAPS_END: + 'px' + -> + end -> call cfg_gaps($workspace, $scope, &value) # smart_borders true|false diff --git a/testcases/t/319-gaps.t b/testcases/t/319-gaps.t index 1ce3b0b8..a10f438d 100644 --- a/testcases/t/319-gaps.t +++ b/testcases/t/319-gaps.t @@ -22,7 +22,7 @@ use i3test i3_config => <<EOT; font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 gaps inner 10 -gaps outer 20 +gaps outer 20px default_border pixel 0 EOT |