Introduce an option to keep the menubar visible in full screen mode.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29858 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2009-05-26 21:41:45 +00:00
parent 65ef3251a8
commit e582d149d4
7 changed files with 34 additions and 3 deletions

View File

@ -2015,6 +2015,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
case LyXRC::RC_SORT_LAYOUTS:
case LyXRC::RC_FULL_SCREEN_LIMIT:
case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
case LyXRC::RC_FULL_SCREEN_MENUBAR:
case LyXRC::RC_FULL_SCREEN_TABBAR:
case LyXRC::RC_FULL_SCREEN_TOOLBARS:
case LyXRC::RC_FULL_SCREEN_WIDTH:

View File

@ -92,6 +92,7 @@ LexerKeyword lyxrcTags[] = {
{ "\\font_encoding", LyXRC::RC_FONT_ENCODING },
{ "\\format", LyXRC::RC_FORMAT },
{ "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
{ "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
{ "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
{ "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
{ "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
@ -315,6 +316,7 @@ void LyXRC::setDefaults()
full_screen_limit = false;
full_screen_toolbars = true;
full_screen_tabbar = true;
full_screen_menubar = true;
full_screen_scrollbar = true;
full_screen_width = 700;
@ -1123,6 +1125,9 @@ int LyXRC::read(Lexer & lexrc)
case RC_FULL_SCREEN_TABBAR:
lexrc >> full_screen_tabbar;
break;
case RC_FULL_SCREEN_MENUBAR:
lexrc >> full_screen_menubar;
break;
case RC_FULL_SCREEN_WIDTH:
lexrc >> full_screen_width;
break;
@ -1771,6 +1776,15 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
}
if (tag != RC_LAST)
break;
case RC_FULL_SCREEN_MENUBAR:
if (ignore_system_lyxrc ||
full_screen_menubar != system_lyxrc.full_screen_menubar) {
os << "\\fullscreen_menubar "
<< convert<string>(full_screen_menubar)
<< '\n';
}
if (tag != RC_LAST)
break;
case RC_FULL_SCREEN_WIDTH:
if (ignore_system_lyxrc ||
full_screen_width != system_lyxrc.full_screen_width) {

View File

@ -82,6 +82,7 @@ public:
RC_FULL_SCREEN_LIMIT,
RC_FULL_SCREEN_SCROLLBAR,
RC_FULL_SCREEN_TABBAR,
RC_FULL_SCREEN_MENUBAR,
RC_FULL_SCREEN_TOOLBARS,
RC_FULL_SCREEN_WIDTH,
RC_GEOMETRY_SESSION,
@ -443,6 +444,8 @@ public:
bool full_screen_scrollbar;
/// Toggle tabbar in fullscreen mode?
bool full_screen_tabbar;
/// Toggle menubar in fullscreen mode?
bool full_screen_menubar;
/// Limit the text width?
bool full_screen_limit;
/// Width of limited screen (in pixels) in fullscreen mode

View File

@ -2160,6 +2160,8 @@ PrefEdit::PrefEdit(GuiPreferences * form)
this, SIGNAL(changed()));
connect(toggleTabbarCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
connect(toggleMenubarCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
connect(toggleScrollbarCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
connect(toggleToolbarsCB, SIGNAL(toggled(bool)),
@ -2181,6 +2183,7 @@ void PrefEdit::apply(LyXRC & rc) const
rc.full_screen_toolbars = toggleToolbarsCB->isChecked();
rc.full_screen_scrollbar = toggleScrollbarCB->isChecked();
rc.full_screen_tabbar = toggleTabbarCB->isChecked();
rc.full_screen_menubar = toggleMenubarCB->isChecked();
rc.full_screen_width = fullscreenWidthSB->value();
rc.full_screen_limit = fullscreenLimitGB->isChecked();
}
@ -2196,6 +2199,7 @@ void PrefEdit::update(LyXRC const & rc)
toggleScrollbarCB->setChecked(rc.full_screen_scrollbar);
toggleToolbarsCB->setChecked(rc.full_screen_toolbars);
toggleTabbarCB->setChecked(rc.full_screen_tabbar);
toggleMenubarCB->setChecked(rc.full_screen_menubar);
fullscreenWidthSB->setValue(rc.full_screen_width);
fullscreenLimitGB->setChecked(rc.full_screen_limit);
}

View File

@ -2282,7 +2282,7 @@ bool GuiView::dispatch(FuncRequest const & cmd)
// Part of automatic menu appearance feature.
if (isFullScreen()) {
if (menuBar()->isVisible())
if (menuBar()->isVisible() && lyxrc.full_screen_menubar)
menuBar()->hide();
if (statusBar()->isVisible())
statusBar()->hide();
@ -2361,7 +2361,8 @@ void GuiView::toggleFullScreen()
saveLayout();
setWindowState(windowState() ^ Qt::WindowFullScreen);
statusBar()->hide();
menuBar()->hide();
if (lyxrc.full_screen_menubar)
menuBar()->hide();
if (lyxrc.full_screen_toolbars) {
ToolbarMap::iterator end = d.toolbars_.end();
for (ToolbarMap::iterator it = d.toolbars_.begin(); it != end; ++it)

View File

@ -447,7 +447,8 @@ void GuiWorkArea::redraw()
void GuiWorkArea::processKeySym(KeySymbol const & key, KeyModifier mod)
{
if (lyx_view_->isFullScreen() && lyx_view_->menuBar()->isVisible()) {
if (lyx_view_->isFullScreen() && lyx_view_->menuBar()->isVisible()
&& lyxrc.full_screen_menubar) {
// FIXME HACK: we should not have to do this here. See related comment
// in GuiView::event() (QEvent::ShortcutOverride)
lyx_view_->menuBar()->hide();

View File

@ -170,6 +170,13 @@
</property>
</spacer>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="toggleMenubarCB" >
<property name="text" >
<string>Hide &amp;menubar</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QCheckBox" name="toggleTabbarCB" >
<property name="text" >