Reset track height to sane value on reset default values in settings dialog

parent 1186f306
......@@ -70,7 +70,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QMap<QString, QString> mappable_a
{
KdenliveSettings::setV4l_format(0);
QWidget *p1 = new QWidget;
QFontInfo ftInfo(font());
m_configMisc.setupUi(p1);
m_page1 = addPage(p1, i18n("Misc"));
m_page1->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
......@@ -116,7 +115,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QMap<QString, QString> mappable_a
m_configTimeline.setupUi(p3);
m_page3 = addPage(p3, i18n("Timeline"));
m_page3->setIcon(QIcon::fromTheme(QStringLiteral("video-display")));
m_configTimeline.kcfg_trackheight->setMinimum(ftInfo.pixelSize() * 1.5);
QWidget *p2 = new QWidget;
m_configEnv.setupUi(p2);
......@@ -865,6 +863,21 @@ void KdenliveSettingsDialog::updateSettings()
m_configEnv.ffprobeurl->setText(KdenliveSettings::ffprobepath());
}
if (m_configTimeline.kcfg_trackheight->value() == 0) {
QFont ft = QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont);
// Default unit for timeline.qml objects size
int baseUnit = qMax(28, (int) (QFontInfo(ft).pixelSize() * 1.8 + 0.5));
int trackHeight = qMax(50, (int) (2.2 * baseUnit + 6));
m_configTimeline.kcfg_trackheight->setValue(trackHeight);
} else {
QFont ft = QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont);
// Default unit for timeline.qml objects size
int baseUnit = qMax(28, (int) (QFontInfo(ft).pixelSize() * 1.8 + 0.5));
if (m_configTimeline.kcfg_trackheight->value() < baseUnit) {
m_configTimeline.kcfg_trackheight->setValue(baseUnit);
}
}
bool resetConsumer = false;
bool fullReset = false;
bool updateCapturePath = false;
......
......@@ -87,7 +87,7 @@
<item>
<widget class="QSpinBox" name="kcfg_trackheight">
<property name="minimum">
<number>10</number>
<number>0</number>
</property>
<property name="maximum">
<number>999</number>
......
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