[vlc-commits] qml: display only the sort and filter controls in BannerSources when needed
Adrien Maglo
git at videolan.org
Thu Jun 13 13:11:12 CEST 2019
vlc | branch: master | Adrien Maglo <magsoft at videolan.org> | Wed May 29 17:18:27 2019 +0200| [3c5fec1652ae1828fad664841dc009450d8cdd8a] | committer: Thomas Guillem
qml: display only the sort and filter controls in BannerSources when needed
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3c5fec1652ae1828fad664841dc009450d8cdd8a
---
modules/gui/qt/qml/BannerSources.qml | 38 +++++++++++++++++++++++++++++++-----
1 file changed, 33 insertions(+), 5 deletions(-)
diff --git a/modules/gui/qt/qml/BannerSources.qml b/modules/gui/qt/qml/BannerSources.qml
index ec7f4babee..7f7d96062d 100644
--- a/modules/gui/qt/qml/BannerSources.qml
+++ b/modules/gui/qt/qml/BannerSources.qml
@@ -38,7 +38,7 @@ Utils.NavigableFocusScope {
signal itemClicked(int index)
signal subItemClicked(int index)
- property alias sortModel: sort_control.model
+ property alias sortModel: sortControl.model
property var contentModel
property alias model: pLBannerSources.model
@@ -94,8 +94,8 @@ Utils.NavigableFocusScope {
when: history.nextEmpty && history.previousEmpty
PropertyChanges {
target: buttonView
- KeyNavigation.left: searchBox
- KeyNavigation.down: searchBox
+ KeyNavigation.left: menu_selector
+ KeyNavigation.down: menu_selector
}
},
State {
@@ -309,12 +309,12 @@ Utils.NavigableFocusScope {
Layout.preferredHeight: VLCStyle.icon_normal
contentModel: root.contentModel
- KeyNavigation.right: sort_control
+ KeyNavigation.right: sortControl
KeyNavigation.up: buttonView
}
Utils.SortControl {
- id: sort_control
+ id: sortControl
textRole: "text"
listWidth: VLCStyle.widthSortBox
@@ -371,6 +371,34 @@ Utils.NavigableFocusScope {
}
}
}
+
+ // Content model states
+ states: [
+ State {
+ name: "contentModel"
+ when: root.contentModel !== undefined
+ PropertyChanges {
+ target: searchBox
+ visible: true
+ }
+ PropertyChanges {
+ target: sortControl
+ visible: true
+ }
+ },
+ State {
+ name: "noContentModel"
+ when: root.contentModel === undefined
+ PropertyChanges {
+ target: searchBox
+ visible: false
+ }
+ PropertyChanges {
+ target: sortControl
+ visible: false
+ }
+ }
+ ]
}
}
}
More information about the vlc-commits
mailing list