mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
decorations: implement Decoration/Undecorate actions
This commit is contained in:
parent
873393a8da
commit
84452debaf
4 changed files with 21 additions and 10 deletions
|
|
@ -120,6 +120,12 @@ Actions are used in menus and keyboard/mouse bindings.
|
||||||
*<action name="ToggleDecorations" />*
|
*<action name="ToggleDecorations" />*
|
||||||
Toggle decorations of focused window.
|
Toggle decorations of focused window.
|
||||||
|
|
||||||
|
*<action name="Decorate" />*
|
||||||
|
Enable decorations of focused window.
|
||||||
|
|
||||||
|
*<action name="Undecorate" />*
|
||||||
|
Disable decorations of focused window.
|
||||||
|
|
||||||
*<action name="ToggleFullscreen" />*
|
*<action name="ToggleFullscreen" />*
|
||||||
Toggle fullscreen state of focused window.
|
Toggle fullscreen state of focused window.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -440,7 +440,6 @@ void view_maximize(struct view *view, enum view_axis axis,
|
||||||
bool store_natural_geometry);
|
bool store_natural_geometry);
|
||||||
void view_set_fullscreen(struct view *view, bool fullscreen);
|
void view_set_fullscreen(struct view *view, bool fullscreen);
|
||||||
void view_toggle_maximize(struct view *view, enum view_axis axis);
|
void view_toggle_maximize(struct view *view, enum view_axis axis);
|
||||||
void view_toggle_decorations(struct view *view);
|
|
||||||
|
|
||||||
bool view_is_always_on_top(struct view *view);
|
bool view_is_always_on_top(struct view *view);
|
||||||
bool view_is_always_on_bottom(struct view *view);
|
bool view_is_always_on_bottom(struct view *view);
|
||||||
|
|
|
||||||
16
src/action.c
16
src/action.c
|
|
@ -79,6 +79,8 @@ enum action_type {
|
||||||
ACTION_TYPE_MAXIMIZE,
|
ACTION_TYPE_MAXIMIZE,
|
||||||
ACTION_TYPE_TOGGLE_FULLSCREEN,
|
ACTION_TYPE_TOGGLE_FULLSCREEN,
|
||||||
ACTION_TYPE_TOGGLE_DECORATIONS,
|
ACTION_TYPE_TOGGLE_DECORATIONS,
|
||||||
|
ACTION_TYPE_DECORATE,
|
||||||
|
ACTION_TYPE_UNDECORATE,
|
||||||
ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP,
|
ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP,
|
||||||
ACTION_TYPE_TOGGLE_ALWAYS_ON_BOTTOM,
|
ACTION_TYPE_TOGGLE_ALWAYS_ON_BOTTOM,
|
||||||
ACTION_TYPE_TOGGLE_OMNIPRESENT,
|
ACTION_TYPE_TOGGLE_OMNIPRESENT,
|
||||||
|
|
@ -132,6 +134,8 @@ const char *action_names[] = {
|
||||||
"Maximize",
|
"Maximize",
|
||||||
"ToggleFullscreen",
|
"ToggleFullscreen",
|
||||||
"ToggleDecorations",
|
"ToggleDecorations",
|
||||||
|
"Decorate",
|
||||||
|
"Undecorate",
|
||||||
"ToggleAlwaysOnTop",
|
"ToggleAlwaysOnTop",
|
||||||
"ToggleAlwaysOnBottom",
|
"ToggleAlwaysOnBottom",
|
||||||
"ToggleOmnipresent",
|
"ToggleOmnipresent",
|
||||||
|
|
@ -787,7 +791,17 @@ actions_run(struct view *activator, struct server *server,
|
||||||
break;
|
break;
|
||||||
case ACTION_TYPE_TOGGLE_DECORATIONS:
|
case ACTION_TYPE_TOGGLE_DECORATIONS:
|
||||||
if (view) {
|
if (view) {
|
||||||
view_toggle_decorations(view);
|
view_set_decorations(view, !view->ssd_enabled);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACTION_TYPE_DECORATE:
|
||||||
|
if (view) {
|
||||||
|
view_set_decorations(view, true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACTION_TYPE_UNDECORATE:
|
||||||
|
if (view) {
|
||||||
|
view_set_decorations(view, false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP:
|
case ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP:
|
||||||
|
|
|
||||||
|
|
@ -1193,14 +1193,6 @@ view_toggle_maximize(struct view *view, enum view_axis axis)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
view_toggle_decorations(struct view *view)
|
|
||||||
{
|
|
||||||
assert(view);
|
|
||||||
|
|
||||||
view_set_decorations(view, !view->ssd_enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
view_is_always_on_top(struct view *view)
|
view_is_always_on_top(struct view *view)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue