aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-05-21 19:52:08 -0400
committerGitHub <noreply@github.com>2018-05-21 19:52:08 -0400
commit9731d080bea58fee78bd52bb5633cb37ec7edc22 (patch)
tree7fbc2b11fc371cdec7ed1b5cdbeb2224d429cace /sway/tree/view.c
parent8bbf78fdd430a7e315356ebeda36adbf48b8953d (diff)
parent4de137e02161ef8188775d50fe5dc8d9e9bb2216 (diff)
Merge pull request #2015 from RyanDwyer/stacked-layout
Implement stacked layout
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index c013e635..07157818 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -182,11 +182,11 @@ void view_autoconfigure(struct sway_view *view) {
// area. We have to offset the surface y by the height of the title bar, and
// disable any top border because we'll always have the title bar.
if (view->swayc->parent->layout == L_TABBED) {
- y_offset = config->border_thickness * 2 + config->font_height;
+ y_offset = container_titlebar_height();
view->border_top = 0;
} else if (view->swayc->parent->layout == L_STACKED) {
- y_offset = config->border_thickness * 2 + config->font_height;
- y_offset *= view->swayc->parent->children->length;
+ y_offset = container_titlebar_height()
+ * view->swayc->parent->children->length;
view->border_top = 0;
}
@@ -208,7 +208,7 @@ void view_autoconfigure(struct sway_view *view) {
- view->border_thickness * view->border_bottom;
break;
case B_NORMAL:
- // Height is: border + title height + border + view height + border
+ // Height is: 1px border + 3px pad + title height + 3px pad + 1px border
x = view->swayc->x + view->border_thickness * view->border_left;
width = view->swayc->width
- view->border_thickness * view->border_left
@@ -218,10 +218,9 @@ void view_autoconfigure(struct sway_view *view) {
height = view->swayc->height - y_offset
- view->border_thickness * view->border_bottom;
} else {
- y = view->swayc->y + config->font_height + view->border_thickness * 2
- + y_offset;
- height = view->swayc->height - config->font_height
- - view->border_thickness * (2 + view->border_bottom);
+ y = view->swayc->y + container_titlebar_height();
+ height = view->swayc->height - container_titlebar_height()
+ - view->border_thickness * view->border_bottom;
}
break;
}