Extract workspace size computation from render_workspace_button()

Also remove some unnecessary strtup()s and rename a few variables and functions.
This commit is contained in:
David Eklov 2016-07-10 22:47:10 -05:00
parent 103954dd2b
commit c805e42635
3 changed files with 27 additions and 15 deletions

View file

@ -32,6 +32,9 @@ struct workspace {
bool urgent;
};
/** Global bar state */
extern struct bar swaybar;
/**
* Setup bar.
*/

View file

@ -14,4 +14,9 @@ void render(struct output *output, struct config *config, struct status_line *li
*/
void set_window_height(struct window *window, int height);
/**
* Compute the size of a workspace name
*/
void workspace_button_size(struct window *window, const char *workspace_name, int *width, int *height);
#endif /* _SWAYBAR_RENDER_H */