cmd_border: improve width selection

- 'border toggle' now accepts an optional pixel argument which will be
ignored when switching to BS_NONE.
- 'border pixel' now defaults to 1 pixel instead of 2.
- Calling 'border normal' or 'border pixel' will use the configured
default_border_width if one exists. Also applies to floating windows.
This commit is contained in:
Orestis Floros
2018-04-21 15:21:04 +03:00
parent a40bcef438
commit bd7a5ee48a
4 changed files with 60 additions and 35 deletions

View File

@ -86,16 +86,16 @@ state DEBUGLOG:
# border normal|pixel [<n>]
# border none|1pixel|toggle
state BORDER:
border_style = 'normal', 'pixel'
border_style = 'normal', 'pixel', 'toggle'
-> BORDER_WIDTH
border_style = 'none', 'toggle'
border_style = 'none'
-> call cmd_border($border_style, 0)
border_style = '1pixel'
-> call cmd_border($border_style, 1)
'1pixel'
-> call cmd_border("pixel", 1)
state BORDER_WIDTH:
end
-> call cmd_border($border_style, 2)
-> call cmd_border($border_style, -1)
border_width = number
-> call cmd_border($border_style, &border_width)