diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-03 15:02:16 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-03 15:12:00 +1000 |
commit | 55b307cddfa453fc003350a642a68735bc36e50e (patch) | |
tree | 4cc54f1be82db862fa4896b5da1d52868a273161 /include | |
parent | Render titles (diff) | |
download | sway-55b307cddfa453fc003350a642a68735bc36e50e.tar.gz sway-55b307cddfa453fc003350a642a68735bc36e50e.tar.zst sway-55b307cddfa453fc003350a642a68735bc36e50e.zip |
Calculate config->font_height based on existing container titles
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/config.h | 9 | ||||
-rw-r--r-- | include/sway/tree/container.h | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index 02ae3b63..345f26a0 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -304,7 +304,7 @@ struct sway_config { | |||
304 | enum sway_container_layout default_orientation; | 304 | enum sway_container_layout default_orientation; |
305 | enum sway_container_layout default_layout; | 305 | enum sway_container_layout default_layout; |
306 | char *font; | 306 | char *font; |
307 | int font_height; | 307 | size_t font_height; |
308 | 308 | ||
309 | // Flags | 309 | // Flags |
310 | bool focus_follows_mouse; | 310 | bool focus_follows_mouse; |
@@ -461,7 +461,12 @@ struct bar_config *default_bar_config(void); | |||
461 | 461 | ||
462 | void free_bar_config(struct bar_config *bar); | 462 | void free_bar_config(struct bar_config *bar); |
463 | 463 | ||
464 | int get_font_text_height(char *font); | 464 | /** |
465 | * Updates the value of config->font_height based on the max title height | ||
466 | * reported by each container. If recalculate is true, the containers will | ||
467 | * recalculate their heights before reporting. | ||
468 | */ | ||
469 | void config_find_font_height(bool recalculate); | ||
465 | 470 | ||
466 | /* Global config singleton. */ | 471 | /* Global config singleton. */ |
467 | extern struct sway_config *config; | 472 | extern struct sway_config *config; |
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index b508f310..b07af72c 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -89,6 +89,7 @@ struct sway_container { | |||
89 | struct wlr_texture *title_focused_inactive; | 89 | struct wlr_texture *title_focused_inactive; |
90 | struct wlr_texture *title_unfocused; | 90 | struct wlr_texture *title_unfocused; |
91 | struct wlr_texture *title_urgent; | 91 | struct wlr_texture *title_urgent; |
92 | size_t title_height; | ||
92 | 93 | ||
93 | struct { | 94 | struct { |
94 | struct wl_signal destroy; | 95 | struct wl_signal destroy; |
@@ -198,4 +199,12 @@ struct sway_container *container_flatten(struct sway_container *container); | |||
198 | 199 | ||
199 | void container_update_title_textures(struct sway_container *container); | 200 | void container_update_title_textures(struct sway_container *container); |
200 | 201 | ||
202 | /** | ||
203 | * Calculate the container's title_height property. | ||
204 | */ | ||
205 | void container_calculate_title_height(struct sway_container *container); | ||
206 | |||
207 | void container_update_title(struct sway_container *container, | ||
208 | const char *new_title); | ||
209 | |||
201 | #endif | 210 | #endif |