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
Kate
Commits
26ee7fc8
Commit
26ee7fc8
authored
Jan 10, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Jan 10, 2021
Browse files
Make GotoSymbol look like Quickopen
parent
5d7ad775
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/kate-ctags/gotosymbolwidget.cpp
View file @
26ee7fc8
...
...
@@ -128,7 +128,7 @@ GotoSymbolWidget::GotoSymbolWidget(KTextEditor::MainWindow* mainWindow, KateCTag
m_mainWindow
(
mainWindow
),
oldPos
(
-
1
,
-
1
)
{
setWindowFlags
(
Qt
::
Popup
|
Qt
::
FramelessWindowHint
);
setWindowFlags
(
Qt
::
FramelessWindowHint
);
mode
=
Local
;
...
...
@@ -164,7 +164,7 @@ GotoSymbolWidget::GotoSymbolWidget(KTextEditor::MainWindow* mainWindow, KateCTag
QVBoxLayout
*
layout
=
new
QVBoxLayout
();
layout
->
setSpacing
(
0
);
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
layout
->
setContentsMargins
(
4
,
4
,
4
,
4
);
layout
->
addWidget
(
m_lineEdit
);
layout
->
addWidget
(
m_treeView
);
setLayout
(
layout
);
...
...
@@ -293,22 +293,15 @@ void GotoSymbolWidget::updateViewGeometry()
QWidget
*
window
=
m_mainWindow
->
window
();
const
QSize
centralSize
=
window
->
size
();
// width:
1/3
of editor, height: 1/2 of editor
const
QSize
viewMaxSize
(
centralSize
.
width
()
/
3
,
centralSize
.
height
()
/
2
);
// width:
2.4
of editor, height: 1/2 of editor
const
QSize
viewMaxSize
(
centralSize
.
width
()
/
2.4
,
centralSize
.
height
()
/
2
);
const
int
rowHeight
=
m_treeView
->
sizeHintForRow
(
0
)
==
-
1
?
0
:
m_treeView
->
sizeHintForRow
(
0
);
int
frameWidth
=
this
->
frameSize
().
width
();
frameWidth
=
frameWidth
>
centralSize
.
width
()
/
3
?
centralSize
.
width
()
/
3
:
frameWidth
;
frameWidth
=
frameWidth
>
centralSize
.
width
()
/
2.4
?
centralSize
.
width
()
/
2.4
:
frameWidth
;
int
width
=
0
;
// disable dynamic width in case there are too many rows
if
(
mode
==
Global
&&
m_globalSymbolsModel
->
rowCount
()
>
3000
)
{
width
=
viewMaxSize
.
width
();
}
else
{
width
=
std
::
min
(
m_treeView
->
sizeHintWidth
()
+
2
*
frameWidth
+
m_treeView
->
verticalScrollBar
()
->
width
(),
viewMaxSize
.
width
());
}
const
int
width
=
viewMaxSize
.
width
();
const
int
rowCount
=
mode
==
Global
?
m_globalSymbolsModel
->
rowCount
()
:
m_symbolsModel
->
rowCount
();
...
...
addons/kate-ctags/kate_ctags_view.cpp
View file @
26ee7fc8
...
...
@@ -134,13 +134,11 @@ KateCTagsView::KateCTagsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
openLocal
->
setText
(
i18n
(
"Go To Local Symbol"
));
actionCollection
()
->
setDefaultShortcut
(
openLocal
,
Qt
::
CTRL
|
Qt
::
ALT
|
Qt
::
Key_P
);
connect
(
openLocal
,
&
QAction
::
triggered
,
this
,
&
KateCTagsView
::
showSymbols
);
m_gotoSymbWidget
->
addAction
(
openLocal
);
auto
openGlobal
=
actionCollection
()
->
addAction
(
QStringLiteral
(
"open_global_gts"
));
openGlobal
->
setText
(
i18n
(
"Go To Global Symbol"
));
actionCollection
()
->
setDefaultShortcut
(
openGlobal
,
Qt
::
CTRL
|
Qt
::
SHIFT
|
Qt
::
Key_P
);
connect
(
openGlobal
,
&
QAction
::
triggered
,
this
,
&
KateCTagsView
::
showGlobalSymbols
);
m_gotoSymbWidget
->
addAction
(
openLocal
);
connect
(
m_ctagsUi
.
inputEdit
,
&
QLineEdit
::
textChanged
,
this
,
&
KateCTagsView
::
startEditTmr
);
...
...
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