mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
decorations: add "initial" mode
This commit is contained in:
parent
85e1b454ff
commit
abdfc921d2
3 changed files with 15 additions and 5 deletions
|
|
@ -131,10 +131,11 @@ Actions are used in menus and keyboard/mouse bindings.
|
||||||
*<action name="Decorate" mode="value" />*
|
*<action name="Decorate" mode="value" />*
|
||||||
Enable decorations of focused window.
|
Enable decorations of focused window.
|
||||||
|
|
||||||
*mode* [yes|no|full|border|none] "full", "border" and "none" are the
|
*mode* [yes|no|initial|full|border|none] "full", "border" and "none"
|
||||||
three modes described in 'ToggleDecorations'. "yes" and "no"
|
are the three modes described in 'ToggleDecorations'. "yes", "no", and
|
||||||
automatically select an appropriate mode based on 'keepBorder' and
|
"initial" automatically select an appropriate mode based on
|
||||||
whether the window has client side decorations. Default is yes.
|
'keepBorder' and whether the window has client side decorations.
|
||||||
|
Default is yes.
|
||||||
|
|
||||||
*<action name="Undecorate" />*
|
*<action name="Undecorate" />*
|
||||||
Disable decorations of focused window.
|
Disable decorations of focused window.
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ enum ssd_mode {
|
||||||
LAB_SSD_MODE_NONE,
|
LAB_SSD_MODE_NONE,
|
||||||
LAB_SSD_MODE_BORDER,
|
LAB_SSD_MODE_BORDER,
|
||||||
LAB_SSD_MODE_FULL,
|
LAB_SSD_MODE_FULL,
|
||||||
|
LAB_SSD_MODE_INITIAL,
|
||||||
LAB_SSD_MODE_YES,
|
LAB_SSD_MODE_YES,
|
||||||
LAB_SSD_MODE_NO
|
LAB_SSD_MODE_NO
|
||||||
};
|
};
|
||||||
|
|
|
||||||
10
src/view.c
10
src/view.c
|
|
@ -1292,7 +1292,13 @@ resolve_ssd_mode(struct view *view, enum ssd_mode mode)
|
||||||
{
|
{
|
||||||
assert(view);
|
assert(view);
|
||||||
|
|
||||||
if (mode == LAB_SSD_MODE_YES) {
|
if (mode == LAB_SSD_MODE_INITIAL) {
|
||||||
|
if (has_ssd(view)) {
|
||||||
|
return LAB_SSD_MODE_FULL;
|
||||||
|
} else {
|
||||||
|
return LAB_SSD_MODE_NONE;
|
||||||
|
}
|
||||||
|
} else if (mode == LAB_SSD_MODE_YES) {
|
||||||
return LAB_SSD_MODE_FULL;
|
return LAB_SSD_MODE_FULL;
|
||||||
} else if (mode == LAB_SSD_MODE_NO) {
|
} else if (mode == LAB_SSD_MODE_NO) {
|
||||||
if (rc.ssd_keep_border && has_ssd(view)) {
|
if (rc.ssd_keep_border && has_ssd(view)) {
|
||||||
|
|
@ -1875,6 +1881,8 @@ ssd_mode_parse(const char *mode)
|
||||||
return LAB_SSD_MODE_BORDER;
|
return LAB_SSD_MODE_BORDER;
|
||||||
} else if (!strcasecmp(mode, "none")) {
|
} else if (!strcasecmp(mode, "none")) {
|
||||||
return LAB_SSD_MODE_NONE;
|
return LAB_SSD_MODE_NONE;
|
||||||
|
} else if (!strcasecmp(mode, "initial")) {
|
||||||
|
return LAB_SSD_MODE_INITIAL;
|
||||||
} else if (!strcasecmp(mode, "yes")) {
|
} else if (!strcasecmp(mode, "yes")) {
|
||||||
return LAB_SSD_MODE_YES;
|
return LAB_SSD_MODE_YES;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue