diff options
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 26e1a108..7d493af9 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 | */ | ||
81 | void view_autoconfigure(struct sway_view *view) { | 77 | void 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; |