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
eb28b1cc
Commit
eb28b1cc
authored
Aug 07, 2022
by
Ahmad Samir
Committed by
Christoph Cullmann
Aug 07, 2022
Browse files
De-dupblicate some code
parent
88597864
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/lib/katemdi.cpp
View file @
eb28b1cc
...
...
@@ -636,6 +636,15 @@ bool Sidebar::isCollapsed()
return
m_splitter
->
sizes
().
at
(
ownSplitIndex
)
==
0
;
}
void
Sidebar
::
showRaisedTabs
()
{
for
(
const
auto
&
[
wid
,
id
,
_
]
:
m_toolviewInfo
)
{
if
(
isTabRaised
(
id
))
{
wid
->
show
();
}
}
}
void
Sidebar
::
handleCollapse
(
int
pos
,
int
index
)
{
Q_UNUSED
(
pos
);
...
...
@@ -671,11 +680,7 @@ void Sidebar::handleCollapse(int pos, int index)
m_isPreviouslyCollapsed
=
true
;
}
else
if
(
m_isPreviouslyCollapsed
&&
m_resizePlaceholder
->
isVisible
())
{
// If the sidebar is manually expanded again, we need to show the activated plugin-views again
for
(
const
auto
&
[
wid
,
id
,
_
]
:
m_toolviewInfo
)
{
if
(
isTabRaised
(
id
))
{
wid
->
show
();
}
}
showRaisedTabs
();
m_resizePlaceholder
->
hide
();
m_isPreviouslyCollapsed
=
false
;
...
...
@@ -705,11 +710,7 @@ void Sidebar::expandSidebar(ToolView *widget)
// when the sidebar was collapsed, the activated widgets were hidden, so we need to show them again
// see Sidebar::handleCollapse
for
(
const
auto
&
[
wid
,
id
,
_
]
:
m_toolviewInfo
)
{
if
(
isTabRaised
(
id
))
{
wid
->
show
();
}
}
showRaisedTabs
();
m_resizePlaceholder
->
hide
();
m_isPreviouslyCollapsed
=
false
;
...
...
apps/lib/katemdi.h
View file @
eb28b1cc
...
...
@@ -266,6 +266,8 @@ private Q_SLOTS:
void
buttonPopupActivate
(
QAction
*
);
private:
void
showRaisedTabs
();
enum
ActionIds
{
PersistAction
=
10
,
HideButtonAction
=
11
,
...
...
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