summaryrefslogtreecommitdiff
path: root/lslayoutwindow.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-08-18 04:15:43 +0200
committerTreeki <treeki@gmail.com>2012-08-18 04:15:43 +0200
commit56bf2bd3ff73fc3cd86dcb4f4cd1e42016522bea (patch)
tree04d902dbc239a5dc98c1582f40dccc4e5128d161 /lslayoutwindow.cpp
parent3e0523101382ad5730086e3b031303a7a68b01d6 (diff)
downloadLayoutStudio-56bf2bd3ff73fc3cd86dcb4f4cd1e42016522bea.tar.gz
LayoutStudio-56bf2bd3ff73fc3cd86dcb4f4cd1e42016522bea.zip
you can now view and edit basic pane settings! exciting, right?
Diffstat (limited to 'lslayoutwindow.cpp')
-rw-r--r--lslayoutwindow.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/lslayoutwindow.cpp b/lslayoutwindow.cpp
index a164dd9..d19e397 100644
--- a/lslayoutwindow.cpp
+++ b/lslayoutwindow.cpp
@@ -12,7 +12,7 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q
m_layoutName = layoutName;
m_package = pkg;
-
+ m_loadingSettings = true;
m_tabWidget = new QTabWidget(this);
setCentralWidget(m_tabWidget);
@@ -91,6 +91,7 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q
m_sceneGraph->setDropIndicatorShown(true);
m_sceneGraph->setModel(new LSSceneModel(m_layout, this));
m_sceneGraph->expandAll();
+ connect(m_sceneGraph->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(selectedPaneChanged(QModelIndex,QModelIndex)));
setWindowTitle(m_layoutName);
@@ -105,8 +106,12 @@ LSLayoutWindow::LSLayoutWindow(LYTPackageBase *pkg, const QString &layoutName, Q
Qt::WindowMinimizeButtonHint);
m_renderer->show();
+ connect(m_paneEditor, SIGNAL(mustRedrawLayout()), m_renderer, SLOT(updateGL()));
+
// clean up here
setAttribute(Qt::WA_DeleteOnClose);
+
+ m_loadingSettings = false;
}
LSLayoutWindow::~LSLayoutWindow() {
@@ -116,11 +121,21 @@ LSLayoutWindow::~LSLayoutWindow() {
}
+void LSLayoutWindow::selectedPaneChanged(const QModelIndex &current, const QModelIndex &previous) {
+ LYTPane *pane = (LYTPane*)current.internalPointer();
+ m_paneEditor->setPane(pane);
+}
+
+
void LSLayoutWindow::handleWidthChanged(double v) {
m_layout->width = v;
+ if (!m_loadingSettings)
+ m_renderer->updateGL();
}
void LSLayoutWindow::handleHeightChanged(double v) {
m_layout->height = v;
+ if (!m_loadingSettings)
+ m_renderer->updateGL();
}