summaryrefslogtreecommitdiffstats
path: root/src/library/library.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/library.cpp')
-rw-r--r--src/library/library.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/library/library.cpp b/src/library/library.cpp
index dec5cc5b3a..59c528c37c 100644
--- a/src/library/library.cpp
+++ b/src/library/library.cpp
@@ -522,8 +522,17 @@ QStringList Library::getDirs() {
}
void Library::setFont(const QFont& font) {
+ QFontMetrics currMetrics(m_trackTableFont);
+ QFontMetrics newMetrics(font);
+ double currFontHeight = currMetrics.height();
+ double newFontHeight = newMetrics.height();
+
m_trackTableFont = font;
emit setTrackTableFont(font);
+ // adapt the previous font heigh/row height ratio
+ int scaledRowHeight = static_cast<int>(std::round(
+ (newFontHeight / currFontHeight) * m_iTrackTableRowHeight));
+ setRowHeight(scaledRowHeight);
}
void Library::setRowHeight(int rowHeight) {