[vlc-commits] [Git][videolan/vlc][master] qml/SearchBox: Reverse IconToolButton to make it more UX friendly

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu Oct 7 16:05:55 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
55c929bd by Benjamin Arnaud at 2021-10-07T15:46:10+00:00
qml/SearchBox: Reverse IconToolButton to make it more UX friendly

- - - - -


1 changed file:

- modules/gui/qt/widgets/qml/SearchBox.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/SearchBox.qml
=====================================
@@ -85,27 +85,6 @@ FocusScope {
     Row {
         id: content
 
-        Widgets.IconToolButton {
-            id: icon
-
-            size: VLCStyle.banner_icon_size
-            iconText: VLCIcons.search
-            text: i18n.qtr("Filter")
-            height: root.height
-
-            focus: true
-
-            onClicked: {
-                searchBox.clear()
-                _expanded = !_expanded
-            }
-
-            Navigation.parentItem: root
-            Navigation.rightItem: _expanded ? searchBox : null
-            Keys.priority: Keys.AfterItem
-            Keys.onPressed: Navigation.defaultKeyAction(event)
-        }
-
         Rectangle {
             id: searchBoxRect
             color: VLCStyle.colors.button
@@ -139,8 +118,7 @@ FocusScope {
                 background: Rectangle { color: "transparent" }
 
                 Navigation.parentItem: root
-                Navigation.leftItem: icon
-                Navigation.rightItem: clearButton.visible ? clearButton : null
+                Navigation.rightItem: clearButton.visible ? clearButton : icon
                 Navigation.cancelAction: function() { _expanded = false }
                 Keys.priority: Keys.AfterItem
                 Keys.onPressed: {
@@ -179,9 +157,35 @@ FocusScope {
 
                 Navigation.parentItem: root
                 Navigation.leftItem: searchBox
+                Navigation.rightItem: icon
                 Keys.priority: Keys.AfterItem
                 Keys.onPressed: Navigation.defaultKeyAction(event)
             }
         }
+
+        Widgets.IconToolButton {
+            id: icon
+
+            height: root.height
+
+            size: VLCStyle.banner_icon_size
+
+            iconText: VLCIcons.search
+            text: i18n.qtr("Filter")
+
+            focus: true
+
+            Keys.priority: Keys.AfterItem
+            Keys.onPressed: Navigation.defaultKeyAction(event)
+
+            Navigation.parentItem: root
+            Navigation.leftItem: (_expanded) ? searchBox : null
+
+            onClicked: {
+                searchBox.clear();
+
+                _expanded = !_expanded;
+            }
+        }
     }
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/55c929bd00bab041f6d69cdee1eb8774a15ce3b4

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




More information about the vlc-commits mailing list