diff options
-rw-r--r-- | include/sway/tree/view.h | 4 | ||||
-rw-r--r-- | sway/tree/view.c | 42 |
2 files changed, 23 insertions, 23 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 352a62bc..4395e94a 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -167,6 +167,10 @@ const char *view_get_instance(struct sway_view *view); | |||
167 | void view_configure(struct sway_view *view, double ox, double oy, int width, | 167 | void view_configure(struct sway_view *view, double ox, double oy, int width, |
168 | int height); | 168 | int height); |
169 | 169 | ||
170 | /** | ||
171 | * Configure the view's position and size based on the swayc's position and | ||
172 | * size, taking borders into consideration. | ||
173 | */ | ||
170 | void view_autoconfigure(struct sway_view *view); | 174 | void view_autoconfigure(struct sway_view *view); |
171 | 175 | ||
172 | void view_set_activated(struct sway_view *view, bool activated); | 176 | void view_set_activated(struct sway_view *view, bool activated); |
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; |