From: <hep...@us...> - 2011-03-10 17:43:43
|
Revision: 1290 http://qterm.svn.sourceforge.net/qterm/?rev=1290&view=rev Author: hephooey Date: 2011-03-10 17:43:37 +0000 (Thu, 10 Mar 2011) Log Message: ----------- Dirty hack to hide tabbar in fullscreen mode I do not know if there is an easy way to handle this, the tabbar cannot be hided in the tabbed view mode, so in the fullscreen mode, switch to the subwindow mode to hide the tabbar. During the switch, I need to remaximize the subwindow. This somehow triggered an infinite event loop in the code when there are more than one subwindow. I also need to set the frameless flag of the subwindows. In the long future we probably should subclass the QMdiArea class to hide the tabbar, this will also open the possibility to put the download progress bar to the right corner of the tabbar. Modified Paths: -------------- trunk/qterm-qt4/src/qtermframe.cpp trunk/qterm-qt4/src/qtermscreen.cpp Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2011-03-10 17:43:33 UTC (rev 1289) +++ trunk/qterm-qt4/src/qtermframe.cpp 2011-03-10 17:43:37 UTC (rev 1290) @@ -661,12 +661,27 @@ mainToolBar->hide(); terminalToolBar->hide(); keyToolBar->hide(); + ansiToolBar->hide(); + //mdiArea->findChild<QTabBar*>()->hide(); + QList<QMdiSubWindow *> windows = mdiArea->subWindowList(); + foreach (QMdiSubWindow * window, windows) { + window->setWindowFlags(Qt::FramelessWindowHint); + } showFullScreen(); + mdiArea->setViewMode(QMdiArea::SubWindowView); + mdiArea->activeSubWindow()->showMaximized(); } else { restoreGeometry(Global::instance()->loadGeometry()); restoreState(Global::instance()->loadState()); emit scrollChanged(); + QList<QMdiSubWindow *> windows = mdiArea->subWindowList(); + foreach (QMdiSubWindow * window, windows) { + window->setWindowFlags(Qt::SubWindow); + } showNormal(); + mdiArea->setViewMode(QMdiArea::TabbedView); + mdiArea->activeSubWindow()->showMaximized(); + updateTabBar(); } actionFullscreen->setChecked(isFullScreen); Modified: trunk/qterm-qt4/src/qtermscreen.cpp =================================================================== --- trunk/qterm-qt4/src/qtermscreen.cpp 2011-03-10 17:43:33 UTC (rev 1289) +++ trunk/qterm-qt4/src/qtermscreen.cpp 2011-03-10 17:43:37 UTC (rev 1290) @@ -132,6 +132,10 @@ // focus event received void Screen::focusInEvent(QFocusEvent *) { + // FIXME: Somehow there is an inf loop without this. + if (Global::instance()->isFullScreen()) { + return; + } if (m_pWindow->isMaximized()) { m_pWindow->showNormal(); m_pWindow->showMaximized(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |