[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml/KeyNavigableListView: fix arrow buttons

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Jul 2 17:05:10 UTC 2021



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


Commits:
366ab20d by Prince Gupta at 2021-07-02T16:47:16+00:00
qml/KeyNavigableListView: fix arrow buttons

fixes "arrow buttons are visible if view is at beginning/end"

previous solution assumed the originX is 0 when checking view position

- - - - -
97d7a343 by Prince Gupta at 2021-07-02T16:47:16+00:00
qml/KeyNavigableListView: prevpage() scroll till beginning

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/qt/widgets/qml/KeyNavigableListView.qml
=====================================
@@ -89,7 +89,7 @@ FocusScope {
         view.contentX += (Math.min(view.width, (view.contentWidth - view.width - view.contentX ) ))
     }
     function prevPage() {
-        view.contentX -= Math.min(view.width,view.contentX )
+        view.contentX -= Math.min(view.width,view.contentX - view.originX)
     }
 
     function positionViewAtIndex(index, mode) {
@@ -311,22 +311,24 @@ FocusScope {
         }
     }
 
-    RoundButton{
+    RoundButton {
         id: leftBtn
+
         anchors.verticalCenter: parent.verticalCenter
         anchors.left: parent.left
         text:"<"
         onClicked: listview_id.prevPage()
-        visible: view.orientation === ListView.Horizontal && view.contentX > 0
+        visible: view.orientation === ListView.Horizontal && !view.atXBeginning
     }
 
 
-    RoundButton{
+    RoundButton {
         id: rightBtn
+
         anchors.verticalCenter: parent.verticalCenter
         anchors.right: parent.right
         text:">"
         onClicked: listview_id.nextPage()
-        visible: view.orientation === ListView.Horizontal && (view.contentWidth - view.width - view.contentX) > 0
+        visible: view.orientation === ListView.Horizontal && !view.atXEnd
     }
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6fe8644907bb5b0cb5c5d709d573df65b2c95ded...97d7a3438fa74b88dff9a7fa38f667a8ed2031ef

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6fe8644907bb5b0cb5c5d709d573df65b2c95ded...97d7a3438fa74b88dff9a7fa38f667a8ed2031ef
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list