[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [koko] qmlUiKirigami: When the currentIndex in the ImageViewer changed, updates the grid's currentIn
From:       Atul Sharma <null () kde ! org>
Date:       2017-06-30 15:36:36
Message-ID: E1dQxyG-0007gD-6c () code ! kde ! org
[Download RAW message or body]

Git commit fce428f6f6d2b06c6a35688043cc6c8f153efd8a by Atul Sharma.
Committed on 30/06/2017 at 15:36.
Pushed by atulsharma into branch 'master'.

When the currentIndex in the ImageViewer changed, updates the grid's currentIndex too

Summary: * Adds a new property view in the currentImage, that holds the current \
gridView so that it can change the gridView's currentIndex too

Reviewers: #koko, mart

Reviewed By: #koko, mart

Maniphest Tasks: T6420

Differential Revision: https://phabricator.kde.org/D6454

M  +2    -2    qmlUiKirigami/SelectionButton.qml
M  +4    -0    qmlUiKirigami/main.qml

https://commits.kde.org/koko/fce428f6f6d2b06c6a35688043cc6c8f153efd8a

diff --git a/qmlUiKirigami/SelectionButton.qml b/qmlUiKirigami/SelectionButton.qml
index 6be42db..32f6265 100644
--- a/qmlUiKirigami/SelectionButton.qml
+++ b/qmlUiKirigami/SelectionButton.qml
@@ -41,10 +41,10 @@ Kirigami.Icon {
         onClicked: { 
             if(iconMouseArea.state == "add") {
                 gridView.model.setSelected(model.index)
-                gridView.currentIndex = model.index
+                currentImage.view.currentIndex = model.index
             } else {
                 gridView.model.toggleSelected(model.index)
-                gridView.currentIndex = model.index
+                currentImage.view.currentIndex = model.index
             }
         }
         
diff --git a/qmlUiKirigami/main.qml b/qmlUiKirigami/main.qml
index 47ed890..d04edb0 100644
--- a/qmlUiKirigami/main.qml
+++ b/qmlUiKirigami/main.qml
@@ -33,6 +33,10 @@ Kirigami.ApplicationWindow {
         id: currentImage
         property int index
         property var model
+        property GridView view : pageStack.currentItem.flickable
+        onIndexChanged: {
+            view.currentIndex = currentImage.index
+        }
     }
     
     pageStack.initialPage: AlbumView {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic