GTabWidget: Highlight tab buttons when hovered.

The active tab's button doesn't get highlighted, since the highlight is
supposed to indicate that the widget can be interacted with.
This commit is contained in:
Andreas Kling 2019-05-07 14:01:20 +02:00
commit 5c4b421d56
Notes: sideshowbarker 2024-07-19 14:12:41 +09:00
3 changed files with 43 additions and 13 deletions

View file

@ -7,14 +7,8 @@ void StylePainter::paint_tab_button(Painter& painter, const Rect& rect, bool act
Color highlight_color2 = Color::from_rgb(0xdfdfdf);
Color shadow_color1 = Color::from_rgb(0x808080);
Color shadow_color2 = Color::from_rgb(0x404040);
ASSERT(!hovered);
if (enabled) {
if (hovered)
base_color = Color::from_rgb(0xe3dfdb);
//else
// button_color = Color::from_rgb(0xd6d2ce);
} else if (hovered && enabled)
if (hovered && enabled && !active)
base_color = Color::from_rgb(0xd4d4d4);
PainterStateSaver saver(painter);