Commit 16320324 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Improve track default height / header width.

Related to #629
parent 9a2ad8a3
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
<group name="timeline"> <group name="timeline">
<entry name="headerwidth" type="Int"> <entry name="headerwidth" type="Int">
<label>Default width for timeline track headers.</label> <label>Default width for timeline track headers.</label>
<default>140</default> <default>0</default>
</entry> </entry>
<entry name="defaultkeyframeinterp" type="Int"> <entry name="defaultkeyframeinterp" type="Int">
<label>Default interpolation for keyframes.</label> <label>Default interpolation for keyframes.</label>
......
...@@ -1759,12 +1759,14 @@ bool MainWindow::readOptions() ...@@ -1759,12 +1759,14 @@ bool MainWindow::readOptions()
KdenliveSettings::setDefaultprojectfolder(dir.absolutePath()); KdenliveSettings::setDefaultprojectfolder(dir.absolutePath());
} }
if (KdenliveSettings::trackheight() == 0) { if (KdenliveSettings::trackheight() == 0) {
QFontMetrics metrics(font()); QFont ft = QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont);
int trackHeight = 2.2 * metrics.height(); int trackHeight = qMax(50, (int) (3.6 * QFontInfo(ft).pixelSize() + 6));
QStyle *style = qApp->style(); KdenliveSettings::setTrackheight(trackHeight);
trackHeight += style->pixelMetric(QStyle::PM_ToolBarIconSize) + 2 * style->pixelMetric(QStyle::PM_ToolBarItemMargin) + }
style->pixelMetric(QStyle::PM_ToolBarItemSpacing) + 2; if (KdenliveSettings::headerwidth() == 0) {
KdenliveSettings::setTrackheight(trackHeight == 0 ? 50 : trackHeight); QFont ft = QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont);
int trackWidth = qMax(50, 6 * (int)(1.8 * QFontInfo(ft).pixelSize() + 2));
KdenliveSettings::setHeaderwidth(trackWidth);
} }
bool firstRun = false; bool firstRun = false;
KConfigGroup initialGroup(config, "version"); KConfigGroup initialGroup(config, "version");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment