aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-01 17:36:12 +1000
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-05-01 07:46:57 -0400
commitfa5de2876e3e8db4966d3404f01ba9600204d75b (patch)
treec18a1bb47df649e6b4516609d84fb29ba5e98b84 /sway/tree/view.c
parentImplement borders (diff)
downloadsway-fa5de2876e3e8db4966d3404f01ba9600204d75b.tar.gz
sway-fa5de2876e3e8db4966d3404f01ba9600204d75b.tar.zst
sway-fa5de2876e3e8db4966d3404f01ba9600204d75b.zip
Move docblock and fix indenting of switch/case.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 26902c23..4903b3a4 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -74,10 +74,6 @@ void view_configure(struct sway_view *view, double ox, double oy, int width,
74 } 74 }
75} 75}
76 76
77/**
78 * Configure the view's position and size based on the swayc's position and
79 * size, taking borders into consideration.
80 */
81void view_autoconfigure(struct sway_view *view) { 77void view_autoconfigure(struct sway_view *view) {
82 if (!sway_assert(view->swayc, 78 if (!sway_assert(view->swayc,
83 "Called view_autoconfigure() on a view without a swayc")) { 79 "Called view_autoconfigure() on a view without a swayc")) {
@@ -93,25 +89,25 @@ void view_autoconfigure(struct sway_view *view) {
93 89
94 double x, y, width, height; 90 double x, y, width, height;
95 switch (view->border) { 91 switch (view->border) {
96 case B_NONE: 92 case B_NONE:
97 x = view->swayc->x; 93 x = view->swayc->x;
98 y = view->swayc->y; 94 y = view->swayc->y;
99 width = view->swayc->width; 95 width = view->swayc->width;
100 height = view->swayc->height; 96 height = view->swayc->height;
101 break; 97 break;
102 case B_PIXEL: 98 case B_PIXEL:
103 x = view->swayc->x + view->border_thickness; 99 x = view->swayc->x + view->border_thickness;
104 y = view->swayc->y + view->border_thickness; 100 y = view->swayc->y + view->border_thickness;
105 width = view->swayc->width - view->border_thickness * 2; 101 width = view->swayc->width - view->border_thickness * 2;
106 height = view->swayc->height - view->border_thickness * 2; 102 height = view->swayc->height - view->border_thickness * 2;
107 break; 103 break;
108 case B_NORMAL: 104 case B_NORMAL:
109 // TODO: Size the title bar by checking the font 105 // TODO: Size the title bar by checking the font
110 x = view->swayc->x + view->border_thickness; 106 x = view->swayc->x + view->border_thickness;
111 y = view->swayc->y + 20; 107 y = view->swayc->y + 20;
112 width = view->swayc->width - view->border_thickness * 2; 108 width = view->swayc->width - view->border_thickness * 2;
113 height = view->swayc->height - view->border_thickness - 20; 109 height = view->swayc->height - view->border_thickness - 20;
114 break; 110 break;
115 } 111 }
116 112
117 view->x = x; 113 view->x = x;