aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-21 22:58:46 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-22 08:27:24 +1000
commit664169fbf1c4e07f17a48b2b801dad9cea31ea4c (patch)
treee20b1f39a89abd5a6567f7e9d398f002e9ee5bee /sway/tree/view.c
parentFix focus follows mouse with no focus (diff)
downloadsway-664169fbf1c4e07f17a48b2b801dad9cea31ea4c.tar.gz
sway-664169fbf1c4e07f17a48b2b801dad9cea31ea4c.tar.zst
sway-664169fbf1c4e07f17a48b2b801dad9cea31ea4c.zip
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..1280dc8d 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -182,11 +182,11 @@ void view_autoconfigure(struct sway_view *view) {
182 // area. We have to offset the surface y by the height of the title bar, and 182 // area. We have to offset the surface y by the height of the title bar, and
183 // disable any top border because we'll always have the title bar. 183 // disable any top border because we'll always have the title bar.
184 if (view->swayc->parent->layout == L_TABBED) { 184 if (view->swayc->parent->layout == L_TABBED) {
185 y_offset = config->border_thickness * 2 + config->font_height; 185 y_offset = config->font_height + 8;
186 view->border_top = 0; 186 view->border_top = 0;
187 } else if (view->swayc->parent->layout == L_STACKED) { 187 } else if (view->swayc->parent->layout == L_STACKED) {
188 y_offset = config->border_thickness * 2 + config->font_height; 188 y_offset = (config->font_height + 8)
189 y_offset *= view->swayc->parent->children->length; 189 * view->swayc->parent->children->length;
190 view->border_top = 0; 190 view->border_top = 0;
191 } 191 }
192 192
@@ -208,7 +208,7 @@ void view_autoconfigure(struct sway_view *view) {
208 - view->border_thickness * view->border_bottom; 208 - view->border_thickness * view->border_bottom;
209 break; 209 break;
210 case B_NORMAL: 210 case B_NORMAL:
211 // Height is: border + title height + border + view height + border 211 // Height is: 1px border + 3px pad + title height + 3px pad + 1px border
212 x = view->swayc->x + view->border_thickness * view->border_left; 212 x = view->swayc->x + view->border_thickness * view->border_left;
213 width = view->swayc->width 213 width = view->swayc->width
214 - view->border_thickness * view->border_left 214 - view->border_thickness * view->border_left
@@ -218,10 +218,9 @@ void view_autoconfigure(struct sway_view *view) {
218 height = view->swayc->height - y_offset 218 height = view->swayc->height - y_offset
219 - view->border_thickness * view->border_bottom; 219 - view->border_thickness * view->border_bottom;
220 } else { 220 } else {
221 y = view->swayc->y + config->font_height + view->border_thickness * 2 221 y = view->swayc->y + config->font_height + 8;
222 + y_offset; 222 height = view->swayc->height - config->font_height - 8
223 height = view->swayc->height - config->font_height 223 - view->border_thickness * view->border_bottom;
224 - view->border_thickness * (2 + view->border_bottom);
225 } 224 }
226 break; 225 break;
227 } 226 }