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
753f8b5f
Commit
753f8b5f
authored
Oct 26, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Oct 27, 2022
Browse files
Urlbar: Allow configuring whether to show symbols
Not everyone wants it.
parent
c8bbdfd6
Pipeline
#256377
failed with stage
in 11 minutes and 11 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
apps/lib/kateconfigdialog.cpp
View file @
753f8b5f
...
...
@@ -537,6 +537,16 @@ void KateConfigDialog::addBehaviorPage()
m_diffStyle
->
setCurrentIndex
(
cgGeneral
.
readEntry
(
"Diff Show Style"
,
0
));
connect
(
m_diffStyle
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
KateConfigDialog
::
slotChanged
);
buttonGroup
=
new
QGroupBox
(
i18n
(
"Navigation Bar"
),
generalFrame
);
vbox
=
new
QVBoxLayout
(
buttonGroup
);
hlayout
=
new
QHBoxLayout
;
vbox
->
addLayout
(
hlayout
);
layout
->
addWidget
(
buttonGroup
);
m_urlBarShowSymbols
=
new
QCheckBox
(
i18n
(
"Show current symbol in navigation bar"
));
hlayout
->
addWidget
(
m_urlBarShowSymbols
);
m_urlBarShowSymbols
->
setChecked
(
cgGeneral
.
readEntry
(
"Show Symbol In Navigation Bar"
,
true
));
connect
(
m_urlBarShowSymbols
,
&
QCheckBox
::
toggled
,
this
,
&
KateConfigDialog
::
slotChanged
);
layout
->
addStretch
(
1
);
// :-] works correct without autoadd
}
...
...
@@ -794,6 +804,8 @@ void KateConfigDialog::slotApply()
cg
.
writeEntry
(
"Diff Show Style"
,
m_diffStyle
->
currentIndex
());
cg
.
writeEntry
(
"Show Symbol In Navigation Bar"
,
m_urlBarShowSymbols
->
isChecked
());
// patch document modified warn state
const
QList
<
KTextEditor
::
Document
*>
&
docs
=
KateApp
::
self
()
->
documentManager
()
->
documentList
();
for
(
KTextEditor
::
Document
*
doc
:
docs
)
{
...
...
apps/lib/kateconfigdialog.h
View file @
753f8b5f
...
...
@@ -119,6 +119,7 @@ private:
QCheckBox
*
m_tabsScrollable
=
nullptr
;
QCheckBox
*
m_tabsElided
=
nullptr
;
QComboBox
*
m_diffStyle
=
nullptr
;
QCheckBox
*
m_urlBarShowSymbols
=
nullptr
;
Ui
::
SessionConfigWidget
sessionConfigUi
;
...
...
apps/lib/kateurlbar.cpp
View file @
753f8b5f
...
...
@@ -573,6 +573,17 @@ public:
connect
(
qApp
,
&
QApplication
::
paletteChanged
,
this
,
&
BreadCrumbView
::
updatePalette
,
Qt
::
QueuedConnection
);
updatePalette
();
auto
onConfigChanged
=
[
this
]
{
KConfigGroup
cg
(
KSharedConfig
::
openConfig
(),
"General"
);
auto
v
=
cg
.
readEntry
(
"Show Symbol In Navigation Bar"
,
true
);
if
(
v
!=
m_showSymbolCrumb
)
{
m_showSymbolCrumb
=
v
;
Q_EMIT
requestRefresh
();
}
};
connect
(
KateApp
::
self
(),
&
KateApp
::
configurationChanged
,
this
,
onConfigChanged
);
onConfigChanged
();
connect
(
this
,
&
QListView
::
clicked
,
this
,
&
BreadCrumbView
::
onClicked
);
}
...
...
@@ -619,6 +630,10 @@ public:
i
++
;
}
if
(
!
m_showSymbolCrumb
)
{
return
;
}
auto
*
mainWindow
=
m_urlBar
->
viewManager
()
->
mainWindow
();
QPointer
<
QObject
>
lsp
=
mainWindow
->
pluginView
(
QStringLiteral
(
"lspclientplugin"
));
if
(
lsp
)
{
...
...
@@ -946,9 +961,11 @@ private:
QPointer
<
QAbstractItemModel
>
m_symbolsModel
;
QMetaObject
::
Connection
m_connToView
;
// Only one conn at a time
bool
m_isNavigating
=
false
;
bool
m_showSymbolCrumb
=
true
;
Q_SIGNALS:
void
unsetFocus
();
void
requestRefresh
();
};
// TODO: Merge this class back into KateUrlBar
...
...
@@ -995,6 +1012,13 @@ public:
connect
(
m_mainCrumbView
,
&
BreadCrumbView
::
unsetFocus
,
this
,
[
this
]
{
m_urlBar
->
viewManager
()
->
activeView
()
->
setFocus
();
});
connect
(
m_mainCrumbView
,
&
BreadCrumbView
::
requestRefresh
,
this
,
[
this
]
{
auto
vs
=
m_urlBar
->
viewSpace
();
auto
view
=
vs
->
currentView
();
if
(
vs
&&
view
)
{
setUrl
(
view
->
document
());
}
});
connect
(
qApp
,
...
...
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