summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-26 17:46:16 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-26 17:46:16 +0200
commit37918d4141375390a6e1f84863a68b7035733011 (patch)
tree1fe82f8349e1b7fb675401df1a59ee271a0cf676 /Libraries
parentfb826aa59abd6e2baff6a8ebe1c749d1ddc04731 (diff)
downloadserenity-37918d4141375390a6e1f84863a68b7035733011.zip
Revert "LibGUI: Use bold font for the currently active TabWidget tab"
This reverts commit 4d8206f7c27e1c235104143a76fe5ed64ffcbac3. This was not visually pleasant. We'll have to come up with some better way to distinguish the active tab in Browser.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/TabWidget.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/Libraries/LibGUI/TabWidget.cpp b/Libraries/LibGUI/TabWidget.cpp
index 2b8834fc19..721c74af86 100644
--- a/Libraries/LibGUI/TabWidget.cpp
+++ b/Libraries/LibGUI/TabWidget.cpp
@@ -189,7 +189,7 @@ void TabWidget::paint_event(PaintEvent& event)
Gfx::StylePainter::paint_tab_button(painter, button_rect, palette(), true, hovered, m_tabs[i].widget->is_enabled());
auto text_rect = button_rect.translated(0, 1);
paint_tab_icon_if_needed(m_tabs[i].icon, button_rect, text_rect);
- painter.draw_text(text_rect, m_tabs[i].title, Gfx::Font::default_bold_font(), m_text_alignment, palette().button_text(), Gfx::TextElision::Right);
+ painter.draw_text(text_rect, m_tabs[i].title, m_text_alignment, palette().button_text(), Gfx::TextElision::Right);
painter.draw_line(button_rect.bottom_left().translated(1, 1), button_rect.bottom_right().translated(-1, 1), palette().button());
break;
}
@@ -204,13 +204,10 @@ Gfx::Rect TabWidget::button_rect(int index) const
{
int x_offset = 2;
for (int i = 0; i < index; ++i) {
- bool is_active_tab = m_tabs[i].widget == active_widget();
- auto& font = is_active_tab ? Gfx::Font::default_bold_font() : Gfx::Font::default_font();
- auto tab_width = m_uniform_tabs ? uniform_tab_width() : m_tabs[i].width(font);
+ auto tab_width = m_uniform_tabs ? uniform_tab_width() : m_tabs[i].width(font());
x_offset += tab_width;
}
- auto& font = m_tabs[index].widget == active_widget() ? Gfx::Font::default_bold_font() : Gfx::Font::default_font();
- Gfx::Rect rect { x_offset, 0, m_uniform_tabs ? uniform_tab_width() : m_tabs[index].width(font), bar_height() };
+ Gfx::Rect rect { x_offset, 0, m_uniform_tabs ? uniform_tab_width() : m_tabs[index].width(font()), bar_height() };
if (m_tabs[index].widget != m_active_widget) {
rect.move_by(0, 2);
rect.set_height(rect.height() - 2);