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
Multimedia
Kdenlive
Commits
7d73e3a5
Commit
7d73e3a5
authored
Apr 14, 2020
by
Jean-Baptiste Mardelle
Browse files
Improve track default height / header width.
Related to
#629
parent
1de7eb95
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/kdenlivesettings.kcfg
View file @
7d73e3a5
...
...
@@ -239,7 +239,7 @@
<group
name=
"timeline"
>
<entry
name=
"headerwidth"
type=
"Int"
>
<label>
Default width for timeline track headers.
</label>
<default>
14
0
</default>
<default>
0
</default>
</entry>
<entry
name=
"defaultkeyframeinterp"
type=
"Int"
>
<label>
Default interpolation for keyframes.
</label>
...
...
src/mainwindow.cpp
View file @
7d73e3a5
...
...
@@ -1759,12 +1759,14 @@ bool MainWindow::readOptions()
KdenliveSettings
::
setDefaultprojectfolder
(
dir
.
absolutePath
());
}
if
(
KdenliveSettings
::
trackheight
()
==
0
)
{
QFontMetrics
metrics
(
font
());
int
trackHeight
=
2.2
*
metrics
.
height
();
QStyle
*
style
=
qApp
->
style
();
trackHeight
+=
style
->
pixelMetric
(
QStyle
::
PM_ToolBarIconSize
)
+
2
*
style
->
pixelMetric
(
QStyle
::
PM_ToolBarItemMargin
)
+
style
->
pixelMetric
(
QStyle
::
PM_ToolBarItemSpacing
)
+
2
;
KdenliveSettings
::
setTrackheight
(
trackHeight
==
0
?
50
:
trackHeight
);
QFont
ft
=
QFontDatabase
::
systemFont
(
QFontDatabase
::
SmallestReadableFont
);
int
trackHeight
=
qMax
(
50
,
(
int
)
(
3.6
*
QFontInfo
(
ft
).
pixelSize
()
+
6
));
KdenliveSettings
::
setTrackheight
(
trackHeight
);
}
if
(
KdenliveSettings
::
headerwidth
()
==
0
)
{
QFont
ft
=
QFontDatabase
::
systemFont
(
QFontDatabase
::
SmallestReadableFont
);
int
trackWidth
=
qMax
(
50
,
6
*
(
int
)(
1.8
*
QFontInfo
(
ft
).
pixelSize
()
+
2
));
KdenliveSettings
::
setHeaderwidth
(
trackWidth
);
}
bool
firstRun
=
false
;
KConfigGroup
initialGroup
(
config
,
"version"
);
...
...
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