1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 18:55:07 +00:00

VisualBuilder: Move properties window to its own class.

This commit is contained in:
Andreas Kling 2019-04-11 22:03:55 +02:00
parent 21d4b1c2fc
commit ec841f3a23
4 changed files with 43 additions and 22 deletions

View file

@ -9,25 +9,23 @@
#include "VBForm.h"
#include "VBWidget.h"
#include "VBWidgetPropertyModel.h"
#include "VBPropertiesWindow.h"
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
static GWindow* make_toolbox_window();
static GWindow* make_properties_window();
GTableView* g_property_table_view;
int main(int argc, char** argv)
{
GApplication app(argc, argv);
auto* propbox = make_properties_window();
auto* propbox = new VBPropertiesWindow;
auto* form1 = new VBForm("Form1");
form1->on_widget_selected = [] (VBWidget* widget) {
g_property_table_view->set_model(widget ? &widget->property_model() : nullptr);
form1->on_widget_selected = [propbox] (VBWidget* widget) {
propbox->table_view().set_model(widget ? &widget->property_model() : nullptr);
};
auto menubar = make<GMenuBar>();
@ -137,19 +135,3 @@ GWindow* make_toolbox_window()
};
return window;
}
GWindow* make_properties_window()
{
auto* window = new GWindow;
window->set_title("Properties");
window->set_rect(780, 200, 200, 280);
auto* widget = new GWidget;
widget->set_fill_with_background_color(true);
widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
window->set_main_widget(widget);
g_property_table_view = new GTableView(widget);
return window;
}