overlay: add theme setting snapping.preview.[region|edge].fill

This settings allows user to choose whether to draw a filled rectangle
or an outlined rectangle as the preview for window snapping.
This commit is contained in:
tokyo4j 2024-04-14 02:24:36 +09:00 committed by Consolatis
parent be491e0e4c
commit 50fd65416f
8 changed files with 114 additions and 36 deletions

View file

@ -24,6 +24,7 @@
#include "common/graphic-helpers.h"
#include "common/match.h"
#include "common/mem.h"
#include "common/parse-bool.h"
#include "common/string-helpers.h"
#include "config/rcxml.h"
#include "button/button-png.h"
@ -520,6 +521,9 @@ theme_builtin(struct theme *theme)
theme->osd_border_width = INT_MIN;
theme->osd_border_color[0] = FLT_MIN;
theme->osd_label_text_color[0] = FLT_MIN;
theme->snapping_preview_region_fill = true;
theme->snapping_preview_edge_fill = true;
}
static void
@ -715,6 +719,12 @@ entry(struct theme *theme, const char *key, const char *value)
if (match_glob(key, "osd.label.text.color")) {
parse_hexstr(value, theme->osd_label_text_color);
}
if (match_glob(key, "snapping.preview.region.fill")) {
theme->snapping_preview_region_fill = parse_bool(value, true);
}
if (match_glob(key, "snapping.preview.edge.fill")) {
theme->snapping_preview_edge_fill = parse_bool(value, true);
}
}
static void