Allow statusbar to be set on or off in full screen mode as a

preference.
This commit is contained in:
Prannoy Pilligundla 2014-02-25 20:48:56 -05:00 committed by Richard Heck
parent bd79001387
commit 214f7ed262
6 changed files with 38 additions and 1 deletions

View File

@ -1339,6 +1339,14 @@ contributors = [
"6 April 2005",
u"Better support for serbian and serbocroatian"),
contributor(u"Prannoy Pilligundla",
"prannoy.bits () gmail ! com",
"GPL",
"Contribution license",
"m=139332446711707",
"25 February 2014",
u"Full screen statusbar toggling"),
contributor(u"Geoffroy Piroux",
"piroux () fyma ! ucl ! ac ! be",
"",

View File

@ -110,6 +110,7 @@ LexerKeyword lyxrcTags[] = {
{ "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
{ "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
{ "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
{ "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
{ "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
{ "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
{ "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
@ -1237,6 +1238,9 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
case RC_FULL_SCREEN_SCROLLBAR:
lexrc >> full_screen_scrollbar;
break;
case RC_FULL_SCREEN_STATUSBAR:
lexrc >> full_screen_statusbar;
break;
case RC_FULL_SCREEN_TABBAR:
lexrc >> full_screen_tabbar;
break;
@ -1945,6 +1949,15 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
}
if (tag != RC_LAST)
break;
case RC_FULL_SCREEN_STATUSBAR:
if (ignore_system_lyxrc ||
full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
os << "\\fullscreen_statusbar "
<< convert<string>(full_screen_statusbar)
<< '\n';
}
if (tag != RC_LAST)
break;
case RC_FULL_SCREEN_TABBAR:
if (ignore_system_lyxrc ||
full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
@ -3061,6 +3074,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
case LyXRC::RC_FULL_SCREEN_LIMIT:
case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
case LyXRC::RC_FULL_SCREEN_MENUBAR:
case LyXRC::RC_FULL_SCREEN_STATUSBAR:
case LyXRC::RC_FULL_SCREEN_TABBAR:
case LyXRC::RC_FULL_SCREEN_TOOLBARS:
case LyXRC::RC_FULL_SCREEN_WIDTH:

View File

@ -86,6 +86,7 @@ public:
RC_FORWARD_SEARCH_PDF,
RC_FULL_SCREEN_LIMIT,
RC_FULL_SCREEN_SCROLLBAR,
RC_FULL_SCREEN_STATUSBAR,
RC_FULL_SCREEN_TABBAR,
RC_FULL_SCREEN_MENUBAR,
RC_FULL_SCREEN_TOOLBARS,
@ -499,6 +500,8 @@ public:
bool full_screen_tabbar;
/// Toggle menubar in fullscreen mode?
bool full_screen_menubar;
/// Toggle statusbar in fullscreen mode?
bool full_screen_statusbar;
/// Limit the text width?
bool full_screen_limit;
/// Width of limited screen (in pixels) in fullscreen mode

View File

@ -2723,6 +2723,8 @@ PrefEdit::PrefEdit(GuiPreferences * form)
this, SIGNAL(changed()));
connect(toggleScrollbarCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
connect(toggleStatusbarCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
connect(toggleToolbarsCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
}
@ -2743,6 +2745,7 @@ void PrefEdit::apply(LyXRC & rc) const
rc.cursor_width = cursorWidthSB->value();
rc.full_screen_toolbars = toggleToolbarsCB->isChecked();
rc.full_screen_scrollbar = toggleScrollbarCB->isChecked();
rc.full_screen_statusbar = toggleStatusbarCB->isChecked();
rc.full_screen_tabbar = toggleTabbarCB->isChecked();
rc.full_screen_menubar = toggleMenubarCB->isChecked();
rc.full_screen_width = fullscreenWidthSB->value();
@ -2760,6 +2763,7 @@ void PrefEdit::update(LyXRC const & rc)
macroEditStyleCO->setCurrentIndex(rc.macro_edit_style);
cursorWidthSB->setValue(rc.cursor_width);
toggleScrollbarCB->setChecked(rc.full_screen_scrollbar);
toggleScrollbarCB->setChecked(rc.full_screen_statusbar);
toggleToolbarsCB->setChecked(rc.full_screen_toolbars);
toggleTabbarCB->setChecked(rc.full_screen_tabbar);
toggleMenubarCB->setChecked(rc.full_screen_menubar);

View File

@ -3879,6 +3879,7 @@ void GuiView::toggleFullScreen()
setContentsMargins(-2, -2, -2, -2);
saveLayout();
setWindowState(windowState() ^ Qt::WindowFullScreen);
if (lyxrc.full_screen_statusbar)
statusBar()->hide();
if (lyxrc.full_screen_menubar)
menuBar()->hide();

View File

@ -197,6 +197,13 @@
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="toggleStatusbarCB">
<property name="text">
<string>Hide sta&amp;tusbar</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QGroupBox" name="fullscreenLimitGB">
<property name="title">
<string>&amp;Limit text width</string>