GTabWidget: Tweak appearance.

This commit is contained in:
Andreas Kling 2019-05-07 14:13:20 +02:00
parent 5c4b421d56
commit 11b99dd89a
Notes: sideshowbarker 2024-07-19 14:12:39 +09:00
2 changed files with 3 additions and 3 deletions

View file

@ -98,7 +98,7 @@ void GTabWidget::paint_event(GPaintEvent& event)
bool hovered = i == m_hovered_tab_index;
auto button_rect = this->button_rect(i);
StylePainter::paint_tab_button(painter, button_rect, false, hovered, m_tabs[i].widget->is_enabled());
painter.draw_text(button_rect, m_tabs[i].title, TextAlignment::Center);
painter.draw_text(button_rect.translated(0, 1), m_tabs[i].title, TextAlignment::Center);
}
for (int i = 0; i < m_tabs.size(); ++i) {
@ -107,7 +107,7 @@ void GTabWidget::paint_event(GPaintEvent& event)
bool hovered = i == m_hovered_tab_index;
auto button_rect = this->button_rect(i);
StylePainter::paint_tab_button(painter, button_rect, true, hovered, m_tabs[i].widget->is_enabled());
painter.draw_text(button_rect, m_tabs[i].title, TextAlignment::Center);
painter.draw_text(button_rect.translated(0, 1), m_tabs[i].title, TextAlignment::Center);
painter.draw_line(button_rect.bottom_left().translated(1, 1), button_rect.bottom_right().translated(-1, 1), background_color());
break;
}

View file

@ -10,7 +10,7 @@ public:
GWidget* active_widget() const { return m_active_widget; }
void set_active_widget(GWidget*);
int bar_height() const { return 22; }
int bar_height() const { return 21; }
int container_padding() const { return 2; }
void add_widget(const String&, GWidget*);