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
Utilities
Kate
Commits
7cc33208
Commit
7cc33208
authored
Sep 17, 2022
by
Christoph Cullmann
🍨
Committed by
Eric Armbruster
Sep 19, 2022
Browse files
show welcome view if last view closed
parent
3d87ee0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
apps/lib/katemainwindow.cpp
View file @
7cc33208
...
...
@@ -180,12 +180,7 @@ KateMainWindow::KateMainWindow(KConfig *sconfig, const QString &sgroup)
}
// ensure we have the welcome view if no active view is there
// delay this after initialisation
QTimer
::
singleShot
(
0
,
this
,
[
this
]()
{
if
(
activeView
())
return
;
addWidget
(
new
KateWelcomeView
(
m_viewManager
->
activeViewSpace
(),
nullptr
));
});
showWelcomeViewIfNeeded
();
}
KateMainWindow
::~
KateMainWindow
()
...
...
@@ -1500,3 +1495,13 @@ void KateMainWindow::addRecentOpenedFile(const QUrl &url)
// to the global "Recent Document Menu", see bug 420504
// KRecentDocument::add(url);
}
void
KateMainWindow
::
showWelcomeViewIfNeeded
()
{
// delay the creation, e.g. used on startup
QTimer
::
singleShot
(
0
,
this
,
[
this
]()
{
if
(
activeView
())
return
;
addWidget
(
new
KateWelcomeView
(
m_viewManager
->
activeViewSpace
(),
nullptr
));
});
}
apps/lib/katemainwindow.h
View file @
7cc33208
...
...
@@ -138,6 +138,12 @@ public:
*/
void
saveOptions
();
/**
* Trigger creation of welcome view via timer.
* Will do nothing if we have some view around when the timer triggers.
*/
void
showWelcomeViewIfNeeded
();
private:
/**
* Setup actions which pointers are needed already in setupMainWindow
...
...
apps/lib/kateviewmanager.cpp
View file @
7cc33208
...
...
@@ -1077,7 +1077,11 @@ void KateViewManager::onViewSpaceEmptied(KateViewSpace *vs)
// got empty, remove it
if
(
m_viewSpaceList
.
size
()
>
1
)
{
removeViewSpace
(
vs
);
return
;
}
// else we want to trigger showing of the welcome view
m_mainWindow
->
showWelcomeViewIfNeeded
();
}
void
KateViewManager
::
setShowUrlNavBar
(
bool
show
)
...
...
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