diff options
-rw-r--r-- | DevTools/HackStudio/FormEditorWidget.h | 3 | ||||
-rw-r--r-- | DevTools/HackStudio/main.cpp | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/DevTools/HackStudio/FormEditorWidget.h b/DevTools/HackStudio/FormEditorWidget.h index ef53044f8f..7f04cf4248 100644 --- a/DevTools/HackStudio/FormEditorWidget.h +++ b/DevTools/HackStudio/FormEditorWidget.h @@ -9,6 +9,9 @@ class FormEditorWidget final : public GScrollableWidget { public: virtual ~FormEditorWidget() override; + FormWidget& form_widget() { return *m_form_widget; } + const FormWidget& form_widget() const { return *m_form_widget; } + private: virtual void paint_event(GPaintEvent&) override; diff --git a/DevTools/HackStudio/main.cpp b/DevTools/HackStudio/main.cpp index cf8df9a7d6..0da3e184fe 100644 --- a/DevTools/HackStudio/main.cpp +++ b/DevTools/HackStudio/main.cpp @@ -3,6 +3,7 @@ #include "EditorWrapper.h" #include "FindInFilesWidget.h" #include "FormEditorWidget.h" +#include "FormWidget.h" #include "Locator.h" #include "Project.h" #include "TerminalWrapper.h" @@ -132,8 +133,9 @@ int main(int argc, char** argv) GWidgetClassRegistration::for_each([&](const GWidgetClassRegistration& reg) { auto icon_path = String::format("/res/icons/widgets/%s.png", reg.class_name().characters()); - auto action = GAction::create(reg.class_name(), GraphicsBitmap::load_from_file(icon_path), [&](auto&) { - + auto action = GAction::create(reg.class_name(), GraphicsBitmap::load_from_file(icon_path), [®](auto&) { + auto widget = reg.construct(&g_form_editor_widget->form_widget()); + widget->set_relative_rect(30, 30, 30, 30); }); form_widgets_toolbar->add_action(move(action)); }); |