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

List:       kde-commits
Subject:    [kanagram] src/harmattan: Add yet another separator below the switch and fix some issues with ListIt
From:       Laszlo Papp <ext-laszlo.papp () nokia ! com>
Date:       2012-02-01 2:50:24
Message-ID: 20120201025024.92AF0A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit b8ca202a1077aead19e38c2080311d6ce9e6af16 by Laszlo Papp.
Committed on 01/02/2012 at 05:50.
Pushed by lpapp into branch 'master'.

Add yet another separator below the switch and fix some issues with ListItem

M  +15   -4    src/harmattan/ListItem.qml
M  +8    -0    src/harmattan/MainSettingsPage.qml

http://commits.kde.org/kanagram/b8ca202a1077aead19e38c2080311d6ce9e6af16

diff --git a/src/harmattan/ListItem.qml b/src/harmattan/ListItem.qml
index cc0422a..48a0a26 100644
--- a/src/harmattan/ListItem.qml
+++ b/src/harmattan/ListItem.qml
@@ -29,9 +29,10 @@ Rectangle {
     property string titleText;
     property string subtitleText;
 
-    property bool mousePressed: false;
+    property string iconId;
+    property bool iconVisible: false;
 
-    property bool drillDownArrow: false;
+    property bool mousePressed: false;
 
     height: 64;
     width: parent.width;
@@ -90,8 +91,18 @@ Rectangle {
     }
 
     Image {
-        visible: drillDownArrow;
-        source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "");
+        function handleIconId() {
+            var prefix = "icon-m-";
+            // check if id starts with prefix and use it as is
+            // otherwise append prefix and use the inverted version if required
+            if (iconId.indexOf(prefix) !== 0)
+                iconId = prefix.concat(iconId).concat(theme.inverted ?  "-inverse" : "");
+
+            return "image://theme/" + iconId;
+        }
+
+        visible: iconVisible;
+        source: handleIconId();
         anchors {
             right: parent.right;
             verticalCenter: parent.verticalCenter;
diff --git a/src/harmattan/MainSettingsPage.qml b/src/harmattan/MainSettingsPage.qml
index de57b00..327118e 100644
--- a/src/harmattan/MainSettingsPage.qml
+++ b/src/harmattan/MainSettingsPage.qml
@@ -197,6 +197,14 @@ Page {
                     }
                 }
 
+                Image {
+                    id: separator4;
+                    width: parent.width;
+                    height: 2;
+                    fillMode: Image.TileHorizontally;
+                    source: "separator.png";
+                }
+
                 ListItem {
                     iconSource: "preferences-desktop-locale.png";
                     titleText: qsTr("Language");
[prev in list] [next in list] [prev in thread] [next in thread] 

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