[vlc-commits] [Git][videolan/vlc][master] 3 commits: qml: make close icon a IconControlButton

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Nov 13 19:44:57 UTC 2022



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


Commits:
88707fb8 by Prince Gupta at 2022-11-13T19:30:47+00:00
qml: make close icon a IconControlButton

- - - - -
e58c41dc by Prince Gupta at 2022-11-13T19:30:47+00:00
qml: forward count property in KeyNavigableTableView

- - - - -
e3eed4fc by Prince Gupta at 2022-11-13T19:30:47+00:00
qml: allow keyboard focus on cross button of album expand delegate

- - - - -


2 changed files:

- modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
- modules/gui/qt/widgets/qml/KeyNavigableTableView.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
=====================================
@@ -212,44 +212,65 @@ FocusScope {
                 }
             }
 
-            header: Column {
+            header: FocusScope {
+                id: headerFocusScope
+
                 width: tracks.width
                 height: implicitHeight
-                bottomPadding: VLCStyle.margin_large
+                implicitHeight: col.implicitHeight
+
+                focus: true
+
+                Navigation.parentItem: root
+                Navigation.leftItem: enqueueActionBtn
+                Navigation.downAction: function () {
+                    if (tracks.count > 0) {
+                        tracks.setCurrentItemFocus(Qt.TabFocus)
+                    } else {
+                        root.Navigation.downAction()
+                    }
+                }
 
-                RowLayout {
-                    width: parent.width
 
-                    /* The title of the albums */
-                    Widgets.SubtitleLabel {
-                        id: expand_infos_title_id
+                Column {
+                    id: col
 
-                        text: Helpers.get(model, "title", I18n.qtr("Unknown title"))
+                    anchors.fill: parent
+                    bottomPadding: VLCStyle.margin_large
 
-                        Layout.fillWidth: true
-                    }
+                    RowLayout {
+                        width: parent.width
 
-                    Widgets.IconLabel {
-                        text: VLCIcons.close
+                        /* The title of the albums */
+                        Widgets.SubtitleLabel {
+                            id: expand_infos_title_id
 
-                        Layout.rightMargin: VLCStyle.margin_small
+                            text: Helpers.get(model, "title", I18n.qtr("Unknown title"))
+
+                            Layout.fillWidth: true
+                        }
+
+                        Widgets.IconControlButton {
+                            iconText: VLCIcons.close
+                            focus: true
+
+                            Navigation.parentItem: headerFocusScope
+                            Layout.rightMargin: VLCStyle.margin_small
 
-                        MouseArea {
-                            anchors.fill: parent
                             onClicked: root.retract()
                         }
                     }
-                }
 
-                Widgets.CaptionLabel {
-                    id: expand_infos_subtitle_id
-
-                    width: parent.width
-                    text: I18n.qtr("%1 - %2 - %3 - %4")
-                        .arg(Helpers.get(model, "main_artist", I18n.qtr("Unknown artist")))
-                        .arg(Helpers.get(model, "release_year", ""))
-                        .arg(_getStringTrack())
-                        .arg((model && model.duration) ? model.duration.formatHMS() : 0)
+                    Widgets.CaptionLabel {
+                        id: expand_infos_subtitle_id
+
+                        width: parent.width
+                        text: I18n.qtr("%1 - %2 - %3 - %4")
+                            .arg(Helpers.get(model, "main_artist", I18n.qtr("Unknown artist")))
+                            .arg(Helpers.get(model, "release_year", ""))
+                            .arg(_getStringTrack())
+                            .arg((model && model.duration) ? model.duration.formatHMS() : 0)
+                    }
                 }
             }
 
@@ -275,6 +296,7 @@ FocusScope {
 
             Navigation.parentItem: root
             Navigation.leftItem: actionButtons
+            Navigation.upItem: headerItem
 
             Widgets.TableColumns {
                 id: tableColumns


=====================================
modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
=====================================
@@ -108,6 +108,8 @@ FocusScope {
 
     property alias displayMarginEnd: view.displayMarginEnd
 
+    property alias count: view.count
+
     // Signals
 
     //forwarded from subview



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/88998fd0e9d7b920e35c8b096c4ed6b1c915a058...e3eed4fc1992adf92bfa72b8abaad2dac47f198a

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