mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:37:35 +00:00
VisualBuilder: Add GSlider to the widgets toolbox.
This commit is contained in:
parent
fb0c598d22
commit
86aad50818
6 changed files with 26 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <LibGUI/GCheckBox.h>
|
||||
#include <LibGUI/GScrollBar.h>
|
||||
#include <LibGUI/GGroupBox.h>
|
||||
#include <LibGUI/GSlider.h>
|
||||
|
||||
static String to_class_name(VBWidgetType type)
|
||||
{
|
||||
|
@ -21,6 +22,7 @@ static String to_class_name(VBWidgetType type)
|
|||
case VBWidgetType::GCheckBox: return "GCheckBox";
|
||||
case VBWidgetType::GScrollBar: return "GScrollBar";
|
||||
case VBWidgetType::GGroupBox: return "GGroupBox";
|
||||
case VBWidgetType::GSlider: return "GSlider";
|
||||
default: ASSERT_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +65,12 @@ static GWidget* build_gwidget(VBWidgetType type, GWidget* parent)
|
|||
bar->set_value(50);
|
||||
return bar;
|
||||
}
|
||||
case VBWidgetType::GSlider: {
|
||||
auto* slider = new GSlider(parent);
|
||||
slider->set_range(0, 100);
|
||||
slider->set_value(50);
|
||||
return slider;
|
||||
}
|
||||
case VBWidgetType::GCheckBox: {
|
||||
auto* box = new GCheckBox(parent);
|
||||
box->set_caption("checkbox_1");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue