summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-08-11 18:21:58 -0400
committerLibravatar GitHub <noreply@github.com>2016-08-11 18:21:58 -0400
commit420fa20ae63cf010b0849ca11a96e67d54ffb0bc (patch)
tree611e81b897ae6a45517f2447dbec005c872750a2
parentMerge pull request #851 from thejan2009/output-disable-during-runtime (diff)
parentUpdate man page (diff)
downloadsway-420fa20ae63cf010b0849ca11a96e67d54ffb0bc.tar.gz
sway-420fa20ae63cf010b0849ca11a96e67d54ffb0bc.tar.zst
sway-420fa20ae63cf010b0849ca11a96e67d54ffb0bc.zip
Merge pull request #853 from guiniol/indicator-color
Implement indicator color
-rw-r--r--sway/border.c16
-rw-r--r--sway/commands.c18
-rw-r--r--sway/sway.5.txt3
3 files changed, 24 insertions, 13 deletions
diff --git a/sway/border.c b/sway/border.c
index 0d3cfab8..5cb02274 100644
--- a/sway/border.c
+++ b/sway/border.c
@@ -102,6 +102,8 @@ static void render_borders(swayc_t *view, cairo_t *cr, struct border_colors *col
102 struct wlc_geometry *g = &view->border->geometry; 102 struct wlc_geometry *g = &view->border->geometry;
103 struct wlc_geometry *b = &view->border_geometry; 103 struct wlc_geometry *b = &view->border_geometry;
104 struct wlc_geometry *v = &view->actual_geometry; 104 struct wlc_geometry *v = &view->actual_geometry;
105 enum swayc_layouts layout = view->parent->layout;
106 uint32_t color;
105 107
106 int x = b->origin.x - g->origin.x; 108 int x = b->origin.x - g->origin.x;
107 int y = b->origin.y - g->origin.y; 109 int y = b->origin.y - g->origin.y;
@@ -119,8 +121,13 @@ static void render_borders(swayc_t *view, cairo_t *cr, struct border_colors *col
119 // right border 121 // right border
120 int right_border = b->size.w - v->size.w - left_border; 122 int right_border = b->size.w - v->size.w - left_border;
121 if (right_border > 0) { 123 if (right_border > 0) {
124 if (layout == L_HORIZ) {
125 color = colors->indicator;
126 } else {
127 color = colors->child_border;
128 }
122 render_sharp_line(cr, 129 render_sharp_line(cr,
123 colors->child_border, 130 color,
124 x + b->size.w - right_border, 131 x + b->size.w - right_border,
125 y, 132 y,
126 right_border, 133 right_border,
@@ -140,8 +147,13 @@ static void render_borders(swayc_t *view, cairo_t *cr, struct border_colors *col
140 // bottom border 147 // bottom border
141 int bottom_border = b->size.h - (top_border + v->size.h); 148 int bottom_border = b->size.h - (top_border + v->size.h);
142 if (bottom_border > 0) { 149 if (bottom_border > 0) {
150 if (layout == L_VERT) {
151 color = colors->indicator;
152 } else {
153 color = colors->child_border;
154 }
143 render_sharp_line(cr, 155 render_sharp_line(cr,
144 colors->child_border, 156 color,
145 x, 157 x,
146 y + b->size.h - bottom_border, 158 y + b->size.h - bottom_border,
147 b->size.w, 159 b->size.w,
diff --git a/sway/commands.c b/sway/commands.c
index 54139593..5a5bcd22 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -2342,15 +2342,15 @@ static struct cmd_results *_do_split(int argc, char **argv, int layout) {
2342 arrange_windows(parent, -1, -1); 2342 arrange_windows(parent, -1, -1);
2343 } 2343 }
2344 2344
2345 // update container title if tabbed/stacked 2345 // update container every time
2346 if (swayc_tabbed_stacked_ancestor(focused)) { 2346 // if it is tabbed/stacked then the title must change
2347 update_container_border(focused); 2347 // if the indicator color is different then the border must change
2348 swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT); 2348 update_container_border(focused);
2349 // schedule render to make changes take effect right away, 2349 swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT);
2350 // otherwise we would have to wait for the view to render, 2350 // schedule render to make changes take effect right away,
2351 // which is unpredictable. 2351 // otherwise we would have to wait for the view to render,
2352 wlc_output_schedule_render(output->handle); 2352 // which is unpredictable.
2353 } 2353 wlc_output_schedule_render(output->handle);
2354 2354
2355 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 2355 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
2356} 2356}
diff --git a/sway/sway.5.txt b/sway/sway.5.txt
index 36fa92d5..7de02a82 100644
--- a/sway/sway.5.txt
+++ b/sway/sway.5.txt
@@ -177,8 +177,7 @@ or triggered at runtime.
177 **text**::: The text color of the title bar. 177 **text**::: The text color of the title bar.
178 **indicator**::: The color used to indicate where a new view will open. In a 178 **indicator**::: The color used to indicate where a new view will open. In a
179 tiled container, this would paint the right border of the current view if 179 tiled container, this would paint the right border of the current view if
180 a new view would be opened to the right. _Note_: This is not currently 180 a new view would be opened to the right.
181 implemented.
182 **child_border**::: The border around the view itself. 181 **child_border**::: The border around the view itself.
183 182
184+ 183+