mirror of
https://github.com/labwc/labwc.git
synced 2026-04-10 08:21:07 -04:00
ssd: ignore shadows_on_tiled if gap < shadow_size
This commit is contained in:
parent
0dbcd2221a
commit
e08f8af667
2 changed files with 16 additions and 4 deletions
|
|
@ -525,7 +525,10 @@ extending outward from the snapped edge.
|
|||
Should drop-shadows be rendered behind windows. Default is no.
|
||||
|
||||
*<theme><dropShadowsOnTiled>* [yes|no]
|
||||
Should drop-shadows be rendered behind tiled windows. Default is no.
|
||||
Should drop-shadows be rendered behind tiled windows. This won't take
|
||||
effect if <core><gap> is smaller than window.active.shadow.size in theme.
|
||||
|
||||
Default is no.
|
||||
|
||||
*<theme><font place="">*
|
||||
The font to use for a specific element of a window, menu or OSD.
|
||||
|
|
|
|||
|
|
@ -289,10 +289,19 @@ ssd_shadow_update(struct ssd *ssd)
|
|||
assert(ssd->shadow.tree);
|
||||
|
||||
struct view *view = ssd->view;
|
||||
struct theme *theme = ssd->view->server->theme;
|
||||
bool maximized = view->maximized == VIEW_AXIS_BOTH;
|
||||
bool show_shadows =
|
||||
rc.shadows_enabled && !maximized &&
|
||||
(!view_is_tiled(ssd->view) || rc.shadows_on_tiled);
|
||||
bool tiled_shadows = false;
|
||||
if (rc.shadows_on_tiled) {
|
||||
if (rc.gap >= theme->window[THEME_ACTIVE].shadow_size &&
|
||||
rc.gap >= theme->window[THEME_INACTIVE].shadow_size) {
|
||||
tiled_shadows = true;
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "gap size < shadow_size, ignore rc.shadows_ontiled");
|
||||
}
|
||||
};
|
||||
bool show_shadows = rc.shadows_enabled && !maximized &&
|
||||
(!view_is_tiled(ssd->view) || tiled_shadows);
|
||||
wlr_scene_node_set_enabled(&ssd->shadow.tree->node, show_shadows);
|
||||
if (show_shadows) {
|
||||
set_shadow_geometry(ssd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue