mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
img: remove padding_x from lab_img_render()
padding_x in lab_img_render() was just to make sure window icons in the titlebar doesn't get too close to adjacent buttons and it didn't felt clean. To remove it from lab_img, this commit changes the size of window icon buffers from (window.button.width)x(window.button.height) to (window.button.width * 0.8)x(window.button.height) and horizontally slide it by (window.button.width * 0.1) to keep the horizontal padding. Note that the size of the hitbox for a window icon is kept the same and nothing is changed from user's perspective.
This commit is contained in:
parent
a0cf6bb068
commit
45f73b58a1
8 changed files with 20 additions and 30 deletions
|
|
@ -15,7 +15,6 @@ struct scaled_img_buffer {
|
|||
struct lab_img *img;
|
||||
int width;
|
||||
int height;
|
||||
int padding;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -65,11 +64,11 @@ struct scaled_img_buffer {
|
|||
* free to destroy it.
|
||||
*/
|
||||
struct scaled_img_buffer *scaled_img_buffer_create(struct wlr_scene_tree *parent,
|
||||
struct lab_img *img, int width, int height, int padding);
|
||||
struct lab_img *img, int width, int height);
|
||||
|
||||
/* Update image, width, height and padding of the scaled_img_buffer */
|
||||
/* Update image, width and height of the scaled_img_buffer */
|
||||
void scaled_img_buffer_update(struct scaled_img_buffer *self,
|
||||
struct lab_img *img, int width, int height, int padding);
|
||||
struct lab_img *img, int width, int height);
|
||||
|
||||
/* Obtain scaled_img_buffer from wlr_scene_node */
|
||||
struct scaled_img_buffer *scaled_img_buffer_from_node(struct wlr_scene_node *node);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue