]> git.mdlowis.com Git - proto/labwc.git/commitdiff
ssd: add top border
authorJohan Malm <jgm323@gmail.com>
Sun, 6 Mar 2022 17:06:14 +0000 (17:06 +0000)
committerJohan Malm <jgm323@gmail.com>
Sun, 6 Mar 2022 17:06:14 +0000 (17:06 +0000)
Raise border on top of (z-order) titlebar

src/ssd/ssd.c
src/ssd/ssd_border.c

index 72f563068a6839df3c77e870fb37a09979b67cbd..bc86ca61d3bd9e9e67dfc6f552305aa293353d59 100644 (file)
@@ -156,8 +156,8 @@ ssd_create(struct view *view)
        view->ssd.tree = wlr_scene_tree_create(&view->scene_tree->node);
        wlr_scene_node_lower_to_bottom(&view->ssd.tree->node);
        ssd_extents_create(view);
-       ssd_border_create(view);
        ssd_titlebar_create(view);
+       ssd_border_create(view);
 }
 
 void
index aa289e21130132653984d942ad55372ff44ce8c3..104b5c5c4bfea53f3bd4f51f8affecd7296e02dd 100644 (file)
@@ -40,6 +40,9 @@ ssd_border_create(struct view *view)
                add_scene_rect(&subtree->parts, LAB_SSD_PART_BOTTOM, parent,
                        full_width, theme->border_width,
                        0, height, color);
+               add_scene_rect(&subtree->parts, LAB_SSD_PART_TOP, parent,
+                       full_width - 2 * BUTTON_WIDTH, theme->border_width,
+                       BUTTON_WIDTH, -SSD_HEIGHT, color);
        } FOR_EACH_END
 }
 
@@ -71,6 +74,13 @@ ssd_border_update(struct view *view)
                                wlr_scene_rect_set_size(rect, full_width, theme->border_width);
                                wlr_scene_node_set_position(part->node, 0, height);
                                continue;
+                       case LAB_SSD_PART_TOP:
+                               wlr_scene_rect_set_size(rect,
+                                       full_width - 2 * BUTTON_WIDTH,
+                                       theme->border_width);
+                               wlr_scene_node_set_position(part->node,
+                                       BUTTON_WIDTH, -SSD_HEIGHT);
+                               continue;
                        default:
                                continue;
                        }