mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
theme: add option osd.window-switcher.item.active.border.width
...and change default values for the variables below to keep the window-switcher look the same as it was at the last release. osd.window-switcher.padding = 4 osd.window-switcher.item.padding.y = 1 osd.window-switcher.item.active.border.width = 2
This commit is contained in:
parent
55bf79c3fe
commit
660127acb0
5 changed files with 24 additions and 19 deletions
|
|
@ -151,8 +151,7 @@ elements are not listed here, but are supported.
|
||||||
|
|
||||||
*osd.window-switcher.padding*
|
*osd.window-switcher.padding*
|
||||||
Padding of window switcher in pixels. This is the space between the
|
Padding of window switcher in pixels. This is the space between the
|
||||||
window-switcher border and its items. Inherits *osd.border.width* if
|
window-switcher border and its items. Default is 4.
|
||||||
not set.
|
|
||||||
|
|
||||||
*osd.window-switcher.item.padding.x*
|
*osd.window-switcher.item.padding.x*
|
||||||
Horizontal padding of window switcher entries in pixels.
|
Horizontal padding of window switcher entries in pixels.
|
||||||
|
|
@ -160,7 +159,11 @@ elements are not listed here, but are supported.
|
||||||
|
|
||||||
*osd.window-switcher.item.padding.y*
|
*osd.window-switcher.item.padding.y*
|
||||||
Vertical padding of window switcher entries in pixels.
|
Vertical padding of window switcher entries in pixels.
|
||||||
Default is 6.
|
Default is 1.
|
||||||
|
|
||||||
|
*osd.window-switcher.item.active.border.width*
|
||||||
|
Border width of the selection box in the window switcher in pixels.
|
||||||
|
Default is 2.
|
||||||
|
|
||||||
*border.color*
|
*border.color*
|
||||||
Set all border colors. This is obsolete, but supported for backward
|
Set all border colors. This is obsolete, but supported for backward
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ osd.border.width: 1
|
||||||
osd.label.text.color: #000000
|
osd.label.text.color: #000000
|
||||||
|
|
||||||
osd.window-switcher.width: 600
|
osd.window-switcher.width: 600
|
||||||
osd.window-switcher.padding: 1
|
osd.window-switcher.padding: 4
|
||||||
osd.window-switcher.item.padding.x: 10
|
osd.window-switcher.item.padding.x: 10
|
||||||
osd.window-switcher.item.padding.y: 6
|
osd.window-switcher.item.padding.y: 1
|
||||||
|
osd.window-switcher.item.active.border.width: 2
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ struct theme {
|
||||||
int osd_window_switcher_padding;
|
int osd_window_switcher_padding;
|
||||||
int osd_window_switcher_item_padding_x;
|
int osd_window_switcher_item_padding_x;
|
||||||
int osd_window_switcher_item_padding_y;
|
int osd_window_switcher_item_padding_y;
|
||||||
|
int osd_window_switcher_item_active_border_width;
|
||||||
|
|
||||||
/* textures */
|
/* textures */
|
||||||
struct lab_data_buffer *xbm_close_active_unpressed;
|
struct lab_data_buffer *xbm_close_active_unpressed;
|
||||||
|
|
|
||||||
17
src/osd.c
17
src/osd.c
|
|
@ -339,12 +339,10 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h,
|
||||||
struct buf buf;
|
struct buf buf;
|
||||||
buf_init(&buf);
|
buf_init(&buf);
|
||||||
|
|
||||||
/*
|
/* This is the width of the area available for text fields */
|
||||||
* Subtract 4x border-width to allow for both the OSD border and the
|
int available_width = w - 2 * theme->osd_border_width
|
||||||
* item border. This is the width of the area available for text fields.
|
- 2 * theme->osd_window_switcher_padding
|
||||||
*/
|
- 2 * theme->osd_window_switcher_item_active_border_width;
|
||||||
int available_width = w - 4 * theme->osd_border_width
|
|
||||||
- 2 * theme->osd_window_switcher_padding;
|
|
||||||
|
|
||||||
/* Draw text for each node */
|
/* Draw text for each node */
|
||||||
wl_list_for_each_reverse(node, node_list, link) {
|
wl_list_for_each_reverse(node, node_list, link) {
|
||||||
|
|
@ -412,14 +410,15 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h,
|
||||||
/* Highlight current window */
|
/* Highlight current window */
|
||||||
struct wlr_fbox fbox = {
|
struct wlr_fbox fbox = {
|
||||||
.x = theme->osd_border_width + theme->osd_window_switcher_padding,
|
.x = theme->osd_border_width + theme->osd_window_switcher_padding,
|
||||||
.y = y - theme->osd_border_width,
|
.y = y - theme->osd_window_switcher_item_active_border_width,
|
||||||
.width = theme->osd_window_switcher_width
|
.width = theme->osd_window_switcher_width
|
||||||
- 2 * theme->osd_border_width
|
- 2 * theme->osd_border_width
|
||||||
- 2 * theme->osd_window_switcher_padding,
|
- 2 * theme->osd_window_switcher_padding,
|
||||||
.height = theme->osd_window_switcher_item_height
|
.height = theme->osd_window_switcher_item_height
|
||||||
+ 2 * theme->osd_border_width,
|
+ theme->osd_window_switcher_item_active_border_width,
|
||||||
};
|
};
|
||||||
draw_cairo_border(cairo, fbox, theme->osd_border_width);
|
draw_cairo_border(cairo, fbox,
|
||||||
|
theme->osd_window_switcher_item_active_border_width);
|
||||||
cairo_stroke(cairo);
|
cairo_stroke(cairo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
11
src/theme.c
11
src/theme.c
|
|
@ -141,9 +141,10 @@ theme_builtin(struct theme *theme)
|
||||||
parse_hexstr("#888888", theme->menu_separator_color);
|
parse_hexstr("#888888", theme->menu_separator_color);
|
||||||
|
|
||||||
theme->osd_window_switcher_width = 600;
|
theme->osd_window_switcher_width = 600;
|
||||||
theme->osd_window_switcher_padding = INT_MIN;
|
theme->osd_window_switcher_padding = 4;
|
||||||
theme->osd_window_switcher_item_padding_x = 10;
|
theme->osd_window_switcher_item_padding_x = 10;
|
||||||
theme->osd_window_switcher_item_padding_y = 6;
|
theme->osd_window_switcher_item_padding_y = 1;
|
||||||
|
theme->osd_window_switcher_item_active_border_width = 2;
|
||||||
|
|
||||||
/* inherit settings in post_processing() if not set elsewhere */
|
/* inherit settings in post_processing() if not set elsewhere */
|
||||||
theme->osd_bg_color[0] = FLT_MIN;
|
theme->osd_bg_color[0] = FLT_MIN;
|
||||||
|
|
@ -321,6 +322,9 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
if (match_glob(key, "osd.window-switcher.item.padding.y")) {
|
if (match_glob(key, "osd.window-switcher.item.padding.y")) {
|
||||||
theme->osd_window_switcher_item_padding_y = atoi(value);
|
theme->osd_window_switcher_item_padding_y = atoi(value);
|
||||||
}
|
}
|
||||||
|
if (match_glob(key, "osd.window-switcher.item.active.border.width")) {
|
||||||
|
theme->osd_window_switcher_item_active_border_width = atoi(value);
|
||||||
|
}
|
||||||
if (match_glob(key, "osd.label.text.color")) {
|
if (match_glob(key, "osd.label.text.color")) {
|
||||||
parse_hexstr(value, theme->osd_label_text_color);
|
parse_hexstr(value, theme->osd_label_text_color);
|
||||||
}
|
}
|
||||||
|
|
@ -558,9 +562,6 @@ post_processing(struct theme *theme)
|
||||||
if (theme->osd_border_width == INT_MIN) {
|
if (theme->osd_border_width == INT_MIN) {
|
||||||
theme->osd_border_width = theme->border_width;
|
theme->osd_border_width = theme->border_width;
|
||||||
}
|
}
|
||||||
if (theme->osd_window_switcher_padding == INT_MIN) {
|
|
||||||
theme->osd_window_switcher_padding = theme->osd_border_width;
|
|
||||||
}
|
|
||||||
if (theme->osd_label_text_color[0] == FLT_MIN) {
|
if (theme->osd_label_text_color[0] == FLT_MIN) {
|
||||||
memcpy(theme->osd_label_text_color,
|
memcpy(theme->osd_label_text_color,
|
||||||
theme->window_active_label_text_color,
|
theme->window_active_label_text_color,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue