int window_titlebar_padding_width;
int window_titlebar_padding_height;
- int title_height;
+ int titlebar_height;
float window_toggled_keybinds_color[4];
enum lab_justification window_label_text_justify;
corner_top_left = &theme->window[active].corner_top_left_normal->base;
corner_top_right = &theme->window[active].corner_top_right_normal->base;
wlr_scene_node_set_enabled(&parent->node, active);
- wlr_scene_node_set_position(&parent->node, 0, -theme->title_height);
+ wlr_scene_node_set_position(&parent->node, 0, -theme->titlebar_height);
wl_list_init(&subtree->parts);
/* Background */
add_scene_rect(&subtree->parts, LAB_SSD_PART_TITLEBAR, parent,
- width - corner_width * 2, theme->title_height,
+ width - corner_width * 2, theme->titlebar_height,
corner_width, 0, color);
add_scene_buffer(&subtree->parts, LAB_SSD_PART_TITLEBAR_CORNER_LEFT, parent,
corner_top_left, -rc.theme->border_width, -rc.theme->border_width);
int x = theme->window_titlebar_padding_width;
/* Center vertically within titlebar */
- int y = (theme->title_height - theme->window_button_height) / 2;
+ int y = (theme->titlebar_height - theme->window_button_height) / 2;
wl_list_for_each(b, &rc.title_buttons_left, link) {
struct lab_data_buffer **buffers =
FOR_EACH_STATE(ssd, subtree) {
part = ssd_get_part(&subtree->parts, LAB_SSD_PART_TITLEBAR);
wlr_scene_node_set_position(part->node, x, 0);
- wlr_scene_rect_set_size(
- wlr_scene_rect_from_node(part->node), width - 2 * x, theme->title_height);
+ wlr_scene_rect_set_size(wlr_scene_rect_from_node(part->node),
+ width - 2 * x, theme->titlebar_height);
part = ssd_get_part(&subtree->parts, LAB_SSD_PART_TITLEBAR_CORNER_LEFT);
wlr_scene_node_set_enabled(part->node, !enable);
update_visible_buttons(ssd);
/* Center buttons vertically within titlebar */
- int y = (theme->title_height - theme->window_button_height) / 2;
+ int y = (theme->titlebar_height - theme->window_button_height) / 2;
int x;
struct ssd_part *part;
struct ssd_sub_tree *subtree;
part = ssd_get_part(&subtree->parts, LAB_SSD_PART_TITLEBAR);
wlr_scene_rect_set_size(
wlr_scene_rect_from_node(part->node),
- width - bg_offset * 2, theme->title_height);
+ width - bg_offset * 2, theme->titlebar_height);
x = theme->window_titlebar_padding_width;
wl_list_for_each(b, &rc.title_buttons_left, link) {
buffer_width = part->buffer ? part->buffer->width : 0;
buffer_height = part->buffer ? part->buffer->height : 0;
x = offset_left;
- y = (theme->title_height - buffer_height) / 2;
+ y = (theme->titlebar_height - buffer_height) / 2;
if (title_bg_width <= 0) {
wlr_scene_node_set_enabled(part->node, false);
if (view->maximized == VIEW_AXIS_BOTH) {
struct border thickness = { 0 };
if (!view->ssd_titlebar_hidden) {
- thickness.top += theme->title_height;
+ thickness.top += theme->titlebar_height;
}
return thickness;
}
struct border thickness = {
- .top = theme->title_height + theme->border_width,
+ .top = theme->titlebar_height + theme->border_width,
.bottom = theme->border_width,
.left = theme->border_width,
.right = theme->border_width,
};
if (view->ssd_titlebar_hidden) {
- thickness.top -= theme->title_height;
+ thickness.top -= theme->titlebar_height;
}
return thickness;
}
ssd->view = view;
ssd->tree = wlr_scene_tree_create(view->scene_tree);
wlr_scene_node_lower_to_bottom(&ssd->tree->node);
- ssd->titlebar.height = view->server->theme->title_height;
+ ssd->titlebar.height = view->server->theme->titlebar_height;
ssd_shadow_create(ssd);
ssd_extents_create(ssd);
/*
return;
}
wlr_scene_node_set_enabled(&ssd->titlebar.tree->node, enabled);
- ssd->titlebar.height = enabled ? ssd->view->server->theme->title_height : 0;
+ ssd->titlebar.height = enabled ? ssd->view->server->theme->titlebar_height : 0;
ssd_border_update(ssd);
ssd_extents_update(ssd);
ssd_shadow_update(ssd);
* border. See the picture in #2189 for reference.
*/
int margin_x = theme->window_titlebar_padding_width;
- int margin_y = (theme->title_height - theme->window_button_height) / 2;
+ int margin_y = (theme->titlebar_height - theme->window_button_height) / 2;
float white[4] = {1, 1, 1, 1};
struct rounded_corner_ctx rounded_ctx = {
.box = &(struct wlr_box){
theme->border_width = 1;
theme->window_titlebar_padding_height = 0;
theme->window_titlebar_padding_width = 0;
- theme->title_height = INT_MIN;
parse_hexstr("#e1dedb", theme->window[THEME_ACTIVE].border_color);
parse_hexstr("#f6f5f4", theme->window[THEME_INACTIVE].border_color);
.x = 0,
.y = 0,
.width = corner_width + theme->border_width,
- .height = theme->title_height + theme->border_width,
+ .height = theme->titlebar_height + theme->border_width,
};
for (int active = THEME_INACTIVE; active <= THEME_ACTIVE; active++) {
total_size, theme->window[active].shadow_color);
shadow_corner_gradient(theme->window[active].shadow_corner_top,
visible_size, total_size,
- theme->title_height, theme->window[active].shadow_color);
+ theme->titlebar_height, theme->window[active].shadow_color);
shadow_corner_gradient(theme->window[active].shadow_corner_bottom,
visible_size, total_size, 0,
theme->window[active].shadow_color);
static void
post_processing(struct theme *theme)
{
- theme->title_height = get_titlebar_height(theme);
+ theme->titlebar_height = get_titlebar_height(theme);
theme->menu_item_height = font_height(&rc.font_menuitem)
+ 2 * theme->menu_items_padding_y;
+ 2 * theme->osd_window_switcher_item_padding_y
+ 2 * theme->osd_window_switcher_item_active_border_width;
- if (rc.corner_radius >= theme->title_height) {
- rc.corner_radius = theme->title_height - 1;
+ if (rc.corner_radius >= theme->titlebar_height) {
+ rc.corner_radius = theme->titlebar_height - 1;
}
int min_button_hover_radius =
int offset_x = rc.placement_cascade_offset_x;
int offset_y = rc.placement_cascade_offset_y;
struct theme *theme = view->server->theme;
- int default_offset = theme->title_height + theme->border_width + 5;
+ int default_offset = theme->titlebar_height + theme->border_width + 5;
if (offset_x <= 0) {
offset_x = default_offset;
}