mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-05 10:42:51 +00:00
GToolBar: Make the framed appearance optional.
This commit is contained in:
parent
d8ae6c31ce
commit
db5341e11d
Notes:
sideshowbarker
2024-07-19 14:10:43 +09:00
Author: https://github.com/awesomekling
Commit: db5341e11d
2 changed files with 9 additions and 1 deletions
|
@ -81,5 +81,9 @@ void GToolBar::paint_event(GPaintEvent& event)
|
||||||
{
|
{
|
||||||
GPainter painter(*this);
|
GPainter painter(*this);
|
||||||
painter.add_clip_rect(event.rect());
|
painter.add_clip_rect(event.rect());
|
||||||
|
|
||||||
|
if (m_has_frame)
|
||||||
StylePainter::paint_surface(painter, rect(), x() != 0, y() != 0);
|
StylePainter::paint_surface(painter, rect(), x() != 0, y() != 0);
|
||||||
|
else
|
||||||
|
painter.fill_rect(event.rect(), Color::LightGray);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,9 @@ public:
|
||||||
void add_action(Retained<GAction>&&);
|
void add_action(Retained<GAction>&&);
|
||||||
void add_separator();
|
void add_separator();
|
||||||
|
|
||||||
|
bool has_frame() const { return m_has_frame; }
|
||||||
|
void set_has_frame(bool has_frame) { m_has_frame = has_frame; }
|
||||||
|
|
||||||
virtual const char* class_name() const override { return "GToolBar"; }
|
virtual const char* class_name() const override { return "GToolBar"; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -23,4 +26,5 @@ private:
|
||||||
RetainPtr<GAction> action;
|
RetainPtr<GAction> action;
|
||||||
};
|
};
|
||||||
Vector<OwnPtr<Item>> m_items;
|
Vector<OwnPtr<Item>> m_items;
|
||||||
|
bool m_has_frame { true };
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue