mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
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().
This commit is contained in:
parent
9a3412324d
commit
16dbdc64e5
25 changed files with 647 additions and 391 deletions
|
|
@ -5,18 +5,15 @@
|
|||
struct lab_data_buffer;
|
||||
|
||||
/**
|
||||
* img_xbm_from_bitmap() - create button from monochrome bitmap
|
||||
* img_xbm_load_from_bitmap() - create button from monochrome bitmap
|
||||
* @bitmap: bitmap data array in hexadecimal xbm format
|
||||
* @buffer: cairo-surface-buffer to create
|
||||
* @rgba: color
|
||||
*
|
||||
* Example bitmap: char button[6] = { 0x3f, 0x3f, 0x21, 0x21, 0x21, 0x3f };
|
||||
*/
|
||||
void img_xbm_from_bitmap(const char *bitmap, struct lab_data_buffer **buffer,
|
||||
float *rgba);
|
||||
struct lab_data_buffer *img_xbm_load_from_bitmap(const char *bitmap, float *rgba);
|
||||
|
||||
/* img_xbm_load - Convert xbm file to buffer with cairo surface */
|
||||
void img_xbm_load(const char *filename, struct lab_data_buffer **buffer,
|
||||
float *rgba);
|
||||
struct lab_data_buffer *img_xbm_load(const char *filename, float *rgba);
|
||||
|
||||
#endif /* LABWC_IMG_XBM_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue