diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/themeeditor/gui/editorwindow.cpp | 35 | ||||
-rw-r--r-- | utils/themeeditor/gui/editorwindow.h | 4 |
2 files changed, 23 insertions, 16 deletions
diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp index 81d05c8ed4..94e744e957 100644 --- a/utils/themeeditor/gui/editorwindow.cpp +++ b/utils/themeeditor/gui/editorwindow.cpp @@ -30,18 +30,27 @@ #include <QGraphicsScene> EditorWindow::EditorWindow(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::EditorWindow), - parseTreeSelection(0) + QMainWindow(parent), ui(new Ui::EditorWindow), parseTreeSelection(0) { ui->setupUi(this); prefs = new PreferencesDialog(this); project = 0; - loadSettings(); setupUI(); + loadSettings(); setupMenus(); } + +EditorWindow::~EditorWindow() +{ + delete ui; + delete prefs; + if(project) + delete project; + delete deviceConfig; + delete deviceDock; +} + void EditorWindow::loadTabFromSkinFile(QString fileName) { /* Checking to see if the file is already open */ @@ -146,9 +155,13 @@ void EditorWindow::setupUI() ui->skinPreviewLayout->addWidget(viewer); /* Positioning the device settings dialog */ - QPoint thisPos = pos(); - deviceConfig.move(thisPos.x() + width() / 4, thisPos.y() + height() / 4); + deviceDock = new QDockWidget(tr("Device Configuration"), this); + deviceConfig = new DeviceState(deviceDock); + deviceDock->setObjectName("deviceDock"); + deviceDock->setWidget(deviceConfig); + deviceDock->setFloating(true); + deviceDock->hide(); } void EditorWindow::setupMenus() @@ -161,7 +174,7 @@ void EditorWindow::setupMenus() QObject::connect(ui->actionPreview_Panel, SIGNAL(triggered()), this, SLOT(showPanel())); QObject::connect(ui->actionDevice_Configuration, SIGNAL(triggered()), - &deviceConfig, SLOT(show())); + deviceDock, SLOT(show())); /* Connecting the document management actions */ QObject::connect(ui->actionNew_Document, SIGNAL(triggered()), @@ -483,11 +496,3 @@ void EditorWindow::sizeColumns() ui->parseTree->resizeColumnToContents(ParseTreeModel::typeColumn); ui->parseTree->resizeColumnToContents(ParseTreeModel::valueColumn); } - -EditorWindow::~EditorWindow() -{ - delete ui; - delete prefs; - if(project) - delete project; -} diff --git a/utils/themeeditor/gui/editorwindow.h b/utils/themeeditor/gui/editorwindow.h index 0bfaac3957..ab75cc54fa 100644 --- a/utils/themeeditor/gui/editorwindow.h +++ b/utils/themeeditor/gui/editorwindow.h @@ -25,6 +25,7 @@ #include <QMainWindow> #include <QLabel> #include <QItemSelectionModel> +#include <QDockWidget> #include "parsetreemodel.h" #include "skinhighlighter.h" @@ -89,7 +90,8 @@ private: ProjectModel* project; QItemSelectionModel* parseTreeSelection; SkinViewer* viewer; - DeviceState deviceConfig; + DeviceState* deviceConfig; + QDockWidget* deviceDock; }; #endif // EDITORWINDOW_H |