Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
b641e066
Commit
b641e066
authored
Sep 11, 2021
by
Ahmad Samir
Committed by
Kurt Hindenburg
Sep 15, 2021
Browse files
Reimplement KMainWindow::applyMainWindowSettings() to override menubar state
parent
3177c9ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/MainWindow.cpp
View file @
b641e066
...
...
@@ -114,6 +114,15 @@ MainWindow::MainWindow()
KCrash
::
initialize
();
}
void
MainWindow
::
applyMainWindowSettings
(
const
KConfigGroup
&
config
)
{
KMainWindow
::
applyMainWindowSettings
(
config
);
// Override the menubar state from the config file
menuBar
()
->
setVisible
(
_menuBarInitialVisibility
);
_toggleMenuBarAction
->
setChecked
(
_menuBarInitialVisibility
);
}
bool
MainWindow
::
wasWindowGeometrySaved
()
const
{
KSharedConfigPtr
konsoleConfig
=
KSharedConfig
::
openConfig
(
QStringLiteral
(
"konsolerc"
));
...
...
@@ -880,12 +889,6 @@ void MainWindow::showEvent(QShowEvent *event)
// Apply this code on first show only
if
(
_firstShowEvent
)
{
_firstShowEvent
=
false
;
// the initial visibility of menubar should be applied at this last
// moment. Otherwise, the initial visibility will be determined by
// what KMainWindow has automatically stored in konsolerc, but not by
// what users has explicitly configured .
menuBar
()
->
setVisible
(
_menuBarInitialVisibility
);
_toggleMenuBarAction
->
setChecked
(
_menuBarInitialVisibility
);
if
(
!
KonsoleSettings
::
saveGeometryOnExit
()
||
!
wasWindowGeometrySaved
())
{
// Delay resizing to here, so that the other parts of the UI
...
...
src/MainWindow.h
View file @
b641e066
...
...
@@ -172,6 +172,8 @@ public Q_SLOTS:
void
viewFullScreen
(
bool
fullScreen
);
private:
void
applyMainWindowSettings
(
const
KConfigGroup
&
config
)
override
;
/**
* Returns true if the window geometry was previously saved to the
* config file, false otherwise.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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