[vlc-commits] qml: use FontMetrics instead TextMetrics to compute lineHeight

Pierre Lamot git at videolan.org
Mon Sep 21 10:23:46 CEST 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Aug 26 17:40:11 2020 +0200| [0eda6e242e681b2cd394c337058e867bcba89f26] | committer: Pierre Lamot

qml: use FontMetrics instead TextMetrics to compute lineHeight

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0eda6e242e681b2cd394c337058e867bcba89f26
---

 modules/gui/qt/style/VLCStyle.qml | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/modules/gui/qt/style/VLCStyle.qml b/modules/gui/qt/style/VLCStyle.qml
index 0a1b046da4..590bba9d68 100644
--- a/modules/gui/qt/style/VLCStyle.qml
+++ b/modules/gui/qt/style/VLCStyle.qml
@@ -23,14 +23,14 @@ Item {
 
     readonly property real scale: mainInterface.intfScaleFactor
 
-    TextMetrics { id: fontMetrics_xxsmall; font.pixelSize: dp(6, scale);  text: "lq"}
-    TextMetrics { id: fontMetrics_xsmall;  font.pixelSize: dp(8, scale);  text: "lq"}
-    TextMetrics { id: fontMetrics_small;   font.pixelSize: dp(10, scale); text: "lq"}
-    TextMetrics { id: fontMetrics_normal;  font.pixelSize: dp(12, scale); text: "lq"}
-    TextMetrics { id: fontMetrics_large;   font.pixelSize: dp(14, scale); text: "lq"}
-    TextMetrics { id: fontMetrics_xlarge;  font.pixelSize: dp(16, scale); text: "lq"}
-    TextMetrics { id: fontMetrics_xxlarge;  font.pixelSize: dp(20, scale); text: "lq"}
-    TextMetrics { id: fontMetrics_xxxlarge;  font.pixelSize: dp(30, scale); text: "lq"}
+    FontMetrics { id: fontMetrics_xxsmall;  font.pixelSize: dp(6, scale);  }
+    FontMetrics { id: fontMetrics_xsmall;   font.pixelSize: dp(8, scale);  }
+    FontMetrics { id: fontMetrics_small;    font.pixelSize: dp(10, scale); }
+    FontMetrics { id: fontMetrics_normal;   font.pixelSize: dp(12, scale); }
+    FontMetrics { id: fontMetrics_large;    font.pixelSize: dp(14, scale); }
+    FontMetrics { id: fontMetrics_xlarge;   font.pixelSize: dp(16, scale); }
+    FontMetrics { id: fontMetrics_xxlarge;  font.pixelSize: dp(20, scale); }
+    FontMetrics { id: fontMetrics_xxxlarge; font.pixelSize: dp(30, scale); }
 
     property alias self: vlc_style
 
@@ -54,13 +54,13 @@ Item {
     property int fontSize_xxlarge: fontMetrics_xxlarge.font.pixelSize
     property int fontSize_xxxlarge: fontMetrics_xxxlarge.font.pixelSize
 
-    property int fontHeight_xsmall: Math.ceil(fontMetrics_xsmall.height)
-    property int fontHeight_small:  Math.ceil(fontMetrics_small.height)
-    property int fontHeight_normal: Math.ceil(fontMetrics_normal.height)
-    property int fontHeight_large:  Math.ceil(fontMetrics_large.height)
-    property int fontHeight_xlarge: Math.ceil(fontMetrics_xlarge.height)
-    property int fontHeight_xxlarge: Math.ceil(fontMetrics_xxlarge.height)
-    property int fontHeight_xxxlarge: Math.ceil(fontMetrics_xxxlarge.height)
+    property int fontHeight_xsmall: Math.ceil(fontMetrics_xsmall.lineSpacing)
+    property int fontHeight_small:  Math.ceil(fontMetrics_small.lineSpacing)
+    property int fontHeight_normal: Math.ceil(fontMetrics_normal.lineSpacing)
+    property int fontHeight_large:  Math.ceil(fontMetrics_large.lineSpacing)
+    property int fontHeight_xlarge: Math.ceil(fontMetrics_xlarge.lineSpacing)
+    property int fontHeight_xxlarge: Math.ceil(fontMetrics_xxlarge.lineSpacing)
+    property int fontHeight_xxxlarge: Math.ceil(fontMetrics_xxxlarge.lineSpacing)
 
 
     property int heightAlbumCover_xsmall: dp(32, scale);



More information about the vlc-commits mailing list