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());
if (isFullScreen()) {
showNormal();
for (int i = 0; i != d.splitter_->count(); ++i)
d.tabWorkArea(i)->setFullScreen(false);
#if QT_VERSION >= 0x040300
setContentsMargins(0, 0, 0, 0);
#endif
for (int i = 0; i != d.splitter_->count(); ++i)
d.tabWorkArea(i)->setFullScreen(false);
showNormal();
menuBar()->show();
statusBar()->show();
if (lyxrc.full_screen_scrollbar && d.current_work_area_)
d.current_work_area_->
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
} 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)
d.tabWorkArea(i)->setFullScreen(true);
#if QT_VERSION >= 0x040300
setContentsMargins(-2, -2, -2, -2);
#endif
showFullScreen();
statusBar()->hide();
menuBar()->hide();
}
}

View File

@ -259,8 +259,15 @@ void GuiWorkArea::close()
void GuiWorkArea::setFullScreen(bool full_screen)
{
setFrameStyle(QFrame::NoFrame);
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);
}
}