mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:07:45 +00:00
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:
parent
67108f872f
commit
5c4b421d56
3 changed files with 43 additions and 13 deletions
|
@ -22,11 +22,14 @@ protected:
|
|||
virtual void child_event(CChildEvent&) override;
|
||||
virtual void resize_event(GResizeEvent&) override;
|
||||
virtual void mousedown_event(GMouseEvent&) override;
|
||||
virtual void mousemove_event(GMouseEvent&) override;
|
||||
virtual void leave_event(CEvent&) override;
|
||||
|
||||
private:
|
||||
Rect child_rect_for_size(const Size&) const;
|
||||
Rect button_rect(int index) const;
|
||||
Rect bar_rect() const;
|
||||
void update_bar();
|
||||
|
||||
GWidget* m_active_widget { nullptr };
|
||||
|
||||
|
@ -35,7 +38,7 @@ private:
|
|||
int width(const Font&) const;
|
||||
String title;
|
||||
GWidget* widget { nullptr };
|
||||
bool hovered { false };
|
||||
};
|
||||
Vector<TabData> m_tabs;
|
||||
int m_hovered_tab_index { -1 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue