diff options
author | Treeki <treeki@gmail.com> | 2012-08-15 16:25:15 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-08-15 16:25:15 +0200 |
commit | 247a25c8ecaa8e6496ea1f35c0c7d4eb1154a0a9 (patch) | |
tree | 63a8c844f4c4c490cb9a53137352d3a19a74884a | |
parent | b3e58ec4a57f1cefe34438943b963f86dbf40b72 (diff) | |
download | LayoutStudio-247a25c8ecaa8e6496ea1f35c0c7d4eb1154a0a9.tar.gz LayoutStudio-247a25c8ecaa8e6496ea1f35c0c7d4eb1154a0a9.zip |
the beginnings of a very, very unfinished pane editor
Diffstat (limited to '')
-rw-r--r-- | LayoutStudio.pro | 6 | ||||
-rw-r--r-- | lslayoutwindow.cpp | 11 | ||||
-rw-r--r-- | lslayoutwindow.h | 3 | ||||
-rw-r--r-- | lspaneeditor.cpp | 27 | ||||
-rw-r--r-- | lspaneeditor.h | 30 |
5 files changed, 74 insertions, 3 deletions
diff --git a/LayoutStudio.pro b/LayoutStudio.pro index 2a27df3..66a8567 100644 --- a/LayoutStudio.pro +++ b/LayoutStudio.pro @@ -38,7 +38,8 @@ SOURCES += main.cpp \ wii/texpalette.cpp \ lspackagemodel.cpp \ lslayoutwindow.cpp \ - lsscenemodel.cpp + lsscenemodel.cpp \ + lspaneeditor.cpp HEADERS += lsmainwindow.h \ lsglobals.h \ lyt/packagebase.h \ @@ -75,7 +76,8 @@ HEADERS += lsmainwindow.h \ wii/gx.h \ lspackagemodel.h \ lslayoutwindow.h \ - lsscenemodel.h + lsscenemodel.h \ + lspaneeditor.h FORMS += RESOURCES += resources.qrc diff --git a/lslayoutwindow.cpp b/lslayoutwindow.cpp index d137400..a164dd9 100644 --- a/lslayoutwindow.cpp +++ b/lslayoutwindow.cpp @@ -1,9 +1,11 @@ #include "lslayoutwindow.h" #include "lsscenemodel.h" +#include "lspaneeditor.h" #include "layoutgl/widget.h" #include <QGridLayout> #include <QFormLayout> #include <QGroupBox> +#include <QSplitter> LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, QWidget *parent) : QMainWindow(parent) { @@ -48,6 +50,8 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q m_tabWidget->addTab(w, "Layout"); // prepare the Scene Graph tab + QSplitter *gsplit = new QSplitter(this); + w = new QWidget(this); QGridLayout *ggrid = new QGridLayout(w); @@ -67,7 +71,12 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q ggrid->addWidget(m_clearSearchButton, 0, 1, 1, 1); ggrid->addLayout(m_sceneListSwitcher, 1, 0, 1, 2); - m_tabWidget->addTab(w, "Scene Graph"); + m_paneEditor = new LSPaneEditor(this); + + gsplit->addWidget(w); + gsplit->addWidget(m_paneEditor); + + m_tabWidget->addTab(gsplit, "Scene Graph"); // get the resource diff --git a/lslayoutwindow.h b/lslayoutwindow.h index 7375a7f..07e1b76 100644 --- a/lslayoutwindow.h +++ b/lslayoutwindow.h @@ -11,6 +11,7 @@ #include <QListView> #include "lyt/packagebase.h" #include "lyt/layout.h" +class LSPaneEditor; class LGLWidget; class LSLayoutWindow : public QMainWindow { @@ -43,6 +44,8 @@ private: QTreeView *m_sceneGraph; QListView *m_sceneSearchList; + LSPaneEditor *m_paneEditor; + private slots: void handleWidthChanged(double v); void handleHeightChanged(double v); diff --git a/lspaneeditor.cpp b/lspaneeditor.cpp new file mode 100644 index 0000000..eae5813 --- /dev/null +++ b/lspaneeditor.cpp @@ -0,0 +1,27 @@ +#include "lspaneeditor.h" + +LSPaneEditor::LSPaneEditor(QWidget *parent) : + QWidget(parent) { + + QGridLayout *layout = new QGridLayout(this); + + m_headingLabel = new QLabel(this); + + m_addChildButton = new QToolButton(this); + m_addChildButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + m_addChildButton->setPopupMode(QToolButton::InstantPopup); + m_addChildButton->setText("Add Child Pane"); + + m_addChildMenu = new QMenu(m_addChildButton); + m_addChildMenu->addSeparator(); + m_addChildButton->setMenu(m_addChildMenu); + + m_removeButton = new QToolButton(this); + m_removeButton->setToolButtonStyle(Qt::ToolButtonTextOnly); + m_removeButton->setText("Remove This Pane"); + + layout->addWidget(m_headingLabel, 0, 0, 1, 1); + layout->setColumnStretch(0, 1); + layout->addWidget(m_addChildButton, 0, 1, 1, 1); + layout->addWidget(m_removeButton, 0, 2, 1, 1); +} diff --git a/lspaneeditor.h b/lspaneeditor.h new file mode 100644 index 0000000..92233cc --- /dev/null +++ b/lspaneeditor.h @@ -0,0 +1,30 @@ +#ifndef LSPANEEDITOR_H +#define LSPANEEDITOR_H + +#include <QWidget> +#include <QGridLayout> +#include <QTabWidget> +#include <QMenu> +#include <QToolButton> +#include <QLabel> + +class LSPaneEditor : public QWidget { + Q_OBJECT +public: + explicit LSPaneEditor(QWidget *parent = 0); + +private: + QLabel *m_headingLabel; + QTabWidget *m_tabs; + + QToolButton *m_addChildButton; + QMenu *m_addChildMenu; + QToolButton *m_removeButton; + +signals: + +public slots: + +}; + +#endif // LSPANEEDITOR_H |