[vlc-commits] [Git][videolan/vlc][master] qml/TeletextWidget: Fix width(s) for long translations

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Nov 6 16:53:12 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
16f30330 by Benjamin Arnaud at 2022-11-06T15:46:29+00:00
qml/TeletextWidget: Fix width(s) for long translations

- - - - -


1 changed file:

- modules/gui/qt/player/qml/controlbarcontrols/TeletextWidget.qml


Changes:

=====================================
modules/gui/qt/player/qml/controlbarcontrols/TeletextWidget.qml
=====================================
@@ -17,6 +17,7 @@
  *****************************************************************************/
 
 import QtQuick 2.11
+import QtQuick.Layouts 1.11
 import QtQuick.Templates 2.4 as T
 
 import org.videolan.vlc 0.1
@@ -47,12 +48,15 @@ T.Pane {
         spacing: VLCStyle.margin_small
 
         Item {
-            anchors.left: parent.left
-            anchors.right: parent.right
+            // NOTE: This makes sure that we can deal with long translations for our itemText.
+            width: Math.max(itemText.implicitWidth + teleActivateBtn.width + VLCStyle.margin_small,
+                            parent.width)
 
             height: teleActivateBtn.height
 
             Widgets.SubtitleLabel {
+                id: itemText
+
                 text: I18n.qtr("Teletext")
 
                 color: root.colors.text
@@ -79,14 +83,15 @@ T.Pane {
             }
         }
 
-        Row {
+        RowLayout {
+            anchors.left: parent.left
+            anchors.right: parent.right
+
             spacing: VLCStyle.margin_small
 
             Widgets.IconControlButton{
                 id: teleTransparencyBtn
 
-                anchors.verticalCenter: parent.verticalCenter
-
                 enabled: teleActivateBtn.checked
 
                 checked: Player.teletextTransparency
@@ -110,10 +115,7 @@ T.Pane {
             Widgets.SpinBoxExt{
                 id: telePageNumber
 
-                anchors.verticalCenter: parent.verticalCenter
-
-                // NOTE: We want a fixed size for the TextInput.
-                width: VLCStyle.dp(136, VLCStyle.scale)
+                Layout.fillWidth: true
 
                 enabled: teleActivateBtn.checked
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/16f30330fea4ec34ed7a2da62f58c9adb9e0bbec

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/16f30330fea4ec34ed7a2da62f58c9adb9e0bbec
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list