Commit graph

19 commits

Author SHA1 Message Date
Consolatis
7b48da4ab2 include/labwc.h: Provide MIN/MAX macros 2023-01-06 18:33:25 +01:00
Consolatis
9d7386effd include/ssd.h: prefix defines with SSD_ 2023-01-06 18:32:36 +01:00
Consolatis
0db67a508c ssd: scale down button icons if necessary
This allows using large XBM button icons (larger than
the button width / height) for high and mixed DPI usecases.

Instead of scaling up the low pixel icons when moving a window to a
high DPI output we scale the icons down when moving to a non-scaled
output. The user is still responsible to create / use larger XBM
icons for their theme.

Partly fixes #609
2022-12-29 22:19:13 +00:00
John Lindgren
b67eccc99a ssd: Move implementation details from ssd.h to ssd-internal.h
- Move private structs and functions to `ssd-internal.h`
- Add `ssd_button_get_type()` and `ssd_button_get_view()`
2022-11-27 15:09:45 +00:00
Consolatis
89ad0b808f s/wl_list_insert(list.prev...)/wl_list_append(list...)/ 2022-10-05 19:50:36 +01:00
John Lindgren
a54d378e6c common: Add znew/znew_n() macros 2022-09-18 15:25:19 -04:00
John Lindgren
cb40cdc36c common: Add additional memory utilities (xzalloc() etc.) 2022-09-17 10:57:30 -04:00
Consolatis
05ae654547 Convert SSD title to scaled font buffer 2022-06-14 22:03:08 +01:00
Consolatis
ca9226a7a6 src/ssd: Convert button node descriptors to struct ssd_button
This allows for way easier button hover detection and future
features like toggling rounded corner buttons on maximize.
2022-06-09 22:04:35 +01:00
Consolatis
f1ada7e407 src/ssd: Use LAB_SSD_PART_CORNER_x for rounded corner backgrounds
This matches the behavior of the surrounding borders and will usually
cause resizing instead of triggering the button itself. This effect
is only really visible when using a border width settings of > 1.

Fixes #379
2022-06-09 22:04:35 +01:00
Consolatis
2ed7a10779 Chase wlroots: every scene_node parent is now a tree
Chases wlroots ccd0f85c2a36308e35b153c7f9653abac7659af3
wlr_scene: Only allow parenting on a wlr_scene_tree
2022-06-07 07:13:37 +01:00
Consolatis
b7c9d0e055 Chase wlroots: prep work: ssd to tree 2022-06-07 07:13:37 +01:00
Consolatis
ccfcd04625 Revert "Fix dynamic output based scaling for menu and SSD"
As it turns out the reason for the workaround was a bug
in wlroots which got fixed in the meantime.

So to keep things simple just revert the workaround and
depend on the wlroots fix instead.

To update the wlroots subproject use
meson subprojects update wlroots

This reverts commit e87aa19066.
2022-05-30 21:27:33 +02:00
Consolatis
e87aa19066 Fix dynamic output based scaling for menu and SSD
wlr_scene_buffers need an additional wlr_scene_buffer_set_source_box()
to be scaled correctly by wlroots based on the output scale.

With this commit the buffers are now scaled correctly but, especially
on higher scale factors, may be a bit blurry.

In the future we likely want a dynamic font label generator based
on the maximal scale of all the outputs the specific buffer is currently on.

Some inspiration for that could be
https://github.com/Nefsen402/sway/blob/scene-graph/sway/sway_text_buffer.c

Fixes #348
2022-05-29 22:10:00 +02:00
Consolatis
3171aba0e2 ssd: dynamically adjust resize extents based on usable_area
Fixes #265
2022-03-12 15:32:44 +00:00
Consolatis
e086f6f5e0 ssd: move top border above titlebar 2022-03-12 15:32:44 +00:00
Consolatis
e4f1f9a975 ssd: use dynamic titlebar height based on font size and padding 2022-03-12 15:32:44 +00:00
Consolatis
c033667716 src/ssd/: Don't access view->surface->current directly
Instead use view->{w,h} which are set on client commit
2022-02-24 06:56:25 +00:00
Consolatis
5862b65f89 Convert SSD to scene nodes 2022-02-23 21:47:01 +00:00