mirror of
https://github.com/labwc/labwc.git
synced 2026-06-13 14:33:18 -04:00
Merge ac0ae6ef37 into 4af693a7fd
This commit is contained in:
commit
ea29369672
11 changed files with 68 additions and 5 deletions
|
|
@ -621,6 +621,7 @@ extending outward from the snapped edge.
|
|||
- 'close': close
|
||||
- 'shade': shade toggle
|
||||
- 'desk': all-desktops toggle
|
||||
- 'ontop': always-on-top toggle
|
||||
|
||||
A colon deliminator is used to separate buttons on the left and right,
|
||||
whereas commas are used to separate items within a section. It is
|
||||
|
|
@ -900,6 +901,8 @@ input-devices by the Wayland protocol.
|
|||
- Shade: A button that, by default, toggles window shading.
|
||||
- AllDesktops: A button that, by default, toggles omnipresence of a
|
||||
window.
|
||||
- OnTop: A button that, by default, toggles always-on-top state of a
|
||||
window.
|
||||
- Close: A button that, by default, closses a window.
|
||||
- Border: The window's border including Top...BRCorner below.
|
||||
- Top: The top edge of the window's border.
|
||||
|
|
|
|||
|
|
@ -494,6 +494,8 @@ file within a particular theme. The following xbm buttons are supported:
|
|||
- max_toggled.xbm
|
||||
- desk.xbm
|
||||
- desk_toggled.xbm
|
||||
- ontop.xbm
|
||||
- ontop_toggled.xbm
|
||||
- shade.xbm
|
||||
- shade_toggled.xbm
|
||||
|
||||
|
|
@ -506,9 +508,11 @@ over the button in question:
|
|||
- menu_hover.xbm
|
||||
- max_toggled_hover.xbm
|
||||
- desk_hover.xbm
|
||||
- desk_toggle_hover.xbm
|
||||
- desk_toggled_hover.xbm
|
||||
- ontop_hover.xbm
|
||||
- ontop_toggled_hover.xbm
|
||||
- shade_hover.xbm
|
||||
- shade_toggle_hover.xbm
|
||||
- shade_toggled_hover.xbm
|
||||
|
||||
One advantage of xbm buttons over other formats is that they change color based
|
||||
on the theme. Other formats use the suffices "-active" and "-inactive" to align
|
||||
|
|
@ -558,7 +562,14 @@ following icons should be added:
|
|||
- desk_toggled-inactive.[png|svg]
|
||||
- desk_toggled_hover-active.[png|svg]
|
||||
- desk_toggled_hover-inactive.[png|svg]
|
||||
|
||||
- ontop-active.[png|svg]
|
||||
- ontop_hover-active.[png|svg]
|
||||
- ontop_hover-inactive.[png|svg]
|
||||
- ontop-inactive.[png|svg]
|
||||
- ontop_toggled-active.[png|svg]
|
||||
- ontop_toggled-inactive.[png|svg]
|
||||
- ontop_toggled_hover-active.[png|svg]
|
||||
- ontop_toggled_hover-inactive.[png|svg]
|
||||
# DEFINITIONS
|
||||
|
||||
The handle is the window edge decoration at the bottom of the window.
|
||||
|
|
|
|||
|
|
@ -26,8 +26,9 @@ enum lab_node_type {
|
|||
LAB_NODE_BUTTON_WINDOW_MENU,
|
||||
LAB_NODE_BUTTON_SHADE,
|
||||
LAB_NODE_BUTTON_OMNIPRESENT,
|
||||
LAB_NODE_BUTTON_ONTOP,
|
||||
LAB_NODE_BUTTON_FIRST = LAB_NODE_BUTTON_CLOSE,
|
||||
LAB_NODE_BUTTON_LAST = LAB_NODE_BUTTON_OMNIPRESENT,
|
||||
LAB_NODE_BUTTON_LAST = LAB_NODE_BUTTON_ONTOP,
|
||||
LAB_NODE_BUTTON,
|
||||
|
||||
LAB_NODE_TITLEBAR,
|
||||
|
|
|
|||
|
|
@ -291,6 +291,11 @@ static struct mouse_combos {
|
|||
.button = "Left",
|
||||
.event = "Click",
|
||||
.action = "ToggleOmnipresent",
|
||||
}, {
|
||||
.context = "OnTop",
|
||||
.button = "Left",
|
||||
.event = "Click",
|
||||
.action = "ToggleAlwaysOnTop",
|
||||
}, {
|
||||
.context = "Maximize",
|
||||
.button = "Right",
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ struct ssd {
|
|||
* such a small titlebar.
|
||||
*/
|
||||
bool was_squared;
|
||||
bool was_ontop;
|
||||
|
||||
struct wlr_box geometry;
|
||||
struct ssd_state_title {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ node_type_parse(const char *context)
|
|||
return LAB_NODE_BUTTON_SHADE;
|
||||
} else if (!strcasecmp(context, "AllDesktops")) {
|
||||
return LAB_NODE_BUTTON_OMNIPRESENT;
|
||||
} else if (!strcasecmp(context, "OnTop")) {
|
||||
return LAB_NODE_BUTTON_ONTOP;
|
||||
} else if (!strcasecmp(context, "Titlebar")) {
|
||||
return LAB_NODE_TITLEBAR;
|
||||
} else if (!strcasecmp(context, "Title")) {
|
||||
|
|
|
|||
|
|
@ -184,6 +184,8 @@ fill_section(const char *content, enum lab_node_type *buttons, int *count,
|
|||
type = LAB_NODE_BUTTON_SHADE;
|
||||
} else if (!strcmp(identifier, "desk")) {
|
||||
type = LAB_NODE_BUTTON_OMNIPRESENT;
|
||||
} else if (!strcmp(identifier, "ontop")) {
|
||||
type = LAB_NODE_BUTTON_ONTOP;
|
||||
} else {
|
||||
wlr_log(WLR_ERROR, "invalid titleLayout identifier '%s'",
|
||||
identifier);
|
||||
|
|
|
|||
|
|
@ -299,6 +299,12 @@ ssd_titlebar_update(struct ssd *ssd)
|
|||
ssd->state.was_omnipresent = view->visible_on_all_workspaces;
|
||||
}
|
||||
|
||||
if (ssd->state.was_ontop != view->layer) {
|
||||
set_alt_button_icon(ssd, LAB_NODE_BUTTON_ONTOP,
|
||||
view->layer);
|
||||
ssd->state.was_ontop = view->layer;
|
||||
}
|
||||
|
||||
if (width == ssd->state.geometry.width) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,7 +227,8 @@ ssd_update_geometry(struct ssd *ssd)
|
|||
bool state_changed = ssd->state.was_maximized != maximized
|
||||
|| ssd->state.was_shaded != view->shaded
|
||||
|| ssd->state.was_squared != squared
|
||||
|| ssd->state.was_omnipresent != view->visible_on_all_workspaces;
|
||||
|| ssd->state.was_omnipresent != view->visible_on_all_workspaces
|
||||
|| ssd->state.was_ontop != (view->layer == VIEW_LAYER_ALWAYS_ON_TOP);
|
||||
|
||||
/*
|
||||
* (Un)maximization updates titlebar visibility with
|
||||
|
|
|
|||
29
src/theme.c
29
src/theme.c
|
|
@ -315,6 +315,16 @@ load_buttons(struct theme *theme)
|
|||
.fallback_button = (const char[]){ 0x00, 0x1e, 0x1a, 0x16, 0x1e, 0x00 },
|
||||
.type = LAB_NODE_BUTTON_OMNIPRESENT,
|
||||
.state_set = LAB_BS_TOGGLED,
|
||||
}, {
|
||||
.name = "ontop",
|
||||
.fallback_button = (const char[]){ 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c },
|
||||
.type = LAB_NODE_BUTTON_ONTOP,
|
||||
.state_set = 0,
|
||||
}, {
|
||||
.name = "ontop_toggled",
|
||||
.fallback_button = (const char[]){ 0x00, 0x0c, 0x1e, 0x33, 0x21, 0x00 },
|
||||
.type = LAB_NODE_BUTTON_ONTOP,
|
||||
.state_set = LAB_BS_TOGGLED,
|
||||
}, {
|
||||
.name = "close",
|
||||
.fallback_button = (const char[]){ 0x33, 0x3f, 0x1e, 0x1e, 0x3f, 0x33 },
|
||||
|
|
@ -363,6 +373,17 @@ load_buttons(struct theme *theme)
|
|||
.type = LAB_NODE_BUTTON_OMNIPRESENT,
|
||||
.state_set = LAB_BS_TOGGLED | LAB_BS_HOVERED,
|
||||
/* no fallback (non-hover variant is used instead) */
|
||||
}, {
|
||||
.name = "ontop_hover",
|
||||
/* no fallback (non-hover variant is used instead) */
|
||||
.type = LAB_NODE_BUTTON_ONTOP,
|
||||
.state_set = LAB_BS_HOVERED,
|
||||
}, {
|
||||
.name = "ontop_toggled_hover",
|
||||
.alt_name = "ontop_hover_toggled",
|
||||
.type = LAB_NODE_BUTTON_ONTOP,
|
||||
.state_set = LAB_BS_TOGGLED | LAB_BS_HOVERED,
|
||||
/* no fallback (non-hover variant is used instead) */
|
||||
}, {
|
||||
.name = "close_hover",
|
||||
.type = LAB_NODE_BUTTON_CLOSE,
|
||||
|
|
@ -836,6 +857,10 @@ entry(struct theme *theme, const char *key, const char *value)
|
|||
parse_color(value, theme->window[SSD_ACTIVE]
|
||||
.button_colors[LAB_NODE_BUTTON_OMNIPRESENT]);
|
||||
}
|
||||
if (match_glob(key, "window.active.button.ontop.unpressed.image.color")) {
|
||||
parse_color(value, theme->window[SSD_ACTIVE]
|
||||
.button_colors[LAB_NODE_BUTTON_ONTOP]);
|
||||
}
|
||||
if (match_glob(key, "window.active.button.close.unpressed.image.color")) {
|
||||
parse_color(value, theme->window[SSD_ACTIVE]
|
||||
.button_colors[LAB_NODE_BUTTON_CLOSE]);
|
||||
|
|
@ -862,6 +887,10 @@ entry(struct theme *theme, const char *key, const char *value)
|
|||
parse_color(value, theme->window[SSD_INACTIVE]
|
||||
.button_colors[LAB_NODE_BUTTON_OMNIPRESENT]);
|
||||
}
|
||||
if (match_glob(key, "window.inactive.button.ontop.unpressed.image.color")) {
|
||||
parse_color(value, theme->window[SSD_INACTIVE]
|
||||
.button_colors[LAB_NODE_BUTTON_ONTOP]);
|
||||
}
|
||||
if (match_glob(key, "window.inactive.button.close.unpressed.image.color")) {
|
||||
parse_color(value, theme->window[SSD_INACTIVE]
|
||||
.button_colors[LAB_NODE_BUTTON_CLOSE]);
|
||||
|
|
|
|||
|
|
@ -1562,6 +1562,8 @@ view_toggle_always_on_top(struct view *view)
|
|||
} else {
|
||||
view_set_layer(view, VIEW_LAYER_ALWAYS_ON_TOP);
|
||||
}
|
||||
// Hack to update always-on-top ssd button state. May be wasteful, idk.
|
||||
ssd_update_geometry(view->ssd);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue