mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-12 17:30:38 +00:00
LibGUI: Allow overriding the padding inside a TabWidget
This commit is contained in:
parent
9d8620f956
commit
1587b53001
Notes:
sideshowbarker
2024-07-19 07:19:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1587b530016
2 changed files with 6 additions and 2 deletions
|
@ -156,7 +156,8 @@ void TabWidget::paint_event(PaintEvent& event)
|
|||
padding_rect.shrink(2, 2);
|
||||
}
|
||||
|
||||
Gfx::StylePainter::paint_frame(painter, container_rect, palette(), Gfx::FrameShape::Container, Gfx::FrameShadow::Raised, 2);
|
||||
if (container_padding() > 0)
|
||||
Gfx::StylePainter::paint_frame(painter, container_rect, palette(), Gfx::FrameShape::Container, Gfx::FrameShadow::Raised, 2);
|
||||
|
||||
for (size_t i = 0; i < m_tabs.size(); ++i) {
|
||||
if (m_tabs[i].widget == m_active_widget)
|
||||
|
|
|
@ -50,7 +50,9 @@ public:
|
|||
void set_active_widget(Widget*);
|
||||
|
||||
int bar_height() const { return 21; }
|
||||
int container_padding() const { return 2; }
|
||||
|
||||
int container_padding() const { return m_container_padding; }
|
||||
void set_container_padding(int padding) { m_container_padding = padding; }
|
||||
|
||||
void add_widget(const StringView&, Widget&);
|
||||
void remove_widget(Widget&);
|
||||
|
@ -100,6 +102,7 @@ private:
|
|||
Vector<TabData> m_tabs;
|
||||
TabPosition m_tab_position { TabPosition::Top };
|
||||
int m_hovered_tab_index { -1 };
|
||||
int m_container_padding { 2 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue