mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
decorations: add SetDecorations action
This commit is contained in:
parent
e2590f10fd
commit
41a3b68846
6 changed files with 62 additions and 0 deletions
22
src/action.c
22
src/action.c
|
|
@ -79,6 +79,7 @@ enum action_type {
|
|||
ACTION_TYPE_TOGGLE_MAXIMIZE,
|
||||
ACTION_TYPE_MAXIMIZE,
|
||||
ACTION_TYPE_TOGGLE_FULLSCREEN,
|
||||
ACTION_TYPE_SET_DECORATIONS,
|
||||
ACTION_TYPE_TOGGLE_DECORATIONS,
|
||||
ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP,
|
||||
ACTION_TYPE_TOGGLE_ALWAYS_ON_BOTTOM,
|
||||
|
|
@ -135,6 +136,7 @@ const char *action_names[] = {
|
|||
"ToggleMaximize",
|
||||
"Maximize",
|
||||
"ToggleFullscreen",
|
||||
"SetDecorations",
|
||||
"ToggleDecorations",
|
||||
"ToggleAlwaysOnTop",
|
||||
"ToggleAlwaysOnBottom",
|
||||
|
|
@ -347,6 +349,17 @@ action_arg_from_xml_node(struct action *action, const char *nodename, const char
|
|||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
case ACTION_TYPE_SET_DECORATIONS:
|
||||
if (!strcmp(argument, "decorations")) {
|
||||
enum ssd_mode mode = ssd_mode_parse(content);
|
||||
action_arg_add_int(action, argument, mode);
|
||||
goto cleanup;
|
||||
}
|
||||
if (!strcasecmp(argument, "forceSSD")) {
|
||||
action_arg_add_bool(action, argument, parse_bool(content, false));
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
case ACTION_TYPE_RESIZE_RELATIVE:
|
||||
if (!strcmp(argument, "left") || !strcmp(argument, "right") ||
|
||||
!strcmp(argument, "top") || !strcmp(argument, "bottom")) {
|
||||
|
|
@ -806,6 +819,15 @@ actions_run(struct view *activator, struct server *server,
|
|||
view_toggle_fullscreen(view);
|
||||
}
|
||||
break;
|
||||
case ACTION_TYPE_SET_DECORATIONS:
|
||||
if (view) {
|
||||
enum ssd_mode mode = action_get_int(action,
|
||||
"decorations", LAB_SSD_MODE_FULL);
|
||||
bool force_ssd = action_get_bool(action,
|
||||
"forceSSD", false);
|
||||
view_set_decorations(view, mode, force_ssd);
|
||||
}
|
||||
break;
|
||||
case ACTION_TYPE_TOGGLE_DECORATIONS:
|
||||
if (view) {
|
||||
view_toggle_decorations(view);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue