mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:57:35 +00:00
VisualBuilder: Expose GGroupBox name property.
This commit is contained in:
parent
62d347d12a
commit
b3f657a1c6
3 changed files with 13 additions and 0 deletions
|
@ -121,6 +121,10 @@ void VBWidget::setup_properties()
|
|||
VB_ADD_PROPERTY(GButton, "caption", caption, set_caption, string);
|
||||
}
|
||||
|
||||
if (m_type == VBWidgetType::GGroupBox) {
|
||||
VB_ADD_PROPERTY(GGroupBox, "name", name, set_name, string);
|
||||
}
|
||||
|
||||
if (m_type == VBWidgetType::GScrollBar) {
|
||||
VB_ADD_PROPERTY(GScrollBar, "min", min, set_min, int);
|
||||
VB_ADD_PROPERTY(GScrollBar, "max", max, set_max, int);
|
||||
|
|
|
@ -29,3 +29,11 @@ void GGroupBox::paint_event(GPaintEvent& event)
|
|||
painter.fill_rect(text_rect, background_color());
|
||||
painter.draw_text(text_rect, m_name, TextAlignment::Center, foreground_color());
|
||||
}
|
||||
|
||||
void GGroupBox::set_name(const String& name)
|
||||
{
|
||||
if (m_name == name)
|
||||
return;
|
||||
m_name = name;
|
||||
update();
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ public:
|
|||
virtual ~GGroupBox() override;
|
||||
|
||||
String name() const { return m_name; }
|
||||
void set_name(const String&);
|
||||
|
||||
virtual const char* class_name() const override { return "GGroupBox"; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue