mirror of
https://github.com/labwc/labwc.git
synced 2026-03-06 01:40:15 -05:00
ssd: add optional omnipresent button
This commit is contained in:
parent
186a07be9b
commit
b7bccc8026
12 changed files with 165 additions and 52 deletions
|
|
@ -438,10 +438,11 @@ extending outward from the snapped edge.
|
||||||
- L: window label (aka. title)
|
- L: window label (aka. title)
|
||||||
- |: empty space (can be used instead of a title)
|
- |: empty space (can be used instead of a title)
|
||||||
- W: window menu
|
- W: window menu
|
||||||
- S: shade
|
|
||||||
- I: iconify
|
- I: iconify
|
||||||
- M: maximize
|
- M: maximize
|
||||||
- C: close
|
- C: close
|
||||||
|
- S: shade
|
||||||
|
- D: omnipresent
|
||||||
|
|
||||||
Example: WLIMC
|
Example: WLIMC
|
||||||
|
|
||||||
|
|
@ -613,11 +614,12 @@ extending outward from the snapped edge.
|
||||||
buttons and the window title are shown.
|
buttons and the window title are shown.
|
||||||
- Title: The area of the titlebar (including blank space) between
|
- Title: The area of the titlebar (including blank space) between
|
||||||
the window buttons, where the window title is displayed.
|
the window buttons, where the window title is displayed.
|
||||||
- WindowMenu: The button on the left.
|
- WindowMenu: A button that, by default, displays a window menu.
|
||||||
- Iconify: The button that looks like an underline.
|
- Iconify: A button that, by default, iconifies a window.
|
||||||
- Maximize: The button that looks like a box.
|
- Maximize: A button that, by default, toggles maximization of a window.
|
||||||
- Shade: A button that looks like an overline.
|
- Shade: A button that, by default, toggles window shading.
|
||||||
- Close: The button that looks like an X.
|
- Omnipresent: A button that, by default, toggles omnipresence of a window.
|
||||||
|
- Close: A button that, by default, closses a window.
|
||||||
- Top: The top edge of the window's border.
|
- Top: The top edge of the window's border.
|
||||||
- Bottom: The bottom edge of the window's border.
|
- Bottom: The bottom edge of the window's border.
|
||||||
- Left: The left edge of the window's border.
|
- Left: The left edge of the window's border.
|
||||||
|
|
|
||||||
|
|
@ -447,6 +447,12 @@
|
||||||
</mousebind>
|
</mousebind>
|
||||||
</context>
|
</context>
|
||||||
|
|
||||||
|
<context name="Ominpresent">
|
||||||
|
<mousebind button="Left" action="Click">
|
||||||
|
<action name="ToggleOmnipresent" />
|
||||||
|
</mousebind>
|
||||||
|
</context>
|
||||||
|
|
||||||
<context name="Iconify">
|
<context name="Iconify">
|
||||||
<mousebind button="Left" action="Click">
|
<mousebind button="Left" action="Click">
|
||||||
<action name="Iconify" />
|
<action name="Iconify" />
|
||||||
|
|
|
||||||
|
|
@ -327,6 +327,11 @@ static struct mouse_combos {
|
||||||
.button = "Left",
|
.button = "Left",
|
||||||
.event = "Click",
|
.event = "Click",
|
||||||
.action = "ToggleShade",
|
.action = "ToggleShade",
|
||||||
|
}, {
|
||||||
|
.context = "Omnipresent",
|
||||||
|
.button = "Left",
|
||||||
|
.event = "Click",
|
||||||
|
.action = "ToggleOmnipresent",
|
||||||
}, {
|
}, {
|
||||||
.context = "Maximize",
|
.context = "Maximize",
|
||||||
.button = "Right",
|
.button = "Right",
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,18 @@ struct ssd {
|
||||||
* don't update things we don't have to.
|
* don't update things we don't have to.
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
bool was_shaded; /* To toggle icon on shade */
|
/* Button icons need to be swapped on shade or omnipresent toggles */
|
||||||
bool was_maximized; /* To un-round corner buttons and toggle icon on maximize */
|
bool was_shaded;
|
||||||
bool was_tiled_not_maximized; /* To un-round corner buttons */
|
bool was_omnipresent;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Corners need to be (un)rounded when toggling tiling or
|
||||||
|
* maximization, and the button needs to be swapped on
|
||||||
|
* maximization toggles.
|
||||||
|
*/
|
||||||
|
bool was_maximized;
|
||||||
|
bool was_tiled_not_maximized;
|
||||||
|
|
||||||
struct wlr_box geometry;
|
struct wlr_box geometry;
|
||||||
struct ssd_state_title {
|
struct ssd_state_title {
|
||||||
char *text;
|
char *text;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ enum ssd_part_type {
|
||||||
LAB_SSD_BUTTON_ICONIFY,
|
LAB_SSD_BUTTON_ICONIFY,
|
||||||
LAB_SSD_BUTTON_WINDOW_MENU,
|
LAB_SSD_BUTTON_WINDOW_MENU,
|
||||||
LAB_SSD_BUTTON_SHADE,
|
LAB_SSD_BUTTON_SHADE,
|
||||||
|
LAB_SSD_BUTTON_OMNIPRESENT,
|
||||||
LAB_SSD_PART_TITLEBAR,
|
LAB_SSD_PART_TITLEBAR,
|
||||||
LAB_SSD_PART_TITLEBAR_CORNER_RIGHT,
|
LAB_SSD_PART_TITLEBAR_CORNER_RIGHT,
|
||||||
LAB_SSD_PART_TITLEBAR_CORNER_LEFT,
|
LAB_SSD_PART_TITLEBAR_CORNER_LEFT,
|
||||||
|
|
|
||||||
|
|
@ -55,11 +55,13 @@ struct theme {
|
||||||
float window_active_button_max_unpressed_image_color[4];
|
float window_active_button_max_unpressed_image_color[4];
|
||||||
float window_active_button_close_unpressed_image_color[4];
|
float window_active_button_close_unpressed_image_color[4];
|
||||||
float window_active_button_shade_unpressed_image_color[4];
|
float window_active_button_shade_unpressed_image_color[4];
|
||||||
|
float window_active_button_omnipresent_unpressed_image_color[4];
|
||||||
float window_inactive_button_menu_unpressed_image_color[4];
|
float window_inactive_button_menu_unpressed_image_color[4];
|
||||||
float window_inactive_button_iconify_unpressed_image_color[4];
|
float window_inactive_button_iconify_unpressed_image_color[4];
|
||||||
float window_inactive_button_max_unpressed_image_color[4];
|
float window_inactive_button_max_unpressed_image_color[4];
|
||||||
float window_inactive_button_close_unpressed_image_color[4];
|
float window_inactive_button_close_unpressed_image_color[4];
|
||||||
float window_inactive_button_shade_unpressed_image_color[4];
|
float window_inactive_button_shade_unpressed_image_color[4];
|
||||||
|
float window_inactive_button_omnipresent_unpressed_image_color[4];
|
||||||
/* TODO: add pressed and hover colors for buttons */
|
/* TODO: add pressed and hover colors for buttons */
|
||||||
|
|
||||||
int menu_item_padding_x;
|
int menu_item_padding_x;
|
||||||
|
|
@ -118,6 +120,8 @@ struct theme {
|
||||||
struct lab_data_buffer *button_menu_active_unpressed;
|
struct lab_data_buffer *button_menu_active_unpressed;
|
||||||
struct lab_data_buffer *button_shade_active_unpressed;
|
struct lab_data_buffer *button_shade_active_unpressed;
|
||||||
struct lab_data_buffer *button_unshade_active_unpressed;
|
struct lab_data_buffer *button_unshade_active_unpressed;
|
||||||
|
struct lab_data_buffer *button_omnipresent_active_unpressed;
|
||||||
|
struct lab_data_buffer *button_exclusive_active_unpressed;
|
||||||
|
|
||||||
struct lab_data_buffer *button_close_inactive_unpressed;
|
struct lab_data_buffer *button_close_inactive_unpressed;
|
||||||
struct lab_data_buffer *button_maximize_inactive_unpressed;
|
struct lab_data_buffer *button_maximize_inactive_unpressed;
|
||||||
|
|
@ -126,6 +130,8 @@ struct theme {
|
||||||
struct lab_data_buffer *button_menu_inactive_unpressed;
|
struct lab_data_buffer *button_menu_inactive_unpressed;
|
||||||
struct lab_data_buffer *button_shade_inactive_unpressed;
|
struct lab_data_buffer *button_shade_inactive_unpressed;
|
||||||
struct lab_data_buffer *button_unshade_inactive_unpressed;
|
struct lab_data_buffer *button_unshade_inactive_unpressed;
|
||||||
|
struct lab_data_buffer *button_omnipresent_inactive_unpressed;
|
||||||
|
struct lab_data_buffer *button_exclusive_inactive_unpressed;
|
||||||
|
|
||||||
/* hover variants are optional and may be NULL */
|
/* hover variants are optional and may be NULL */
|
||||||
struct lab_data_buffer *button_close_active_hover;
|
struct lab_data_buffer *button_close_active_hover;
|
||||||
|
|
@ -135,6 +141,8 @@ struct theme {
|
||||||
struct lab_data_buffer *button_menu_active_hover;
|
struct lab_data_buffer *button_menu_active_hover;
|
||||||
struct lab_data_buffer *button_shade_active_hover;
|
struct lab_data_buffer *button_shade_active_hover;
|
||||||
struct lab_data_buffer *button_unshade_active_hover;
|
struct lab_data_buffer *button_unshade_active_hover;
|
||||||
|
struct lab_data_buffer *button_omnipresent_active_hover;
|
||||||
|
struct lab_data_buffer *button_exclusive_active_hover;
|
||||||
|
|
||||||
struct lab_data_buffer *button_close_inactive_hover;
|
struct lab_data_buffer *button_close_inactive_hover;
|
||||||
struct lab_data_buffer *button_maximize_inactive_hover;
|
struct lab_data_buffer *button_maximize_inactive_hover;
|
||||||
|
|
@ -143,6 +151,8 @@ struct theme {
|
||||||
struct lab_data_buffer *button_menu_inactive_hover;
|
struct lab_data_buffer *button_menu_inactive_hover;
|
||||||
struct lab_data_buffer *button_shade_inactive_hover;
|
struct lab_data_buffer *button_shade_inactive_hover;
|
||||||
struct lab_data_buffer *button_unshade_inactive_hover;
|
struct lab_data_buffer *button_unshade_inactive_hover;
|
||||||
|
struct lab_data_buffer *button_omnipresent_inactive_hover;
|
||||||
|
struct lab_data_buffer *button_exclusive_inactive_hover;
|
||||||
|
|
||||||
struct lab_data_buffer *corner_top_left_active_normal;
|
struct lab_data_buffer *corner_top_left_active_normal;
|
||||||
struct lab_data_buffer *corner_top_right_active_normal;
|
struct lab_data_buffer *corner_top_right_active_normal;
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,8 @@ context_from_str(const char *str)
|
||||||
return LAB_SSD_BUTTON_WINDOW_MENU;
|
return LAB_SSD_BUTTON_WINDOW_MENU;
|
||||||
} else if (!strcasecmp(str, "Shade")) {
|
} else if (!strcasecmp(str, "Shade")) {
|
||||||
return LAB_SSD_BUTTON_SHADE;
|
return LAB_SSD_BUTTON_SHADE;
|
||||||
|
} else if (!strcasecmp(str, "Omnipresent")) {
|
||||||
|
return LAB_SSD_BUTTON_OMNIPRESENT;
|
||||||
} else if (!strcasecmp(str, "Titlebar")) {
|
} else if (!strcasecmp(str, "Titlebar")) {
|
||||||
return LAB_SSD_PART_TITLEBAR;
|
return LAB_SSD_PART_TITLEBAR;
|
||||||
} else if (!strcasecmp(str, "Title")) {
|
} else if (!strcasecmp(str, "Title")) {
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,9 @@ fill_title_layout(char *nodename, char *content)
|
||||||
case 'S':
|
case 'S':
|
||||||
type = LAB_SSD_BUTTON_SHADE;
|
type = LAB_SSD_BUTTON_SHADE;
|
||||||
break;
|
break;
|
||||||
/* case 'D': omnipresent */
|
case 'D':
|
||||||
|
type = LAB_SSD_BUTTON_OMNIPRESENT;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,21 @@ add_button(struct ssd *ssd, struct ssd_sub_tree *subtree, enum ssd_part_type typ
|
||||||
active ? &theme->button_unshade_active_hover->base
|
active ? &theme->button_unshade_active_hover->base
|
||||||
: &theme->button_unshade_inactive_hover->base);
|
: &theme->button_unshade_inactive_hover->base);
|
||||||
break;
|
break;
|
||||||
|
case LAB_SSD_BUTTON_OMNIPRESENT:
|
||||||
|
/* Omnipresent button has an alternate state when enabled */
|
||||||
|
btn_root = add_scene_button(&subtree->parts, type, parent,
|
||||||
|
active ? &theme->button_omnipresent_active_unpressed->base
|
||||||
|
: &theme->button_omnipresent_inactive_unpressed->base,
|
||||||
|
active ? &theme->button_omnipresent_active_hover->base
|
||||||
|
: &theme->button_omnipresent_inactive_hover->base,
|
||||||
|
x, view);
|
||||||
|
btn = node_ssd_button_from_node(btn_root->node);
|
||||||
|
add_toggled_icon(btn, &subtree->parts, LAB_SSD_BUTTON_OMNIPRESENT,
|
||||||
|
active ? &theme->button_exclusive_active_unpressed->base
|
||||||
|
: &theme->button_exclusive_inactive_unpressed->base,
|
||||||
|
active ? &theme->button_exclusive_active_hover->base
|
||||||
|
: &theme->button_exclusive_inactive_hover->base);
|
||||||
|
break;
|
||||||
case LAB_SSD_BUTTON_CLOSE:
|
case LAB_SSD_BUTTON_CLOSE:
|
||||||
add_scene_button(&subtree->parts, type, parent,
|
add_scene_button(&subtree->parts, type, parent,
|
||||||
active ? &theme->button_close_active_unpressed->base
|
active ? &theme->button_close_active_unpressed->base
|
||||||
|
|
@ -164,6 +179,10 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
set_alt_button_icon(ssd, LAB_SSD_BUTTON_SHADE, true);
|
set_alt_button_icon(ssd, LAB_SSD_BUTTON_SHADE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (view->visible_on_all_workspaces) {
|
||||||
|
set_alt_button_icon(ssd, LAB_SSD_BUTTON_OMNIPRESENT, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (view_is_tiled_and_notify_tiled(view) && !maximized) {
|
if (view_is_tiled_and_notify_tiled(view) && !maximized) {
|
||||||
set_squared_corners(ssd, true);
|
set_squared_corners(ssd, true);
|
||||||
ssd->state.was_tiled_not_maximized = true;
|
ssd->state.was_tiled_not_maximized = true;
|
||||||
|
|
@ -230,24 +249,30 @@ ssd_titlebar_update(struct ssd *ssd)
|
||||||
struct theme *theme = view->server->theme;
|
struct theme *theme = view->server->theme;
|
||||||
|
|
||||||
bool maximized = view->maximized == VIEW_AXIS_BOTH;
|
bool maximized = view->maximized == VIEW_AXIS_BOTH;
|
||||||
bool tiled_not_maximized = view_is_tiled_and_notify_tiled(ssd->view)
|
bool tiled_not_maximized =
|
||||||
&& !maximized;
|
view_is_tiled_and_notify_tiled(ssd->view) && !maximized;
|
||||||
|
|
||||||
if (ssd->state.was_maximized != maximized
|
if (ssd->state.was_maximized != maximized
|
||||||
|| ssd->state.was_shaded != view->shaded
|
|
||||||
|| ssd->state.was_tiled_not_maximized != tiled_not_maximized) {
|
|| ssd->state.was_tiled_not_maximized != tiled_not_maximized) {
|
||||||
set_squared_corners(ssd, maximized || tiled_not_maximized);
|
set_squared_corners(ssd, maximized || tiled_not_maximized);
|
||||||
if (ssd->state.was_maximized != maximized) {
|
if (ssd->state.was_maximized != maximized) {
|
||||||
set_alt_button_icon(ssd, LAB_SSD_BUTTON_MAXIMIZE, maximized);
|
set_alt_button_icon(ssd, LAB_SSD_BUTTON_MAXIMIZE, maximized);
|
||||||
}
|
}
|
||||||
if (ssd->state.was_shaded != view->shaded) {
|
|
||||||
set_alt_button_icon(ssd, LAB_SSD_BUTTON_SHADE, view->shaded);
|
|
||||||
}
|
|
||||||
ssd->state.was_maximized = maximized;
|
ssd->state.was_maximized = maximized;
|
||||||
ssd->state.was_shaded = view->shaded;
|
|
||||||
ssd->state.was_tiled_not_maximized = tiled_not_maximized;
|
ssd->state.was_tiled_not_maximized = tiled_not_maximized;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ssd->state.was_shaded != view->shaded) {
|
||||||
|
set_alt_button_icon(ssd, LAB_SSD_BUTTON_SHADE, view->shaded);
|
||||||
|
ssd->state.was_shaded = view->shaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ssd->state.was_omnipresent != view->visible_on_all_workspaces) {
|
||||||
|
set_alt_button_icon(ssd, LAB_SSD_BUTTON_OMNIPRESENT,
|
||||||
|
view->visible_on_all_workspaces);
|
||||||
|
ssd->state.was_omnipresent = view->visible_on_all_workspaces;
|
||||||
|
}
|
||||||
|
|
||||||
if (width == ssd->state.geometry.width) {
|
if (width == ssd->state.geometry.width) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -221,13 +221,16 @@ ssd_update_geometry(struct ssd *ssd)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct view *view = ssd->view;
|
||||||
|
assert(view);
|
||||||
|
|
||||||
struct wlr_box cached = ssd->state.geometry;
|
struct wlr_box cached = ssd->state.geometry;
|
||||||
struct wlr_box current = ssd->view->current;
|
struct wlr_box current = view->current;
|
||||||
|
|
||||||
int min_view_width = rc.theme->window_button_width * (
|
int min_view_width = rc.theme->window_button_width * (
|
||||||
wl_list_length(&rc.title_buttons_left) + wl_list_length(&rc.title_buttons_right));
|
wl_list_length(&rc.title_buttons_left) + wl_list_length(&rc.title_buttons_right));
|
||||||
int eff_width = current.width;
|
int eff_width = current.width;
|
||||||
int eff_height = view_effective_height(ssd->view, /* use_pending */ false);
|
int eff_height = view_effective_height(view, /* use_pending */ false);
|
||||||
|
|
||||||
if (eff_width > 0 && eff_width < min_view_width) {
|
if (eff_width > 0 && eff_width < min_view_width) {
|
||||||
/*
|
/*
|
||||||
|
|
@ -241,39 +244,31 @@ ssd_update_geometry(struct ssd *ssd)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eff_width == cached.width && eff_height == cached.height) {
|
bool update_area = eff_width != cached.width || eff_height != cached.height;
|
||||||
if (current.x != cached.x || current.y != cached.y) {
|
bool update_extents = update_area
|
||||||
/* Dynamically resize extents based on position and usable_area */
|
|| current.x != cached.x || current.y != cached.y;
|
||||||
ssd_extents_update(ssd);
|
|
||||||
ssd->state.geometry = current;
|
bool maximized = view->maximized == VIEW_AXIS_BOTH;
|
||||||
}
|
bool tiled_not_maximized = view_is_tiled(view) && !maximized;
|
||||||
bool maximized = ssd->view->maximized == VIEW_AXIS_BOTH;
|
|
||||||
if (ssd->state.was_maximized != maximized
|
bool state_changed = ssd->state.was_maximized != maximized
|
||||||
|| ssd->state.was_shaded != ssd->view->shaded) {
|
|| ssd->state.was_shaded != view->shaded
|
||||||
ssd_titlebar_update(ssd);
|
|| ssd->state.was_tiled_not_maximized != tiled_not_maximized
|
||||||
ssd_border_update(ssd);
|
|| ssd->state.was_omnipresent != view->visible_on_all_workspaces;
|
||||||
ssd_shadow_update(ssd);
|
|
||||||
/*
|
if (update_extents) {
|
||||||
* Not strictly necessary as ssd_titlebar_update()
|
ssd_extents_update(ssd);
|
||||||
* already sets these values, but set here to be safe.
|
}
|
||||||
*/
|
|
||||||
ssd->state.was_maximized = maximized;
|
if (update_area || state_changed) {
|
||||||
ssd->state.was_shaded = ssd->view->shaded;
|
ssd_titlebar_update(ssd);
|
||||||
}
|
ssd_border_update(ssd);
|
||||||
bool tiled_and_not_maximized = view_is_tiled(ssd->view) && !maximized;
|
ssd_shadow_update(ssd);
|
||||||
if (ssd->state.was_tiled_not_maximized != tiled_and_not_maximized) {
|
}
|
||||||
ssd_titlebar_update(ssd);
|
|
||||||
ssd_border_update(ssd);
|
if (update_extents) {
|
||||||
/* see above about being future proof */
|
ssd->state.geometry = current;
|
||||||
ssd->state.was_tiled_not_maximized = tiled_and_not_maximized;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
ssd_extents_update(ssd);
|
|
||||||
ssd_titlebar_update(ssd);
|
|
||||||
ssd_border_update(ssd);
|
|
||||||
ssd_shadow_update(ssd);
|
|
||||||
ssd->state.geometry = current;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
57
src/theme.c
57
src/theme.c
|
|
@ -89,7 +89,9 @@ match_button_by_name(struct title_button *b, const char *icon_name)
|
||||||
|| (b->type == LAB_SSD_BUTTON_ICONIFY && !strcmp(icon_name, "iconify"))
|
|| (b->type == LAB_SSD_BUTTON_ICONIFY && !strcmp(icon_name, "iconify"))
|
||||||
|| (b->type == LAB_SSD_BUTTON_CLOSE && !strcmp(icon_name, "close"))
|
|| (b->type == LAB_SSD_BUTTON_CLOSE && !strcmp(icon_name, "close"))
|
||||||
|| (b->type == LAB_SSD_BUTTON_SHADE && !strcmp(icon_name, "shade"))
|
|| (b->type == LAB_SSD_BUTTON_SHADE && !strcmp(icon_name, "shade"))
|
||||||
|| (b->type == LAB_SSD_BUTTON_SHADE && !strcmp(icon_name, "shade_toggled"));
|
|| (b->type == LAB_SSD_BUTTON_SHADE && !strcmp(icon_name, "shade_toggled"))
|
||||||
|
|| (b->type == LAB_SSD_BUTTON_OMNIPRESENT && !strcmp(icon_name, "desk"))
|
||||||
|
|| (b->type == LAB_SSD_BUTTON_OMNIPRESENT && !strcmp(icon_name, "desk_toggled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum corner
|
static enum corner
|
||||||
|
|
@ -263,6 +265,20 @@ load_buttons(struct theme *theme)
|
||||||
.active.rgba = theme->window_active_button_shade_unpressed_image_color,
|
.active.rgba = theme->window_active_button_shade_unpressed_image_color,
|
||||||
.inactive.buffer = &theme->button_unshade_inactive_unpressed,
|
.inactive.buffer = &theme->button_unshade_inactive_unpressed,
|
||||||
.inactive.rgba = theme->window_inactive_button_shade_unpressed_image_color,
|
.inactive.rgba = theme->window_inactive_button_shade_unpressed_image_color,
|
||||||
|
}, {
|
||||||
|
.name = "desk",
|
||||||
|
.fallback_button = (const char[]){ 0x33, 0x33, 0x00, 0x00, 0x33, 0x33 },
|
||||||
|
.active.buffer = &theme->button_omnipresent_active_unpressed,
|
||||||
|
.active.rgba = theme->window_active_button_omnipresent_unpressed_image_color,
|
||||||
|
.inactive.buffer = &theme->button_omnipresent_inactive_unpressed,
|
||||||
|
.inactive.rgba = theme->window_inactive_button_omnipresent_unpressed_image_color,
|
||||||
|
}, {
|
||||||
|
.name = "desk_toggled",
|
||||||
|
.fallback_button = (const char[]){ 0x00, 0x1e, 0x1a, 0x16, 0x1e, 0x00 },
|
||||||
|
.active.buffer = &theme->button_exclusive_active_unpressed,
|
||||||
|
.active.rgba = theme->window_active_button_omnipresent_unpressed_image_color,
|
||||||
|
.inactive.buffer = &theme->button_exclusive_inactive_unpressed,
|
||||||
|
.inactive.rgba = theme->window_inactive_button_omnipresent_unpressed_image_color,
|
||||||
}, {
|
}, {
|
||||||
.name = "close",
|
.name = "close",
|
||||||
.fallback_button = (const char[]){ 0x33, 0x3f, 0x1e, 0x1e, 0x3f, 0x33 },
|
.fallback_button = (const char[]){ 0x33, 0x3f, 0x1e, 0x1e, 0x3f, 0x33 },
|
||||||
|
|
@ -314,6 +330,21 @@ load_buttons(struct theme *theme)
|
||||||
.active.rgba = theme->window_active_button_shade_unpressed_image_color,
|
.active.rgba = theme->window_active_button_shade_unpressed_image_color,
|
||||||
.inactive.buffer = &theme->button_unshade_inactive_hover,
|
.inactive.buffer = &theme->button_unshade_inactive_hover,
|
||||||
.inactive.rgba = theme->window_inactive_button_shade_unpressed_image_color,
|
.inactive.rgba = theme->window_inactive_button_shade_unpressed_image_color,
|
||||||
|
}, {
|
||||||
|
.name = "desk_hover",
|
||||||
|
/* no fallback (non-hover variant is used instead) */
|
||||||
|
.active.buffer = &theme->button_omnipresent_active_hover,
|
||||||
|
.active.rgba = theme->window_active_button_omnipresent_unpressed_image_color,
|
||||||
|
.inactive.buffer = &theme->button_omnipresent_inactive_hover,
|
||||||
|
.inactive.rgba = theme->window_inactive_button_omnipresent_unpressed_image_color,
|
||||||
|
}, {
|
||||||
|
.name = "desk_toggled_hover",
|
||||||
|
.alt_name = "desk_hover_toggled",
|
||||||
|
/* no fallback (non-hover variant is used instead) */
|
||||||
|
.active.buffer = &theme->button_exclusive_active_hover,
|
||||||
|
.active.rgba = theme->window_active_button_omnipresent_unpressed_image_color,
|
||||||
|
.inactive.buffer = &theme->button_exclusive_inactive_hover,
|
||||||
|
.inactive.rgba = theme->window_inactive_button_omnipresent_unpressed_image_color,
|
||||||
}, {
|
}, {
|
||||||
.name = "close_hover",
|
.name = "close_hover",
|
||||||
/* no fallback (non-hover variant is used instead) */
|
/* no fallback (non-hover variant is used instead) */
|
||||||
|
|
@ -545,6 +576,8 @@ theme_builtin(struct theme *theme, struct server *server)
|
||||||
theme->window_active_button_max_unpressed_image_color);
|
theme->window_active_button_max_unpressed_image_color);
|
||||||
parse_hexstr("#000000",
|
parse_hexstr("#000000",
|
||||||
theme->window_active_button_shade_unpressed_image_color);
|
theme->window_active_button_shade_unpressed_image_color);
|
||||||
|
parse_hexstr("#000000",
|
||||||
|
theme->window_active_button_omnipresent_unpressed_image_color);
|
||||||
parse_hexstr("#000000",
|
parse_hexstr("#000000",
|
||||||
theme->window_active_button_close_unpressed_image_color);
|
theme->window_active_button_close_unpressed_image_color);
|
||||||
parse_hexstr("#000000",
|
parse_hexstr("#000000",
|
||||||
|
|
@ -555,6 +588,8 @@ theme_builtin(struct theme *theme, struct server *server)
|
||||||
theme->window_inactive_button_max_unpressed_image_color);
|
theme->window_inactive_button_max_unpressed_image_color);
|
||||||
parse_hexstr("#000000",
|
parse_hexstr("#000000",
|
||||||
theme->window_inactive_button_shade_unpressed_image_color);
|
theme->window_inactive_button_shade_unpressed_image_color);
|
||||||
|
parse_hexstr("#000000",
|
||||||
|
theme->window_inactive_button_omnipresent_unpressed_image_color);
|
||||||
parse_hexstr("#000000",
|
parse_hexstr("#000000",
|
||||||
theme->window_inactive_button_close_unpressed_image_color);
|
theme->window_inactive_button_close_unpressed_image_color);
|
||||||
|
|
||||||
|
|
@ -721,6 +756,8 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
theme->window_active_button_max_unpressed_image_color);
|
theme->window_active_button_max_unpressed_image_color);
|
||||||
parse_hexstr(value,
|
parse_hexstr(value,
|
||||||
theme->window_active_button_shade_unpressed_image_color);
|
theme->window_active_button_shade_unpressed_image_color);
|
||||||
|
parse_hexstr(value,
|
||||||
|
theme->window_active_button_omnipresent_unpressed_image_color);
|
||||||
parse_hexstr(value,
|
parse_hexstr(value,
|
||||||
theme->window_active_button_close_unpressed_image_color);
|
theme->window_active_button_close_unpressed_image_color);
|
||||||
}
|
}
|
||||||
|
|
@ -733,6 +770,8 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
theme->window_inactive_button_max_unpressed_image_color);
|
theme->window_inactive_button_max_unpressed_image_color);
|
||||||
parse_hexstr(value,
|
parse_hexstr(value,
|
||||||
theme->window_inactive_button_shade_unpressed_image_color);
|
theme->window_inactive_button_shade_unpressed_image_color);
|
||||||
|
parse_hexstr(value,
|
||||||
|
theme->window_inactive_button_omnipresent_unpressed_image_color);
|
||||||
parse_hexstr(value,
|
parse_hexstr(value,
|
||||||
theme->window_inactive_button_close_unpressed_image_color);
|
theme->window_inactive_button_close_unpressed_image_color);
|
||||||
}
|
}
|
||||||
|
|
@ -754,6 +793,10 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
parse_hexstr(value,
|
parse_hexstr(value,
|
||||||
theme->window_active_button_shade_unpressed_image_color);
|
theme->window_active_button_shade_unpressed_image_color);
|
||||||
}
|
}
|
||||||
|
if (match_glob(key, "window.active.button.omnipresent.unpressed.image.color")) {
|
||||||
|
parse_hexstr(value,
|
||||||
|
theme->window_active_button_omnipresent_unpressed_image_color);
|
||||||
|
}
|
||||||
if (match_glob(key, "window.active.button.close.unpressed.image.color")) {
|
if (match_glob(key, "window.active.button.close.unpressed.image.color")) {
|
||||||
parse_hexstr(value,
|
parse_hexstr(value,
|
||||||
theme->window_active_button_close_unpressed_image_color);
|
theme->window_active_button_close_unpressed_image_color);
|
||||||
|
|
@ -774,6 +817,10 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
parse_hexstr(value,
|
parse_hexstr(value,
|
||||||
theme->window_inactive_button_shade_unpressed_image_color);
|
theme->window_inactive_button_shade_unpressed_image_color);
|
||||||
}
|
}
|
||||||
|
if (match_glob(key, "window.inactive.button.omnipresent.unpressed.image.color")) {
|
||||||
|
parse_hexstr(value,
|
||||||
|
theme->window_inactive_button_omnipresent_unpressed_image_color);
|
||||||
|
}
|
||||||
if (match_glob(key, "window.inactive.button.close.unpressed.image.color")) {
|
if (match_glob(key, "window.inactive.button.close.unpressed.image.color")) {
|
||||||
parse_hexstr(value,
|
parse_hexstr(value,
|
||||||
theme->window_inactive_button_close_unpressed_image_color);
|
theme->window_inactive_button_close_unpressed_image_color);
|
||||||
|
|
@ -1494,6 +1541,8 @@ theme_finish(struct theme *theme)
|
||||||
zdrop(&theme->button_restore_active_unpressed);
|
zdrop(&theme->button_restore_active_unpressed);
|
||||||
zdrop(&theme->button_shade_active_unpressed);
|
zdrop(&theme->button_shade_active_unpressed);
|
||||||
zdrop(&theme->button_unshade_active_unpressed);
|
zdrop(&theme->button_unshade_active_unpressed);
|
||||||
|
zdrop(&theme->button_omnipresent_active_unpressed);
|
||||||
|
zdrop(&theme->button_exclusive_active_unpressed);
|
||||||
zdrop(&theme->button_iconify_active_unpressed);
|
zdrop(&theme->button_iconify_active_unpressed);
|
||||||
zdrop(&theme->button_menu_active_unpressed);
|
zdrop(&theme->button_menu_active_unpressed);
|
||||||
|
|
||||||
|
|
@ -1502,6 +1551,8 @@ theme_finish(struct theme *theme)
|
||||||
zdrop(&theme->button_restore_inactive_unpressed);
|
zdrop(&theme->button_restore_inactive_unpressed);
|
||||||
zdrop(&theme->button_shade_inactive_unpressed);
|
zdrop(&theme->button_shade_inactive_unpressed);
|
||||||
zdrop(&theme->button_unshade_inactive_unpressed);
|
zdrop(&theme->button_unshade_inactive_unpressed);
|
||||||
|
zdrop(&theme->button_omnipresent_inactive_unpressed);
|
||||||
|
zdrop(&theme->button_exclusive_inactive_unpressed);
|
||||||
zdrop(&theme->button_iconify_inactive_unpressed);
|
zdrop(&theme->button_iconify_inactive_unpressed);
|
||||||
zdrop(&theme->button_menu_inactive_unpressed);
|
zdrop(&theme->button_menu_inactive_unpressed);
|
||||||
|
|
||||||
|
|
@ -1510,6 +1561,8 @@ theme_finish(struct theme *theme)
|
||||||
zdrop(&theme->button_restore_active_hover);
|
zdrop(&theme->button_restore_active_hover);
|
||||||
zdrop(&theme->button_shade_active_hover);
|
zdrop(&theme->button_shade_active_hover);
|
||||||
zdrop(&theme->button_unshade_active_hover);
|
zdrop(&theme->button_unshade_active_hover);
|
||||||
|
zdrop(&theme->button_omnipresent_active_hover);
|
||||||
|
zdrop(&theme->button_exclusive_active_hover);
|
||||||
zdrop(&theme->button_iconify_active_hover);
|
zdrop(&theme->button_iconify_active_hover);
|
||||||
zdrop(&theme->button_menu_active_hover);
|
zdrop(&theme->button_menu_active_hover);
|
||||||
|
|
||||||
|
|
@ -1518,6 +1571,8 @@ theme_finish(struct theme *theme)
|
||||||
zdrop(&theme->button_restore_inactive_hover);
|
zdrop(&theme->button_restore_inactive_hover);
|
||||||
zdrop(&theme->button_shade_inactive_hover);
|
zdrop(&theme->button_shade_inactive_hover);
|
||||||
zdrop(&theme->button_unshade_inactive_hover);
|
zdrop(&theme->button_unshade_inactive_hover);
|
||||||
|
zdrop(&theme->button_omnipresent_inactive_hover);
|
||||||
|
zdrop(&theme->button_exclusive_inactive_hover);
|
||||||
zdrop(&theme->button_iconify_inactive_hover);
|
zdrop(&theme->button_iconify_inactive_hover);
|
||||||
zdrop(&theme->button_menu_inactive_hover);
|
zdrop(&theme->button_menu_inactive_hover);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1494,6 +1494,7 @@ view_toggle_visible_on_all_workspaces(struct view *view)
|
||||||
{
|
{
|
||||||
assert(view);
|
assert(view);
|
||||||
view->visible_on_all_workspaces = !view->visible_on_all_workspaces;
|
view->visible_on_all_workspaces = !view->visible_on_all_workspaces;
|
||||||
|
ssd_update_geometry(view->ssd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue