mirror of
https://github.com/labwc/labwc.git
synced 2026-03-01 01:40:24 -05:00
overlay: allow to draw both/either of filled/outlined rectangle
Filled/outlined rectangles shown as snapping overlay are now enabled/disabled independently with `snapping.overlay.[region|edge].bg.enabled` and `snapping.overlay.[region|edge].border.enabled`. To keep the default behavior, `*.bg.enabled` is yes and `*.border.enabled` is no for hardware-based renderers, while `*.bg.enabled` is no and `*.border.enabled` is yes for software-based (pixman) renderer. Users can now use a filled rectangle as an overlay even with pixman renderer. However, this may severely impact performance when used with translucent `snapping.overlay.[region|edge].bg.color`. This commit includes a refactor to use substruct `theme_snapping_overlay` inside `theme` in order to pass it to `create_overlay_rect()` in a cleaner way. Breaking changes is: - `snapping.overlay.[region|edge].fill` is now removed.
This commit is contained in:
parent
34290ef629
commit
b0ba585ff8
9 changed files with 160 additions and 122 deletions
|
|
@ -8,14 +8,13 @@
|
|||
#include "view.h"
|
||||
|
||||
struct overlay_rect {
|
||||
struct wlr_scene_node *node;
|
||||
bool fill;
|
||||
union {
|
||||
/* if fill is true */
|
||||
struct wlr_scene_rect *scene_rect;
|
||||
/* if fill is false */
|
||||
struct multi_rect *pixman_rect;
|
||||
};
|
||||
struct wlr_scene_tree *tree;
|
||||
|
||||
bool bg_enabled;
|
||||
struct wlr_scene_rect *bg_rect;
|
||||
|
||||
bool border_enabled;
|
||||
struct multi_rect *border_rect;
|
||||
};
|
||||
|
||||
struct overlay {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue