]> git.mdlowis.com Git - proto/labwc.git/commit
ssd: rework titlebar button rendering
authortokyo4j <hrak1529@gmail.com>
Thu, 28 Nov 2024 10:21:18 +0000 (19:21 +0900)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Mon, 23 Dec 2024 09:11:32 +0000 (18:11 +0900)
commit16dbdc64e58d66011bbf319b92de844dab0ca8d9
tree934539695671ecfdf53843ed2e7e585af379ccbe
parent9a3412324db8046a7355676a1eaba542a47b76a9
ssd: rework titlebar button rendering

- fix that icons for normal/hovered/rounded buttons are not placed
  exactly the same position
- fix blurry window button icons in scaled outputs

This commit introduces lab_img and scaled_img_buffer and uses them for
rendering icons in the window titlebar. Now the process of rendering
button icons are split into 2 phases: loading with lab_img_load() and
creating scene-nodes for them with scaled_img_buffer_create(). This
might incur some additional overhead since we no longer preload icon
textures, but the rendering of icon only happens for the first window
as backing buffers are shared and the overhead won't be noticeable.
This commit also simplifies the process of centering icon buffer in the
button, by creating icon buffers in a fixed geometry via
lab_img_render().
25 files changed:
include/buffer.h
include/common/box.h
include/common/scaled-img-buffer.h [new file with mode: 0644]
include/desktop-entry.h
include/img/img-png.h
include/img/img-svg.h
include/img/img-xbm.h
include/img/img-xpm.h
include/img/img.h [new file with mode: 0644]
include/ssd-internal.h
include/theme.h
src/buffer.c
src/common/box.c
src/common/meson.build
src/common/scaled-img-buffer.c [new file with mode: 0644]
src/desktop-entry.c
src/img/img-png.c
src/img/img-svg.c
src/img/img-xbm.c
src/img/img-xpm.c
src/img/img.c [new file with mode: 0644]
src/img/meson.build
src/ssd/ssd-part.c
src/ssd/ssd-titlebar.c
src/theme.c