diff options
author | Florian Jung <flo@windfisch.org> | 2011-08-23 17:03:11 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-08-23 17:03:11 +0000 |
commit | 71a196c4e2db4bf5ab618b13c4e21f8d15106298 (patch) | |
tree | dcee6a81ee598c7505cbedb5131beb6d742a8607 /muse2/muse/cobject.cpp | |
parent | c74147c3993859918450a31545dbaa0d2e654f5c (diff) |
fixed sizing, resizing and minimum size stuff
the actual effect of this is that windows->tile now works properly
Diffstat (limited to 'muse2/muse/cobject.cpp')
-rw-r--r-- | muse2/muse/cobject.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index a3b62a80..e25cefdb 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -69,6 +69,8 @@ TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlag subwinAction->setChecked(isMdiWin()); shareAction->setChecked(_sharesToolsAndMenu); fullscreenAction->setEnabled(!isMdiWin()); + + resize(_widthInit[_type], _heightInit[_type]); } @@ -187,10 +189,13 @@ void TopWin::setIsMdiWin(bool val) if (!isMdiWin()) { _savedToolbarState = saveState(); - + int width_temp=width(); + int height_temp=height(); bool vis=isVisible(); + QMdiSubWindow* subwin = createMdiWrapper(); muse->addMdiSubWindow(subwin); + subwin->resize(width_temp, height_temp); subwin->setVisible(vis); this->QMainWindow::show(); //bypass the delegation to the subwin @@ -211,13 +216,17 @@ void TopWin::setIsMdiWin(bool val) { if (isMdiWin()) { + int width_temp=width(); + int height_temp=height(); bool vis=isVisible(); + QMdiSubWindow* mdisubwin_temp=mdisubwin; mdisubwin=NULL; setParent(NULL); mdisubwin_temp->hide(); delete mdisubwin_temp; + resize(width_temp, height_temp); setVisible(vis); if (_sharesToolsAndMenu == _sharesWhenSubwin[_type]) @@ -464,3 +473,16 @@ void TopWin::setFullscreen(bool val) else showNormal(); } + +void TopWin::resize(int w, int h) +{ + QMainWindow::resize(w,h); + + if (isMdiWin()) + mdisubwin->resize(w,h); +} + +void TopWin::resize(const QSize& s) +{ + resize(s.width(), s.height()); +} |