summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@theqtcompany.com>2015-08-07 14:57:27 +0200
committerAndras Becsi <andras.becsi@theqtcompany.com>2015-08-12 17:22:04 +0200
commit4fa0910228b096e446013b99799c9284dda9399d (patch)
tree229b1dde8e0e0d0d464b455d82a1d716c5ea890e
parent5ae11ca3407e88044f7d79c86c94815119a5280a (diff)
Adjust HomeScreen behavior and saving of empty state
-rw-r--r--src/qml/HomeScreen.qml15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/qml/HomeScreen.qml b/src/qml/HomeScreen.qml
index 580a3ef..1fbdaac 100644
--- a/src/qml/HomeScreen.qml
+++ b/src/qml/HomeScreen.qml
@@ -53,6 +53,10 @@ Rectangle {
}
state: "enabled"
+ onStateChanged: {
+ if (state == "enabled" && !gridView.count)
+ messageBox.state = "empty"
+ }
signal add(string title, string url, string iconUrl, string fallbackColor)
onAdd: {
@@ -76,6 +80,8 @@ Rectangle {
listModel.remove(index)
gridView.forceLayout()
navigation.refresh()
+ if (!listModel.count)
+ messageBox.state = "empty"
}
function get(index) {
@@ -132,8 +138,6 @@ Rectangle {
for (var i = 0; i < listModel.count; ++i) {
list[i] = listModel.get(i)
}
- if (!list.length)
- return
engine.saveSetting("bookmarks", JSON.stringify(list))
}
}
@@ -495,6 +499,7 @@ Rectangle {
}
Rectangle {
+ color: parent.color
anchors {
top: message.bottom
bottom: parent.bottom
@@ -551,10 +556,14 @@ Rectangle {
}
PropertyChanges {
target: messageBox
- color: "transparent"
+ color: "#e4e4e4"
visible: true
}
PropertyChanges {
+ target: error
+ anchors.topMargin: 30
+ }
+ PropertyChanges {
target: navigation
state: "enabled"
}