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

List:       kde-commits
Subject:    [muon/reviewsOnOverview] discover/qml: Small arrangements in the ApplicationsOverview
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2013-08-19 17:52:04
Message-ID: E1VBTca-0006Dx-3S () scm ! kde ! org
[Download RAW message or body]

Git commit 23d344b1675b67547c9ed64c3e34bcc156b12ef3 by Aleix Pol.
Committed on 19/08/2013 at 17:51.
Pushed by apol into branch 'reviewsOnOverview'.

Small arrangements in the ApplicationsOverview

Including the AddonsView display

M  +28   -45   discover/qml/AddonsView.qml
M  +23   -16   discover/qml/ApplicationOverview.qml

http://commits.kde.org/muon/23d344b1675b67547c9ed64c3e34bcc156b12ef3

diff --git a/discover/qml/AddonsView.qml b/discover/qml/AddonsView.qml
index 31c664e..dab29ff 100644
--- a/discover/qml/AddonsView.qml
+++ b/discover/qml/AddonsView.qml
@@ -2,60 +2,43 @@ import QtQuick 1.1
 import org.kde.plasma.components 0.1
 import org.kde.muon 1.0
 
-ListView
+Column
 {
     id: addonsView
     property alias application: addonsModel.application
-    property alias addonsHaveChanged: addonsModel.hasChanges
     property bool isInstalling: false
     property alias isEmpty: addonsModel.isEmpty
-    
-    ApplicationAddonsModel { id: addonsModel }
-    
-    model: addonsModel
-    
-    clip: true
-    delegate: Row {
-        height: 50
-        width: 50
-        spacing: 10
-        CheckBox {
-            enabled: !isInstalling
-            anchors.verticalCenter: parent.verticalCenter
-            checked: model.checked
-            onClicked: addonsModel.changeState(display, checked)
-        }
-        Image {
-            source: "image://icon/applications-other"
-            height: parent.height; width: height
-            smooth: true
-            opacity: isInstalling ? 0.3 : 1
-        }
-        Label {
-            enabled: !isInstalling
-            anchors.verticalCenter: parent.verticalCenter
-            text: i18n("<qt>%1<br/><em>%2</em></qt>", display, toolTip)
-        }
-    }
-    
-    NativeScrollBar {
-        id: scroll
-        orientation: Qt.Vertical
-        flickableItem: parent
-        anchors {
-            top: parent.top
-            right: parent.right
-            bottom: parent.bottom
+
+    Repeater
+    {
+        model: ApplicationAddonsModel { id: addonsModel }
+        
+        delegate: Row {
+            height: 50
+            width: 50
+            spacing: 10
+            CheckBox {
+                enabled: !addonsView.isInstalling
+                anchors.verticalCenter: parent.verticalCenter
+                checked: model.checked
+                onClicked: addonsModel.changeState(display, checked)
+            }
+            Image {
+                source: "image://icon/applications-other"
+                height: parent.height; width: height
+                smooth: true
+                opacity: addonsView.isInstalling ? 0.3 : 1
+            }
+            Label {
+                enabled: !addonsView.isInstalling
+                anchors.verticalCenter: parent.verticalCenter
+                text: i18n("<qt>%1<br/><em>%2</em></qt>", display, toolTip)
+            }
         }
     }
     
     Row {
-        visible: addonsModel.hasChanges && !isInstalling
-        layoutDirection: Qt.RightToLeft
-        anchors {
-            top: parent.top
-            right: parent.right
-        }
+        enabled: addonsModel.hasChanges && !addonsView.isInstalling
         spacing: 5
         
         Button {
diff --git a/discover/qml/ApplicationOverview.qml \
b/discover/qml/ApplicationOverview.qml index beb0f3d..4e4d057 100644
--- a/discover/qml/ApplicationOverview.qml
+++ b/discover/qml/ApplicationOverview.qml
@@ -100,27 +100,27 @@ Item {
                         wrapMode: Text.WordWrap
                     }
                     Row {
+                        anchors.right: parent.right
+
                         spacing: 5
-                        Rating {
-                            visible: overviewContents.ratingInstance!=null
-                            rating: overviewContents.ratingInstance == null ? 
-                                                        0 : \
                overviewContents.ratingInstance.rating
-                            width: 120
-                        }
                         InstallApplicationButton {
                             id: installButton
                             width: maximumWidth
                             application: appInfo.application
-                            additionalItem: Button {
-                                visible: application.isInstalled && \
                application.canExecute
-                                text: i18n("Launch")
-                                onClicked: application.invokeApplication()
+                            additionalItem:  Rating {
+                                visible: overviewContents.ratingInstance!=null
+                                rating:  overviewContents.ratingInstance==null ? 0 : \
overviewContents.ratingInstance.rating  }
                         }
+                        Button {
+                            visible: application.isInstalled && \
application.canExecute +                            text: i18n("Launch")
+                            onClicked: application.invokeApplication()
+                        }
                     }
                 }
             }
-            Heading { text: "Description" }
+            Heading { text: i18n("Description") }
             Label {
                 id: info
                 anchors {
@@ -132,15 +132,23 @@ Item {
                 wrapMode: Text.WordWrap
                 text: application.longDescription
             }
-            
+
+            Heading {
+                text: i18n("Addons")
+                visible: addonsView.visible
+            }
             AddonsView {
-                id:addonsView
+                id: addonsView
                 application: appInfo.application
                 isInstalling: installButton.isActive
-                visible: count>0
-                header: Heading { text: i18n("Addons") }
+            }
+
+            Heading {
+                text: i18n("Comments")
+                visible: reviewsView.visible
             }
             ListView {
+                id: reviewsView
                 width: parent.width
                 height: 123
                 spacing: 5
@@ -148,7 +156,6 @@ Item {
                 clip: true
                 interactive: false
                 
-                header: Heading { text: i18n("Comments") }
                 delegate: ReviewDelegate {
                     onMarkUseful: reviewsModel.markUseful(index, useful)
                 }


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

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