summaryrefslogtreecommitdiff
path: root/DevTools/VisualBuilder
diff options
context:
space:
mode:
Diffstat (limited to 'DevTools/VisualBuilder')
-rw-r--r--DevTools/VisualBuilder/VBForm.cpp6
-rw-r--r--DevTools/VisualBuilder/VBForm.h6
-rw-r--r--DevTools/VisualBuilder/VBWidget.cpp4
-rw-r--r--DevTools/VisualBuilder/VBWidget.h6
-rw-r--r--DevTools/VisualBuilder/VBWidgetPropertyModel.cpp4
-rw-r--r--DevTools/VisualBuilder/main.cpp42
6 files changed, 34 insertions, 34 deletions
diff --git a/DevTools/VisualBuilder/VBForm.cpp b/DevTools/VisualBuilder/VBForm.cpp
index 5f88b4b446..00fa9d04d7 100644
--- a/DevTools/VisualBuilder/VBForm.cpp
+++ b/DevTools/VisualBuilder/VBForm.cpp
@@ -63,13 +63,13 @@ VBForm::VBForm(const String& name, GUI::Widget* parent)
widget->gwidget()->move_to_back();
}));
m_context_menu->add_separator();
- m_context_menu->add_action(GUI::Action::create("Lay out horizontally", load_png("/res/icons/16x16/layout-horizontally.png"), [this](auto&) {
+ m_context_menu->add_action(GUI::Action::create("Lay out horizontally", Gfx::load_png("/res/icons/16x16/layout-horizontally.png"), [this](auto&) {
if (auto* widget = single_selected_widget()) {
dbg() << "Giving " << *widget->gwidget() << " a horizontal box layout";
widget->gwidget()->set_layout(make<GUI::HBoxLayout>());
}
}));
- m_context_menu->add_action(GUI::Action::create("Lay out vertically", load_png("/res/icons/16x16/layout-vertically.png"), [this](auto&) {
+ m_context_menu->add_action(GUI::Action::create("Lay out vertically", Gfx::load_png("/res/icons/16x16/layout-vertically.png"), [this](auto&) {
if (auto* widget = single_selected_widget()) {
dbg() << "Giving " << *widget->gwidget() << " a vertical box layout";
widget->gwidget()->set_layout(make<GUI::VBoxLayout>());
@@ -138,7 +138,7 @@ bool VBForm::is_selected(const VBWidget& widget) const
return m_selected_widgets.contains(const_cast<VBWidget*>(&widget));
}
-VBWidget* VBForm::widget_at(const Point& position)
+VBWidget* VBForm::widget_at(const Gfx::Point& position)
{
auto result = hit_test(position, GUI::Widget::ShouldRespectGreediness::No);
if (!result.widget)
diff --git a/DevTools/VisualBuilder/VBForm.h b/DevTools/VisualBuilder/VBForm.h
index 4b49908fbb..dba01dbe12 100644
--- a/DevTools/VisualBuilder/VBForm.h
+++ b/DevTools/VisualBuilder/VBForm.h
@@ -43,7 +43,7 @@ public:
void set_name(const String& name) { m_name = name; }
bool is_selected(const VBWidget&) const;
- VBWidget* widget_at(const Point&);
+ VBWidget* widget_at(const Gfx::Point&);
void set_should_snap_to_grip(bool snap) { m_should_snap_to_grid = snap; }
bool should_snap_to_grid() const { return m_should_snap_to_grid; }
@@ -83,8 +83,8 @@ private:
NonnullRefPtrVector<VBWidget> m_widgets;
HashMap<GUI::Widget*, VBWidget*> m_gwidget_map;
HashTable<VBWidget*> m_selected_widgets;
- Point m_transform_event_origin;
- Point m_next_insertion_position;
+ Gfx::Point m_transform_event_origin;
+ Gfx::Point m_next_insertion_position;
Direction m_resize_direction { Direction::None };
Direction m_mouse_direction_type { Direction::None };
RefPtr<GUI::Menu> m_context_menu;
diff --git a/DevTools/VisualBuilder/VBWidget.cpp b/DevTools/VisualBuilder/VBWidget.cpp
index 3cac9cc6da..93cce9648b 100644
--- a/DevTools/VisualBuilder/VBWidget.cpp
+++ b/DevTools/VisualBuilder/VBWidget.cpp
@@ -64,7 +64,7 @@ Rect VBWidget::rect() const
return m_gwidget->window_relative_rect();
}
-void VBWidget::set_rect(const Rect& rect)
+void VBWidget::set_rect(const Gfx::Rect& rect)
{
if (rect == m_gwidget->window_relative_rect())
return;
@@ -106,7 +106,7 @@ Rect VBWidget::grabber_rect(Direction direction) const
}
}
-Direction VBWidget::grabber_at(const Point& position) const
+Direction VBWidget::grabber_at(const Gfx::Point& position) const
{
Direction found_grabber = Direction::None;
for_each_direction([&](Direction direction) {
diff --git a/DevTools/VisualBuilder/VBWidget.h b/DevTools/VisualBuilder/VBWidget.h
index 1187016187..48bee7f478 100644
--- a/DevTools/VisualBuilder/VBWidget.h
+++ b/DevTools/VisualBuilder/VBWidget.h
@@ -80,10 +80,10 @@ public:
bool is_selected() const;
Rect rect() const;
- void set_rect(const Rect&);
+ void set_rect(const Gfx::Rect&);
Rect grabber_rect(Direction) const;
- Direction grabber_at(const Point&) const;
+ Direction grabber_at(const Gfx::Point&) const;
GUI::Widget* gwidget() { return m_gwidget; }
@@ -113,5 +113,5 @@ private:
RefPtr<GUI::Widget> m_gwidget;
NonnullOwnPtrVector<VBProperty> m_properties;
NonnullRefPtr<VBWidgetPropertyModel> m_property_model;
- Rect m_transform_origin_rect;
+ Gfx::Rect m_transform_origin_rect;
};
diff --git a/DevTools/VisualBuilder/VBWidgetPropertyModel.cpp b/DevTools/VisualBuilder/VBWidgetPropertyModel.cpp
index 4f366ceff5..8acb441694 100644
--- a/DevTools/VisualBuilder/VBWidgetPropertyModel.cpp
+++ b/DevTools/VisualBuilder/VBWidgetPropertyModel.cpp
@@ -61,8 +61,8 @@ GUI::Model::ColumnMetadata VBWidgetPropertyModel::column_metadata(int column) co
{
UNUSED_PARAM(column);
if (column == Column::Name)
- return { 110, TextAlignment::CenterLeft, &Font::default_bold_font() };
- return { 90, TextAlignment::CenterLeft };
+ return { 110, Gfx::TextAlignment::CenterLeft, &Gfx::Font::default_bold_font() };
+ return { 90, Gfx::TextAlignment::CenterLeft };
}
GUI::Variant VBWidgetPropertyModel::data(const GUI::ModelIndex& index, Role role) const
diff --git a/DevTools/VisualBuilder/main.cpp b/DevTools/VisualBuilder/main.cpp
index 10d707dee8..421de868af 100644
--- a/DevTools/VisualBuilder/main.cpp
+++ b/DevTools/VisualBuilder/main.cpp
@@ -82,7 +82,7 @@ int main(int argc, char** argv)
auto help_menu = GUI::Menu::construct("Help");
help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) {
- GUI::AboutDialog::show("Visual Builder", load_png("/res/icons/32x32/app-visual-builder.png"), window);
+ GUI::AboutDialog::show("Visual Builder", Gfx::load_png("/res/icons/32x32/app-visual-builder.png"), window);
}));
menubar->add_menu(move(help_menu));
@@ -113,82 +113,82 @@ RefPtr<GUI::Window> make_toolbox_window()
window->set_main_widget(widget);
auto label_button = GUI::Button::construct(widget);
- label_button->set_button_style(ButtonStyle::CoolBar);
+ label_button->set_button_style(Gfx::ButtonStyle::CoolBar);
label_button->set_tooltip("GLabel");
- label_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/label.png"));
+ label_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/label.png"));
label_button->on_click = [](GUI::Button&) {
if (auto* form = VBForm::current())
form->insert_widget(VBWidgetType::GLabel);
};
auto button_button = GUI::Button::construct(widget);
- button_button->set_button_style(ButtonStyle::CoolBar);
+ button_button->set_button_style(Gfx::ButtonStyle::CoolBar);
button_button->set_tooltip("GButton");
- button_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/button.png"));
+ button_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/button.png"));
button_button->on_click = [](GUI::Button&) {
if (auto* form = VBForm::current())
form->insert_widget(VBWidgetType::GButton);
};
auto spinbox_button = GUI::Button::construct(widget);
- spinbox_button->set_button_style(ButtonStyle::CoolBar);
+ spinbox_button->set_button_style(Gfx::ButtonStyle::CoolBar);
spinbox_button->set_tooltip("GSpinBox");
- spinbox_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/spinbox.png"));
+ spinbox_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/spinbox.png"));
spinbox_button->on_click = [](GUI::Button&) {
if (auto* form = VBForm::current())
form->insert_widget(VBWidgetType::GSpinBox);
};
auto editor_button = GUI::Button::construct(widget);
- editor_button->set_button_style(ButtonStyle::CoolBar);
+ editor_button->set_button_style(Gfx::ButtonStyle::CoolBar);
editor_button->set_tooltip("GTextEditor");
- editor_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/textbox.png"));
+ editor_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/textbox.png"));
editor_button->on_click = [](GUI::Button&) {
if (auto* form = VBForm::current())
form->insert_widget(VBWidgetType::GTextEditor);
};
auto progress_bar_button = GUI::Button::construct(widget);
- progress_bar_button->set_button_style(ButtonStyle::CoolBar);
+ progress_bar_button->set_button_style(Gfx::ButtonStyle::CoolBar);
progress_bar_button->set_tooltip("GProgressBar");
- progress_bar_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/progressbar.png"));
+ progress_bar_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/progressbar.png"));
progress_bar_button->on_click = [](GUI::Button&) {
if (auto* form = VBForm::current())
form->insert_widget(VBWidgetType::GProgressBar);
};
auto slider_button = GUI::Button::construct(widget);
- slider_button->set_button_style(ButtonStyle::CoolBar);
+ slider_button->set_button_style(Gfx::ButtonStyle::CoolBar);
slider_button->set_tooltip("GSlider");
- slider_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/slider.png"));
+ slider_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/slider.png"));
slider_button->on_click = [](GUI::Button&) {
if (auto* form = VBForm::current())
form->insert_widget(VBWidgetType::GSlider);
};
auto checkbox_button = GUI::Button::construct(widget);
- checkbox_button->set_button_style(ButtonStyle::CoolBar);
+ checkbox_button->set_button_style(Gfx::ButtonStyle::CoolBar);
checkbox_button->set_tooltip("GCheckBox");
- checkbox_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/checkbox.png"));
+ checkbox_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/checkbox.png"));
checkbox_button->on_click = [](GUI::Button&) {
if (auto* form = VBForm::current())
form->insert_widget(VBWidgetType::GCheckBox);
};
auto radiobutton_button = GUI::Button::construct(widget);
- radiobutton_button->set_button_style(ButtonStyle::CoolBar);
+ radiobutton_button->set_button_style(Gfx::ButtonStyle::CoolBar);
radiobutton_button->set_tooltip("GRadioButton");
- radiobutton_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/filled-radio-circle.png"));
+ radiobutton_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/filled-radio-circle.png"));
radiobutton_button->on_click = [](GUI::Button&) {
if (auto* form = VBForm::current())
form->insert_widget(VBWidgetType::GRadioButton);
};
auto scrollbar_button = GUI::Button::construct(widget);
- scrollbar_button->set_button_style(ButtonStyle::CoolBar);
+ scrollbar_button->set_button_style(Gfx::ButtonStyle::CoolBar);
scrollbar_button->set_tooltip("GScrollBar");
- scrollbar_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/scrollbar.png"));
+ scrollbar_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/scrollbar.png"));
scrollbar_button->on_click = [](GUI::Button&) {
if (auto* form = VBForm::current())
form->insert_widget(VBWidgetType::GScrollBar);
};
auto groupbox_button = GUI::Button::construct(widget);
- groupbox_button->set_button_style(ButtonStyle::CoolBar);
+ groupbox_button->set_button_style(Gfx::ButtonStyle::CoolBar);
groupbox_button->set_tooltip("GGroupBox");
- groupbox_button->set_icon(GraphicsBitmap::load_from_file("/res/icons/vbwidgets/groupbox.png"));
+ groupbox_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/vbwidgets/groupbox.png"));
groupbox_button->on_click = [](GUI::Button&) {
if (auto* form = VBForm::current())
form->insert_widget(VBWidgetType::GGroupBox);