Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kontact
Commits
b42ebb06
Commit
b42ebb06
authored
Oct 25, 2022
by
Laurent Montel
Browse files
Fix bug 431308: Hide Menu by Ctrl+M
BUG: 431308
FIXED-IN: 5.22.0
parent
f1a27012
Pipeline
#255160
passed with stage
in 1 minute and 19 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kontact.kcfg
View file @
b42ebb06
...
...
@@ -44,6 +44,11 @@
</entry>
<entry
type=
"String"
name=
"LastVersionSeen"
hidden=
"true"
>
</entry>
<entry
key=
"ShowMenuBar"
type=
"Bool"
>
<default>
true
</default>
<!-- label and whatsthis are already provided by KStandardAction::showMenubar -->
<label></label>
</entry>
</group>
</kcfg>
src/kontactui.rc
View file @
b42ebb06
<?xml version="1.0"?>
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui
version=
"42
1
"
name=
"kontact"
>
<gui
version=
"42
2
"
name=
"kontact"
>
<MenuBar>
<Menu
name=
"file"
noMerge=
"1"
>
<text>
&
File
</text>
...
...
@@ -19,6 +19,7 @@
<Menu
noMerge=
"1"
name=
"settings"
>
<text>
&
Settings
</text>
<Merge
name=
"StandardToolBarMenuHandler"
/>
<Action
name=
"options_show_menubar"
group=
"settings_configure"
/>
<Merge/>
<Separator/>
<Action
name=
"colorscheme_menu"
/>
...
...
src/mainwindow.cpp
View file @
b42ebb06
...
...
@@ -46,6 +46,7 @@ using namespace Kontact;
#include
<KSqueezedTextLabel>
#include
<KStandardAction>
#include
<KSycoca>
#include
<KToggleAction>
#include
<KToolBar>
#include
<KWindowConfig>
#include
<KXMLGUIFactory>
...
...
@@ -97,6 +98,8 @@ MainWindow::MainWindow()
KConfigGroup
grp
(
KSharedConfig
::
openConfig
(),
"MainWindow"
);
KWindowConfig
::
restoreWindowSize
(
windowHandle
(),
grp
);
setAutoSaveSettings
();
mShowMenuBarAction
->
setChecked
(
Prefs
::
self
()
->
showMenuBar
());
slotToggleMenubar
(
true
);
}
void
MainWindow
::
initGUI
()
...
...
@@ -317,6 +320,29 @@ void MainWindow::setupActions()
auto
manager
=
new
KColorSchemeManager
(
this
);
actionCollection
()
->
addAction
(
QStringLiteral
(
"colorscheme_menu"
),
manager
->
createSchemeSelectionMenu
(
this
));
mShowMenuBarAction
=
KStandardAction
::
showMenubar
(
this
,
&
MainWindow
::
slotToggleMenubar
,
actionCollection
());
}
void
MainWindow
::
slotToggleMenubar
(
bool
dontShowWarning
)
{
if
(
menuBar
())
{
if
(
mShowMenuBarAction
->
isChecked
())
{
menuBar
()
->
show
();
}
else
{
if
(
!
dontShowWarning
&&
(
!
toolBar
()
->
isVisible
()
/* || !toolBar()->actions().contains(mHamburgerMenu)*/
))
{
const
QString
accel
=
mShowMenuBarAction
->
shortcut
().
toString
();
KMessageBox
::
information
(
this
,
i18n
(
"<qt>This will hide the menu bar completely."
" You can show it again by typing %1.</qt>"
,
accel
),
i18n
(
"Hide menu bar"
),
QStringLiteral
(
"HideMenuBarWarning"
));
}
menuBar
()
->
hide
();
}
Prefs
::
self
()
->
setShowMenuBar
(
mShowMenuBarAction
->
isChecked
());
}
}
void
MainWindow
::
slotFullScreen
(
bool
t
)
...
...
src/mainwindow.h
View file @
b42ebb06
...
...
@@ -22,10 +22,10 @@ class QSplitter;
class
QStackedWidget
;
class
IntroductionWebEngineView
;
class
KToggleFullScreenAction
;
class
KToggleAction
;
using
PluginList
=
QList
<
KontactInterface
::
Plugin
*>
;
using
ActionPluginList
=
QList
<
QAction
*>
;
namespace
Kontact
{
class
SidePaneBase
;
...
...
@@ -103,6 +103,8 @@ private Q_SLOTS:
private:
void
setHelpText
(
QAction
*
action
,
const
QString
&
text
);
void
slotFullScreen
(
bool
t
);
void
slotToggleMenubar
(
bool
dontShowWarning
);
QFrame
*
mTopWidget
=
nullptr
;
QSplitter
*
mSplitter
=
nullptr
;
...
...
@@ -129,6 +131,7 @@ private:
int
mSaveSideBarWidth
=
10
;
QAction
*
mShowHideAction
=
nullptr
;
KToggleFullScreenAction
*
mShowFullScreenAction
=
nullptr
;
KToggleAction
*
mShowMenuBarAction
=
nullptr
;
};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment