Try to fix Windows default track size

Related to #629
parent e55ef934
......@@ -1758,14 +1758,15 @@ bool MainWindow::readOptions()
dir.mkpath(QStringLiteral("."));
KdenliveSettings::setDefaultprojectfolder(dir.absolutePath());
}
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 (KdenliveSettings::trackheight() == 0) {
QFont ft = QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont);
int trackHeight = qMax(50, (int) (3.6 * QFontInfo(ft).pixelSize() + 6));
int trackHeight = qMax(50, 2 * baseUnit + 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));
int trackWidth = qMax(50, 6 * (baseUnit + 2));
KdenliveSettings::setHeaderwidth(trackWidth);
}
bool firstRun = false;
......
......@@ -52,8 +52,6 @@ Item {
id: levelsContainer
width: recContainer.width - recbutton.width - 6
height: recbutton.height
border.color: "#000000"
border.width: 1
color: Qt.lighter(activePalette.base)
Repeater {
model: audiorec.levels.length == 0 ? 2 : audiorec.levels.length
......@@ -120,6 +118,13 @@ Item {
x: parent.width * (index + 1) / 9
}
}
Rectangle {
// main frame
anchors.fill: parent
color: "#00000000"
border.color: "#000000"
border.width: 1
}
}
}
}
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