From cb41dab265ff242a1f3eda351d06fb4d52b501db Mon Sep 17 00:00:00 2001 From: aquiles Date: Mon, 8 Nov 2010 14:19:01 +0100 Subject: [PATCH] Changed: #1150 some layout stuff - widgets should behave better now --- .../georges_editor_qt/data/georges_editor.cfg | 4 +-- .../data/georges_editor_default.cfg | 10 ------- .../georges_editor_qt/src/main_window.cpp | 29 +++++++++---------- .../georges_editor_qt/src/main_window.h | 2 +- .../src/objectviewer_dialog.cpp | 23 +++++---------- 5 files changed, 23 insertions(+), 45 deletions(-) diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor.cfg b/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor.cfg index ebea3b459..d9795704e 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor.cfg +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor.cfg @@ -6,6 +6,4 @@ GraphicsDriver = "OpenGL"; BackgroundColor = { 173, 205, 234 }; -LeveldesignPath = "D:/Dev/Ryzom/code/ryzom/common/data_leveldesign/leveldesign"; -QtWindowState = "%00%00%00%FF%00%00%00%00%FD%00%00%00%03%00%00%00%00%00%00%02%A6%00%00%00%E9%FC%02%00%00%00%01%FB%00%00%00%2A%00C%00G%00e%00o%00r%00g%00e%00s%00D%00i%00r%00T%00r%00e%00e%00D%00i%00a%00l%00o%00g%01%00%00%00%3B%00%00%00%E9%00%00%00t%00%FF%FF%FF%00%00%00%02%00%00%00%00%00%00%00%00%FC%01%00%00%00%01%FB%00%00%00%26%00C%00O%00b%00j%00e%00c%00t%00V%00i%00e%00w%00e%00r%00D%00i%00a%00l%00o%00g%00%00%00%00%00%FF%FF%FF%FF%00%00%00N%00%FF%FF%FF%00%00%00%03%00%00%02%A6%00%00%01c%FC%01%00%00%00%01%FB%00%00%00%22%00C%00G%00e%00o%00r%00g%00e%00s%00L%00o%00g%00D%00i%00a%00l%00o%00g%01%00%00%00%00%00%00%02%A6%00%00%00%5D%00%FF%FF%FF%00%00%00%00%00%00%00%E9%00%00%00%04%00%00%00%04%00%00%00%08%00%00%00%08%FC%00%00%00%01%00%00%00%02%00%00%00%01%FF%FF%FF%FF%01%00%00%00%00%FF%FF%FF%FF%00%00%00%00%00%00%00%00"; -QtWindowGeometry = "%01%D9%D0%CB%00%01%00%00%00%00%00%D6%00%00%00%C0%00%00%03%83%00%00%03%82%00%00%00%DA%00%00%00%DE%00%00%03%7F%00%00%03~%00%00%00%00%00%00"; +LeveldesignPath = "D:/Dev/Ryzom/code/ryzom/common/data_leveldesign/leveldesign"; \ No newline at end of file diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor_default.cfg b/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor_default.cfg index 93343bce4..8ff9f6c7a 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor_default.cfg +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/data/georges_editor_default.cfg @@ -26,16 +26,6 @@ LanguageCode = "en"; // If changes to the config should be saved on exit SaveConfig = 1; - -////////////////////////////////////////////////////////////////////////////// -// Qt //////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -QtStyle = "Cleanlooks"; -QtPalette = 0; -QtWindowState = ""; -QtWindowGeometry = ""; - ////////////////////////////////////////////////////////////////////////////// // Graphics ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp index ed54e5a3e..b6aafe4d8 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.cpp @@ -79,9 +79,7 @@ namespace NLQT // create NeL viewport dock widget _ObjectViewerDialog = new CObjectViewerDialog(this); - //_ObjectViewerDialog->setAllowedAreas(Qt::LeftDockWidgetArea ); - //_ObjectViewerDialog->hide(); - addDockWidget(Qt::LeftDockWidgetArea, _ObjectViewerDialog); + addDockWidget(Qt::LeftDockWidgetArea, _ObjectViewerDialog); createActions(); createMenus(); @@ -95,11 +93,6 @@ namespace NLQT restoreGeometry(settings.value("QtWindowGeometry").toByteArray()); settings.endGroup(); - // setup Qt style and palette from config file - //_originalPalette = QApplication::palette(); - //Modules::config().setAndCallback("QtStyle", CConfigCallback(this, &CMainWindow::cfcbQtStyle)); - //Modules::config().setAndCallback("QtPalette", CConfigCallback(this, &CMainWindow::cfcbQtPalette)); - setWindowIcon(QIcon(":/images/khead.png")); _statusBarTimer = new QTimer(this); @@ -119,9 +112,6 @@ namespace NLQT settings.setValue("QtWindowGeometry", saveGeometry()); settings.endGroup(); - //Modules::config().dropCallback("QtPalette"); - //Modules::config().dropCallback("QtStyle"); - _statusBarTimer->stop(); delete _ObjectViewerDialog; @@ -151,11 +141,11 @@ namespace NLQT if (_treeViewList.isEmpty()) { _emptyView->deleteLater(); - addDockWidget(Qt::TopDockWidgetArea, newView); + tabifyDockWidget(_emptyView, newView); } else { - tabifyDockWidget(_treeViewList.first(),newView); + tabifyDockWidget(_currentView,newView); QTabBar* tb = Modules::mainWin().getTabBar(); if (tb) { @@ -175,6 +165,7 @@ namespace NLQT connect(newView, SIGNAL(modified(bool)), _saveAction, SLOT(setEnabled(bool))); } + QApplication::processEvents(); newView->raise(); } @@ -251,11 +242,17 @@ namespace NLQT { } - void CMainWindow::createEmptyView() + void CMainWindow::createEmptyView(QDockWidget* w) { _emptyView = new CGeorgesTreeViewDialog(this, true); - //_emptyView->setAllowedAreas(Qt::TopDockWidgetArea); - addDockWidget(Qt::TopDockWidgetArea,_emptyView); + if(w) + { + tabifyDockWidget(w, _emptyView); + } + else + { + addDockWidget(Qt::TopDockWidgetArea, _emptyView); + } } void CMainWindow::createActions() diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.h b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.h index e02577894..da08a8efe 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.h +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main_window.h @@ -57,7 +57,7 @@ namespace NLQT CGeorgesTreeViewDialog* getEmptyView() { return _emptyView;} QList& getTreeViewList() { return _treeViewList; } QTabBar* getTabBar(); - void createEmptyView(); + void createEmptyView(QDockWidget* w = 0); private Q_SLOTS: void open(); diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp index ba3aec68b..3137187d2 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/objectviewer_dialog.cpp @@ -47,10 +47,6 @@ namespace NLQT { _ui.setupUi(this); - //widget = new QWidget(dockWidgetContents); - //widget->setObjectName(QString::fromUtf8("widget")); - - _nlw = new QNLWidget(_ui.dockWidgetContents); _nlw->setObjectName(QString::fromUtf8("nlwidget")); _ui.gridLayout->addWidget(_nlw, 0, 0, 1, 1); @@ -93,18 +89,15 @@ namespace NLQT { // called by show() // code assuming visible window needed to init the 3d driver - if (visible != isVisible()) + if (visible) { - if (visible) - { - QDockWidget::setVisible(true); - updateInitialization(true); - } - else - { - updateInitialization(false); - QDockWidget::setVisible(false); - } + QDockWidget::setVisible(true); + updateInitialization(true); + } + else + { + updateInitialization(false); + QDockWidget::setVisible(false); } }