[vlc-commits] [Git][videolan/vlc][master] 3 commits: qml: fix unnecessary column wrapping

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Aug 22 22:16:40 UTC 2022



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


Commits:
8aa0e596 by Prince Gupta at 2022-08-22T22:02:22+00:00
qml: fix unnecessary column wrapping

- - - - -
b6facac5 by Prince Gupta at 2022-08-22T22:02:22+00:00
qml: simplify 'view more' delgate implementation in video expand panel

- - - - -
7b6de090 by Prince Gupta at 2022-08-22T22:02:22+00:00
qml: add spacing between descriptions in videoexpandpanel

- - - - -


1 changed file:

- modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
=====================================
@@ -174,50 +174,45 @@ FocusScope {
                     width: parent.width
                 }
 
-                Column {
-                    width: expand_infos_id.width
-
+                Widgets.MenuCaption {
                     topPadding: VLCStyle.margin_normal
+                    text: "<b>" + I18n.qtr("File Name:") + "</b> " + expandRect.model.fileName
+                    width: parent.width
+                    textFormat: Text.StyledText
+                }
 
-                    Widgets.MenuCaption {
-                        text: "<b>" + I18n.qtr("File Name:") + "</b> " + expandRect.model.fileName
-                        width: parent.width
-                        textFormat: Text.StyledText
-                    }
-
-                    Widgets.MenuCaption {
-                        text: "<b>" + I18n.qtr("Path:") + "</b> " + expandRect.model.display_mrl
-                        topPadding: VLCStyle.margin_xsmall
-                        width: parent.width
-                        textFormat: Text.StyledText
-                    }
+                Widgets.MenuCaption {
+                    text: "<b>" + I18n.qtr("Path:") + "</b> " + expandRect.model.display_mrl
+                    topPadding: VLCStyle.margin_xsmall
+                    width: parent.width
+                    textFormat: Text.StyledText
+                }
 
-                    MouseArea {
-                        width: childrenRect.width
-                        height: childrenRect.height
+                MouseArea {
+                    width: childrenRect.width
+                    height: childrenRect.height
 
-                        onClicked: _showMoreInfo = !_showMoreInfo
+                    onClicked: _showMoreInfo = !_showMoreInfo
 
-                        Row {
-                            topPadding: VLCStyle.margin_large
-                            spacing: VLCStyle.margin_xsmall
+                    Row {
+                        topPadding: VLCStyle.margin_large
+                        spacing: VLCStyle.margin_xsmall
 
-                            Widgets.IconLabel {
-                                text: VLCIcons.expand
-                                rotation: _showMoreInfo ? -180 : 0
-                                font.pixelSize: VLCStyle.icon_normal
+                        Widgets.IconLabel {
+                            text: VLCIcons.expand
+                            rotation: _showMoreInfo ? -180 : 0
+                            font.pixelSize: VLCStyle.icon_normal
 
-                                Behavior on rotation {
-                                    NumberAnimation {
-                                        duration: VLCStyle.duration_short
-                                    }
+                            Behavior on rotation {
+                                NumberAnimation {
+                                    duration: VLCStyle.duration_short
                                 }
                             }
+                        }
 
-                            Widgets.CaptionLabel {
-                                text: _showMoreInfo ? I18n.qtr("View Less") : I18n.qtr("View More")
-                                color: VLCStyle.colors.text
-                            }
+                        Widgets.CaptionLabel {
+                            text: _showMoreInfo ? I18n.qtr("View Less") : I18n.qtr("View More")
+                            color: VLCStyle.colors.text
                         }
                     }
                 }
@@ -229,80 +224,98 @@ FocusScope {
 
                     spacing: VLCStyle.margin_xlarge
 
-                    Column {
-                        id: videoTrackInfo
+                    visible: _showMoreInfo
+
+                    Repeater {
+                        model: [
+                            {
+                                "title": I18n.qtr("Video track"),
+                                "model": videoDescModel
+                            },
+                            {
+                                "title": I18n.qtr("Audio track"),
+                                "model": audioDescModel
+                            }
+                        ]
 
-                        visible: (_showMoreInfo && expandRect.model.videoDesc.length > 0)
+                        delegate: Column {
+                            visible: delgateRepeater.count > 0
 
-                        opacity: (visible) ? 1.0 : 0.0
+                            opacity: (visible) ? 1.0 : 0.0
 
-                        Behavior on opacity {
-                            NumberAnimation {
-                                duration: VLCStyle.duration_short
+                            Behavior on opacity {
+                                NumberAnimation {
+                                    duration: VLCStyle.duration_short
+                                }
                             }
-                        }
 
-                        Widgets.MenuCaption {
-                            text: I18n.qtr("Video track")
-                            font.bold: true
-                            bottomPadding: VLCStyle.margin_small
-                        }
-
-                        Repeater {
-                            model: expandRect.model.videoDesc
-
-                            delegate: Repeater {
-                                model: [
-                                    {text: I18n.qtr("Codec:"), data: modelData.codec },
-                                    {text: I18n.qtr("Language:"), data: modelData.language },
-                                    {text: I18n.qtr("FPS:"), data: modelData.fps }
-                                ]
+                            Widgets.MenuCaption {
+                                text: modelData.title
+                                font.bold: true
+                                bottomPadding: VLCStyle.margin_small
+                            }
 
-                                delegate: Widgets.MenuCaption {
-                                    text: modelData.text + " " + modelData.data
-                                    bottomPadding: VLCStyle.margin_xsmall
-                                }
+                            Repeater {
+                                id: delgateRepeater
 
+                                model: modelData.model
                             }
                         }
                     }
+                }
+            }
+        }
+    }
 
-                    Column {
-                        id: audioTrackInfo
+    ObjectModel {
+        id: videoDescModel
 
-                        visible: (_showMoreInfo && expandRect.model.audioDesc.length > 0)
+        Repeater {
+            model: expandRect.model.videoDesc
 
-                        opacity: (visible) ? 1.0 : 0.0
+            // TODO: use inline Component for Qt > 5.14
+            delegate: Repeater {
+                id: videoDescRepeaterDelegate
 
-                        Behavior on opacity {
-                            NumberAnimation {
-                                duration: VLCStyle.duration_short
-                            }
-                        }
+                readonly property bool isFirst: (index === 0)
 
-                        Widgets.MenuCaption {
-                            text: I18n.qtr("Audio track")
-                            font.bold: true
-                            bottomPadding: VLCStyle.margin_small
-                        }
+                model: [
+                    {text: I18n.qtr("Codec:"), data: modelData.codec },
+                    {text: I18n.qtr("Language:"), data: modelData.language },
+                    {text: I18n.qtr("FPS:"), data: modelData.fps }
+                ]
 
-                        Repeater {
-                            model: expandRect.model.audioDesc
+                delegate: Widgets.MenuCaption {
+                    topPadding: (!videoDescRepeaterDelegate.isFirst) && (index === 0) ? VLCStyle.margin_small : 0
+                    text: modelData.text + " " + modelData.data
+                    bottomPadding: VLCStyle.margin_xsmall
+                }
+            }
+        }
+    }
 
-                            delegate: Repeater {
-                                model: [
-                                    {text: I18n.qtr("Codec:"), data: modelData.codec },
-                                    {text: I18n.qtr("Language:"), data: modelData.language },
-                                    {text: I18n.qtr("Channel:"), data: modelData.nbchannels }
-                                ]
+    ObjectModel {
+        id: audioDescModel
 
-                                delegate: Widgets.MenuCaption {
-                                    text: modelData.text + " " + modelData.data
-                                    bottomPadding: VLCStyle.margin_xsmall
-                                }
-                            }
-                        }
-                    }
+        // TODO: use inline Component for Qt > 5.14
+        Repeater {
+            model: expandRect.model.audioDesc
+
+            delegate: Repeater {
+                id: audioDescRepeaterDelegate
+
+                readonly property bool isFirst: (index === 0)
+
+                model: [
+                    {text: I18n.qtr("Codec:"), data: modelData.codec },
+                    {text: I18n.qtr("Language:"), data: modelData.language },
+                    {text: I18n.qtr("Channel:"), data: modelData.nbchannels }
+                ]
+
+                delegate: Widgets.MenuCaption {
+                    topPadding: (!audioDescRepeaterDelegate.isFirst) && (index === 0) ? VLCStyle.margin_small : 0
+                    text: modelData.text + " " + modelData.data
+                    bottomPadding: VLCStyle.margin_xsmall
                 }
             }
         }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bbf9918e572c6b888a5e65a857bac196da17ddbf...7b6de0902ad6d457f13d0c8b00abf01d42c920a1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/bbf9918e572c6b888a5e65a857bac196da17ddbf...7b6de0902ad6d457f13d0c8b00abf01d42c920a1
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