diff options
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/sway/config.c b/sway/config.c index f4d78e19..5efa0d48 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include "sway/commands.h" | 25 | #include "sway/commands.h" |
26 | #include "sway/config.h" | 26 | #include "sway/config.h" |
27 | #include "sway/tree/layout.h" | 27 | #include "sway/tree/layout.h" |
28 | #include "cairo.h" | ||
29 | #include "pango.h" | ||
28 | #include "readline.h" | 30 | #include "readline.h" |
29 | #include "stringop.h" | 31 | #include "stringop.h" |
30 | #include "list.h" | 32 | #include "list.h" |
@@ -169,7 +171,7 @@ static void config_defaults(struct sway_config *config) { | |||
169 | config->default_layout = L_NONE; | 171 | config->default_layout = L_NONE; |
170 | config->default_orientation = L_NONE; | 172 | config->default_orientation = L_NONE; |
171 | if (!(config->font = strdup("monospace 10"))) goto cleanup; | 173 | if (!(config->font = strdup("monospace 10"))) goto cleanup; |
172 | //config->font_height = get_font_text_height(config->font); | 174 | config->font_height = 0; |
173 | 175 | ||
174 | // floating view | 176 | // floating view |
175 | config->floating_maximum_width = 0; | 177 | config->floating_maximum_width = 0; |
@@ -208,31 +210,31 @@ static void config_defaults(struct sway_config *config) { | |||
208 | set_color(config->border_colors.focused.border, 0x4C7899); | 210 | set_color(config->border_colors.focused.border, 0x4C7899); |
209 | set_color(config->border_colors.focused.border, 0x4C7899); | 211 | set_color(config->border_colors.focused.border, 0x4C7899); |
210 | set_color(config->border_colors.focused.background, 0x285577); | 212 | set_color(config->border_colors.focused.background, 0x285577); |
211 | set_color(config->border_colors.focused.text, 0xFFFFFF); | 213 | set_color(config->border_colors.focused.text, 0xFFFFFFFF); |
212 | set_color(config->border_colors.focused.indicator, 0x2E9EF4); | 214 | set_color(config->border_colors.focused.indicator, 0x2E9EF4); |
213 | set_color(config->border_colors.focused.child_border, 0x285577); | 215 | set_color(config->border_colors.focused.child_border, 0x285577); |
214 | 216 | ||
215 | set_color(config->border_colors.focused_inactive.border, 0x333333); | 217 | set_color(config->border_colors.focused_inactive.border, 0x333333); |
216 | set_color(config->border_colors.focused_inactive.background, 0x5F676A); | 218 | set_color(config->border_colors.focused_inactive.background, 0x5F676A); |
217 | set_color(config->border_colors.focused_inactive.text, 0xFFFFFF); | 219 | set_color(config->border_colors.focused_inactive.text, 0xFFFFFFFF); |
218 | set_color(config->border_colors.focused_inactive.indicator, 0x484E50); | 220 | set_color(config->border_colors.focused_inactive.indicator, 0x484E50); |
219 | set_color(config->border_colors.focused_inactive.child_border, 0x5F676A); | 221 | set_color(config->border_colors.focused_inactive.child_border, 0x5F676A); |
220 | 222 | ||
221 | set_color(config->border_colors.unfocused.border, 0x333333); | 223 | set_color(config->border_colors.unfocused.border, 0x333333); |
222 | set_color(config->border_colors.unfocused.background, 0x222222); | 224 | set_color(config->border_colors.unfocused.background, 0x222222); |
223 | set_color(config->border_colors.unfocused.text, 0x888888); | 225 | set_color(config->border_colors.unfocused.text, 0xFFFFFFFF); |
224 | set_color(config->border_colors.unfocused.indicator, 0x292D2E); | 226 | set_color(config->border_colors.unfocused.indicator, 0x292D2E); |
225 | set_color(config->border_colors.unfocused.child_border, 0x222222); | 227 | set_color(config->border_colors.unfocused.child_border, 0x222222); |
226 | 228 | ||
227 | set_color(config->border_colors.urgent.border, 0x2F343A); | 229 | set_color(config->border_colors.urgent.border, 0x2F343A); |
228 | set_color(config->border_colors.urgent.background, 0x900000); | 230 | set_color(config->border_colors.urgent.background, 0x900000); |
229 | set_color(config->border_colors.urgent.text, 0xFFFFFF); | 231 | set_color(config->border_colors.urgent.text, 0xFFFFFFFF); |
230 | set_color(config->border_colors.urgent.indicator, 0x900000); | 232 | set_color(config->border_colors.urgent.indicator, 0x900000); |
231 | set_color(config->border_colors.urgent.child_border, 0x900000); | 233 | set_color(config->border_colors.urgent.child_border, 0x900000); |
232 | 234 | ||
233 | set_color(config->border_colors.placeholder.border, 0x000000); | 235 | set_color(config->border_colors.placeholder.border, 0x000000); |
234 | set_color(config->border_colors.placeholder.background, 0x0C0C0C); | 236 | set_color(config->border_colors.placeholder.background, 0x0C0C0C); |
235 | set_color(config->border_colors.placeholder.text, 0xFFFFFF); | 237 | set_color(config->border_colors.placeholder.text, 0xFFFFFFFF); |
236 | set_color(config->border_colors.placeholder.indicator, 0x000000); | 238 | set_color(config->border_colors.placeholder.indicator, 0x000000); |
237 | set_color(config->border_colors.placeholder.child_border, 0x0C0C0C); | 239 | set_color(config->border_colors.placeholder.child_border, 0x0C0C0C); |
238 | 240 | ||
@@ -727,3 +729,20 @@ int workspace_output_cmp_workspace(const void *a, const void *b) { | |||
727 | const struct workspace_output *wsa = a, *wsb = b; | 729 | const struct workspace_output *wsa = a, *wsb = b; |
728 | return lenient_strcmp(wsa->workspace, wsb->workspace); | 730 | return lenient_strcmp(wsa->workspace, wsb->workspace); |
729 | } | 731 | } |
732 | |||
733 | static void find_font_height_iterator(struct sway_container *container, | ||
734 | void *data) { | ||
735 | bool *recalculate = data; | ||
736 | if (*recalculate) { | ||
737 | container_calculate_title_height(container); | ||
738 | } | ||
739 | if (container->title_height > config->font_height) { | ||
740 | config->font_height = container->title_height; | ||
741 | } | ||
742 | } | ||
743 | |||
744 | void config_find_font_height(bool recalculate) { | ||
745 | config->font_height = 0; | ||
746 | container_for_each_descendant_dfs(&root_container, | ||
747 | find_font_height_iterator, &recalculate); | ||
748 | } | ||