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
e11835db
Commit
e11835db
authored
Jan 08, 2021
by
Waqar Ahmed
Browse files
Ensure correct visibility on small sizes
parent
d7f2aa6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
kate/katequickopen.cpp
View file @
e11835db
...
@@ -298,8 +298,7 @@ KateQuickOpenModel::List KateQuickOpen::listMode() const
...
@@ -298,8 +298,7 @@ KateQuickOpenModel::List KateQuickOpen::listMode() const
void
KateQuickOpen
::
updateViewGeometry
()
void
KateQuickOpen
::
updateViewGeometry
()
{
{
QWidget
*
window
=
m_mainWindow
->
window
();
const
QSize
centralSize
=
m_mainWindow
->
size
();
const
QSize
centralSize
=
window
->
size
();
// width: 1/3 of editor, height: 1/2 of editor
// width: 1/3 of editor, height: 1/2 of editor
const
QSize
viewMaxSize
(
centralSize
.
width
()
/
3
,
centralSize
.
height
()
/
2
);
const
QSize
viewMaxSize
(
centralSize
.
width
()
/
3
,
centralSize
.
height
()
/
2
);
...
@@ -311,14 +310,12 @@ void KateQuickOpen::updateViewGeometry()
...
@@ -311,14 +310,12 @@ void KateQuickOpen::updateViewGeometry()
const
int
width
=
viewMaxSize
.
width
();
const
int
width
=
viewMaxSize
.
width
();
const
QSize
viewSize
(
width
,
const
QSize
viewSize
(
width
<
300
?
300
:
width
,
// never go below this
std
::
min
(
std
::
max
(
rowHeight
*
m_base_model
->
rowCount
()
+
2
*
frameWidth
,
rowHeight
*
6
),
viewMaxSize
.
height
()));
std
::
min
(
std
::
max
(
rowHeight
*
m_base_model
->
rowCount
()
+
2
*
frameWidth
,
rowHeight
*
6
),
viewMaxSize
.
height
()));
// Position should be central over the editor area, so map to global from
// Position should be central over the editor area
// parent of central widget since the view is positioned in global coords
const
int
xPos
=
std
::
max
(
0
,
(
centralSize
.
width
()
-
viewSize
.
width
())
/
2
);
const
QPoint
centralWidgetPos
=
window
->
parentWidget
()
?
window
->
mapToGlobal
(
window
->
pos
())
:
window
->
pos
();
const
int
yPos
=
std
::
max
(
0
,
(
centralSize
.
height
()
-
viewSize
.
height
())
*
1
/
4
);
const
int
xPos
=
std
::
max
(
0
,
centralWidgetPos
.
x
()
+
(
centralSize
.
width
()
-
viewSize
.
width
())
/
2
);
const
int
yPos
=
std
::
max
(
0
,
centralWidgetPos
.
y
()
+
(
centralSize
.
height
()
-
viewSize
.
height
())
*
1
/
4
);
move
(
xPos
,
yPos
);
move
(
xPos
,
yPos
);
...
...
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