Window switcher, allow to use percent of monitor width.

OSD will size per monitor. With this the width stays relative sized on
my 4k as well as my 1080p monitor

example from my theme
osd.window-switcher.width: 60%
This commit is contained in:
Droc 2024-03-25 18:22:27 -05:00
parent 4fc6bce3ea
commit bda18df757
5 changed files with 17 additions and 2 deletions

View file

@ -670,6 +670,12 @@ entry(struct theme *theme, const char *key, const char *value)
parse_hexstr(value, theme->osd_border_color);
}
if (match_glob(key, "osd.window-switcher.width")) {
theme->osd_width_should_parse_as_percentage = false;
char *p = strrchr(value, '%');
if (p) {
*p = '\0';
theme->osd_width_should_parse_as_percentage = true;
}
theme->osd_window_switcher_width = atoi(value);
}
if (match_glob(key, "osd.window-switcher.padding")) {