mirror of
https://github.com/labwc/labwc.git
synced 2025-11-06 13:29:58 -05:00
ssd: move top border above titlebar
This commit is contained in:
parent
e4f1f9a975
commit
e086f6f5e0
6 changed files with 37 additions and 34 deletions
|
|
@ -52,14 +52,22 @@ finish_scene_button(struct wl_list *part_list, enum ssd_part_type type,
|
|||
float hover_bg[4] = {0.15f, 0.15f, 0.15f, 0.3f};
|
||||
|
||||
/* Icon */
|
||||
int offset_y = 0;
|
||||
int offset_x = 0;
|
||||
if (type == LAB_SSD_BUTTON_WINDOW_MENU) {
|
||||
offset_y = rc.theme->border_width;
|
||||
offset_x = rc.theme->border_width;
|
||||
} else if (type == LAB_SSD_BUTTON_CLOSE) {
|
||||
offset_y = rc.theme->border_width;
|
||||
}
|
||||
add_scene_buffer(part_list, type, parent, icon_buffer,
|
||||
(BUTTON_WIDTH - icon_buffer->width) / 2,
|
||||
(rc.theme->title_height - icon_buffer->height) / 2);
|
||||
offset_x + (BUTTON_WIDTH - icon_buffer->width) / 2,
|
||||
offset_y + (rc.theme->title_height - icon_buffer->height) / 2);
|
||||
|
||||
/* Hover overlay */
|
||||
struct ssd_part *hover_part;
|
||||
hover_part = add_scene_rect(part_list, type, parent,
|
||||
BUTTON_WIDTH, rc.theme->title_height, 0, 0, hover_bg);
|
||||
BUTTON_WIDTH, rc.theme->title_height, offset_x, offset_y, hover_bg);
|
||||
wlr_scene_node_set_enabled(hover_part->node, false);
|
||||
}
|
||||
|
||||
|
|
@ -69,8 +77,9 @@ add_scene_button_corner(struct wl_list *part_list, enum ssd_part_type type,
|
|||
struct wlr_buffer *icon_buffer, int x)
|
||||
{
|
||||
struct ssd_part *part;
|
||||
/* Background */
|
||||
part = add_scene_buffer(part_list, type, parent, corner_buffer, x, 0);
|
||||
/* Background, y adjusted for border_width */
|
||||
part = add_scene_buffer(part_list, type, parent, corner_buffer,
|
||||
x, -rc.theme->border_width);
|
||||
finish_scene_button(part_list, type, part->node, icon_buffer);
|
||||
return part;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue