1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibGUI: Apply more padding to text on tabs

Previously the text would be up close to the left / right border
depending on the alignment.

This patch increases the padding on either side from one to four pixels.
This commit is contained in:
networkException 2022-07-14 15:41:47 +02:00 committed by Andreas Kling
parent 66fc06001d
commit 15c290461f

View file

@ -263,7 +263,7 @@ void TabWidget::paint_event(PaintEvent& event)
auto button_rect = this->button_rect(i);
Gfx::StylePainter::paint_tab_button(painter, button_rect, palette(), false, hovered, m_tabs[i].widget->is_enabled(), m_tab_position, window()->is_active());
auto tab_button_content_rect = button_rect.shrunken(2, 0);
auto tab_button_content_rect = button_rect.shrunken(8, 0);
paint_tab_icon_if_needed(m_tabs[i].icon, button_rect, tab_button_content_rect);
tab_button_content_rect.set_width(tab_button_content_rect.width() - (m_close_button_enabled ? 16 : 0));
@ -303,7 +303,7 @@ void TabWidget::paint_event(PaintEvent& event)
button_rect.set_x(m_mouse_pos - m_grab_offset);
}
auto tab_button_content_rect = button_rect.shrunken(2, 0);
auto tab_button_content_rect = button_rect.shrunken(8, 0);
Gfx::StylePainter::paint_tab_button(painter, button_rect, palette(), true, hovered, m_tabs[i].widget->is_enabled(), m_tab_position, window()->is_active());
paint_tab_icon_if_needed(m_tabs[i].icon, button_rect, tab_button_content_rect);