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
5179eaa9
Commit
5179eaa9
authored
May 17, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
May 16, 2021
Browse files
Make quickopen sizing like other hud dialogs
parent
cade655d
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/project/quickdialog.cpp
View file @
5179eaa9
...
...
@@ -93,9 +93,6 @@ void QuickDialog::updateViewGeometry()
if
(
!
m_mainWindow
)
return
;
m_treeView
.
resizeColumnToContents
(
0
);
m_treeView
.
resizeColumnToContents
(
1
);
const
QSize
centralSize
=
m_mainWindow
->
size
();
// width: 2.4 of editor, height: 1/2 of editor
...
...
kate/quickopen/katequickopen.cpp
View file @
5179eaa9
...
...
@@ -396,19 +396,11 @@ void KateQuickOpen::updateViewGeometry()
// width: 2.4 of editor, height: 1/2 of editor
const
QSize
viewMaxSize
(
centralSize
.
width
()
/
2.4
,
centralSize
.
height
()
/
2
);
const
int
rowHeight
=
m_listView
->
sizeHintForRow
(
0
)
==
-
1
?
0
:
m_listView
->
sizeHintForRow
(
0
);
const
int
width
=
viewMaxSize
.
width
();
const
QSize
viewSize
(
std
::
max
(
300
,
width
),
// never go below this
std
::
min
(
std
::
max
(
rowHeight
*
m_base_model
->
rowCount
()
+
2
,
rowHeight
*
6
),
viewMaxSize
.
height
()));
// Position should be central over window
const
int
xPos
=
std
::
max
(
0
,
(
centralSize
.
width
()
-
viewSize
.
width
())
/
2
);
const
int
yPos
=
std
::
max
(
0
,
(
centralSize
.
height
()
-
viewSize
.
height
())
*
1
/
4
);
// fix position and size
const
int
xPos
=
std
::
max
(
0
,
(
centralSize
.
width
()
-
viewMaxSize
.
width
())
/
2
);
const
int
yPos
=
std
::
max
(
0
,
(
centralSize
.
height
()
-
viewMaxSize
.
height
())
*
1
/
4
);
const
QPoint
p
(
xPos
,
yPos
);
move
(
p
+
m_mainWindow
->
pos
());
setFixedSize
(
viewSize
);
setFixedSize
(
viewMaxSize
);
}
Write
Preview
Markdown
is supported
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