Fullscreen support: Small cleanups. Still not sure why the scrollbar is not properly updated...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23075 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-20 14:27:52 +00:00
parent 2a2f4ee163
commit 42d707773d
2 changed files with 13 additions and 12 deletions

View File

@ -1868,29 +1868,23 @@ void GuiView::lfunUiToggle(FuncRequest const & cmd)
d.toolbars_->toggleFullScreen(!isFullScreen()); d.toolbars_->toggleFullScreen(!isFullScreen());
if (isFullScreen()) { if (isFullScreen()) {
showNormal(); for (int i = 0; i != d.splitter_->count(); ++i)
d.tabWorkArea(i)->setFullScreen(false);
#if QT_VERSION >= 0x040300 #if QT_VERSION >= 0x040300
setContentsMargins(0, 0, 0, 0); setContentsMargins(0, 0, 0, 0);
#endif #endif
for (int i = 0; i != d.splitter_->count(); ++i) showNormal();
d.tabWorkArea(i)->setFullScreen(false);
menuBar()->show(); menuBar()->show();
statusBar()->show(); statusBar()->show();
if (lyxrc.full_screen_scrollbar && d.current_work_area_)
d.current_work_area_->
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
} else { } else {
if (lyxrc.full_screen_scrollbar && d.current_work_area_)
d.current_work_area_->
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
statusBar()->hide();
menuBar()->hide();
for (int i = 0; i != d.splitter_->count(); ++i) for (int i = 0; i != d.splitter_->count(); ++i)
d.tabWorkArea(i)->setFullScreen(true); d.tabWorkArea(i)->setFullScreen(true);
#if QT_VERSION >= 0x040300 #if QT_VERSION >= 0x040300
setContentsMargins(-2, -2, -2, -2); setContentsMargins(-2, -2, -2, -2);
#endif #endif
showFullScreen(); showFullScreen();
statusBar()->hide();
menuBar()->hide();
} }
} }

View File

@ -259,8 +259,15 @@ void GuiWorkArea::close()
void GuiWorkArea::setFullScreen(bool full_screen) void GuiWorkArea::setFullScreen(bool full_screen)
{ {
setFrameStyle(QFrame::NoFrame);
buffer_view_->setFullScreen(full_screen); buffer_view_->setFullScreen(full_screen);
if (full_screen) {
setFrameStyle(QFrame::NoFrame);
if (lyxrc.full_screen_scrollbar)
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
} else {
setFrameStyle(QFrame::Box);
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
}
} }