From f6c3682c05bce05f00b13b8f469b52923ecd8ddb Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 22 May 2018 08:27:42 +1000 Subject: Use constants for titlebar dimensions --- sway/tree/container.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sway/tree/container.c') diff --git a/sway/tree/container.c b/sway/tree/container.c index 5d88325f..3f30a079 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -510,7 +510,7 @@ static struct sway_container *container_at_tabbed(struct sway_container *parent, struct sway_seat *seat = input_manager_current_seat(input_manager); // Tab titles - int title_height = config->border_thickness * 2 + config->font_height; + int title_height = container_titlebar_height(); if (oy < parent->y + title_height) { int tab_width = parent->width / parent->children->length; int child_index = (ox - parent->x) / tab_width; @@ -847,3 +847,7 @@ void container_notify_child_title_changed(struct sway_container *container) { container_update_title_textures(container); container_notify_child_title_changed(container->parent); } + +size_t container_titlebar_height() { + return config->font_height + TITLEBAR_V_PADDING * 2; +} -- cgit v1.2.3-54-g00ecf