summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@theqtcompany.com>2015-08-04 14:36:49 +0200
committerAndras Becsi <andras.becsi@theqtcompany.com>2015-08-12 17:22:03 +0200
commit486f78decfb7020eb6fc6033668772d234d34bd7 (patch)
tree37b95b378e0de71feeabe3a145b0ae0b2599cedb /src
parentaee0d02368ebd2e5b7e80399667c42e16940c747 (diff)
Update bookmark icon to indicate bookmarked pages
Diffstat (limited to 'src')
-rw-r--r--src/qml/NavigationBar.qml12
-rw-r--r--src/qml/assets/icons/Btn_Bookmark_Checked.pngbin0 -> 1696 bytes
-rw-r--r--src/qml/assets/icons/Btn_Bookmark_Indicator.pngbin0 -> 1972 bytes
-rw-r--r--src/resources.qrc2
4 files changed, 11 insertions, 3 deletions
diff --git a/src/qml/NavigationBar.qml b/src/qml/NavigationBar.qml
index 4d1c98f..bb81139 100644
--- a/src/qml/NavigationBar.qml
+++ b/src/qml/NavigationBar.qml
@@ -20,7 +20,7 @@ ToolBar {
}
function refresh() {
- bookmarksButton.enabled = homeScreen.contains(urlBar.text) === -1
+ bookmarksButton.bookmarked = homeScreen.contains(urlBar.text) !== -1
}
state: "enabled"
@@ -285,13 +285,19 @@ ToolBar {
}
UIButton {
id: bookmarksButton
- source: "qrc:///star"
+ property bool bookmarked: false
+ source: bookmarked ? "qrc:///star_checked" : "qrc:///star"
onClicked: {
if (!webView)
return
var icon = webView.loading ? "" : webView.icon
+ var idx = homeScreen.contains(webView.url.toString())
+ if (idx !== -1) {
+ homeScreen.remove("", idx)
+ return
+ }
homeScreen.add(webView.title, webView.url, icon, engine.fallbackColor())
- enabled = false
+ bookmarked = true
}
Component.onCompleted: refresh()
}
diff --git a/src/qml/assets/icons/Btn_Bookmark_Checked.png b/src/qml/assets/icons/Btn_Bookmark_Checked.png
new file mode 100644
index 0000000..a6dbe6a
--- /dev/null
+++ b/src/qml/assets/icons/Btn_Bookmark_Checked.png
Binary files differ
diff --git a/src/qml/assets/icons/Btn_Bookmark_Indicator.png b/src/qml/assets/icons/Btn_Bookmark_Indicator.png
new file mode 100644
index 0000000..a8b8b6b
--- /dev/null
+++ b/src/qml/assets/icons/Btn_Bookmark_Indicator.png
Binary files differ
diff --git a/src/resources.qrc b/src/resources.qrc
index 17e28c8..f0cb698 100644
--- a/src/resources.qrc
+++ b/src/resources.qrc
@@ -17,6 +17,8 @@
<file alias="icon">qml/assets/icons/icon.png</file>
<file alias="delete">qml/assets/icons/Btn_Delete.png</file>
<file alias="star">qml/assets/icons/Btn_Bookmarks.png</file>
+ <file alias="star_checked">qml/assets/icons/Btn_Bookmark_Checked.png</file>
+ <file alias="star_indicator">qml/assets/icons/Btn_Bookmark_Indicator.png</file>
<file alias="settings">qml/assets/icons/Btn_Settings.png</file>
<file alias="about">qml/assets/icons/about_blank.png</file>
<file alias="newtab">qml/assets/icons/Btn_Add.png</file>