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
df1f3b2e
Commit
df1f3b2e
authored
Jan 18, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Jan 18, 2021
Browse files
Fix size for now
parent
5367c141
Changes
1
Hide whitespace changes
Inline
Side-by-side
kate/katecommandbar.cpp
View file @
df1f3b2e
...
...
@@ -237,26 +237,12 @@ void KateCommandBar::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_treeView
->
sizeHintForRow
(
0
)
==
-
1
?
0
:
m_treeView
->
sizeHintForRow
(
0
);
const
int
width
=
viewMaxSize
.
width
();
const
QSize
viewSize
(
std
::
max
(
300
,
width
),
// never go below this
std
::
min
(
std
::
max
(
rowHeight
*
m_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
);
const
int
xPos
=
std
::
max
(
0
,
(
centralSize
.
width
()
-
view
Max
Size
.
width
())
/
2
);
const
int
yPos
=
std
::
max
(
0
,
(
centralSize
.
height
()
-
view
Max
Size
.
height
())
*
1
/
4
);
const
QPoint
p
(
xPos
,
yPos
);
move
(
p
+
parentWidget
()
->
pos
());
this
->
setFixedSize
(
viewSize
);
QPointer
<
QPropertyAnimation
>
animation
=
new
QPropertyAnimation
(
this
,
"size"
);
animation
->
setDuration
(
150
);
animation
->
setStartValue
(
this
->
size
());
animation
->
setEndValue
(
viewSize
);
animation
->
start
();
this
->
setFixedSize
(
viewMaxSize
);
}
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