summaryrefslogtreecommitdiff
path: root/riscos/gui
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-11-23 15:30:26 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-11-23 15:30:26 +0000
commiteea34922668e8dd5830d6633766aefc3f6e8b5a4 (patch)
tree15ed09a6f47c4f1cfc21d69a320057e03083f9dd /riscos/gui
parentf66ddd5ec01ef995fcb42c7914ad9c5a8686890c (diff)
downloadnetsurf-eea34922668e8dd5830d6633766aefc3f6e8b5a4.tar.gz
netsurf-eea34922668e8dd5830d6633766aefc3f6e8b5a4.tar.bz2
Update hotlist indicator when current page is added to hotlist.
Diffstat (limited to 'riscos/gui')
-rw-r--r--riscos/gui/url_bar.c23
-rw-r--r--riscos/gui/url_bar.h10
2 files changed, 33 insertions, 0 deletions
diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c
index 90fe5ed86..eede2ac88 100644
--- a/riscos/gui/url_bar.c
+++ b/riscos/gui/url_bar.c
@@ -999,6 +999,29 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
/* This is an exported interface documented in url_bar.h */
+void ro_gui_url_bar_hotlist_modifed(struct url_bar *url_bar, nsurl *url)
+{
+ nsurl *n;
+
+ if (nsurl_create((const char *)url_bar->text_buffer,
+ &n) == NSERROR_OK) {
+ bool prev = url_bar->hotlist.add;
+ url_bar->hotlist.add = !hotlist_has_url(n);
+ nsurl_unref(n);
+
+ if (prev != url_bar->hotlist.add && !url_bar->hidden) {
+ xwimp_force_redraw(url_bar->window,
+ url_bar->hotlist.extent.x0,
+ url_bar->hotlist.extent.y0,
+ url_bar->hotlist.extent.x1,
+ url_bar->hotlist.extent.y1);
+ }
+ }
+}
+
+
+/* This is an exported interface documented in url_bar.h */
+
const char *ro_gui_url_bar_get_url(struct url_bar *url_bar)
{
if (url_bar == NULL)
diff --git a/riscos/gui/url_bar.h b/riscos/gui/url_bar.h
index edc77640b..04a8468ba 100644
--- a/riscos/gui/url_bar.h
+++ b/riscos/gui/url_bar.h
@@ -232,6 +232,16 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
/**
+ * Update urlbar's hotlist icon, if necessary.
+ *
+ * \param *url_bar The URL Bar to update.
+ * \param *url URL with updated hotlist presence, or NULL if unknown.
+ */
+
+void ro_gui_url_bar_hotlist_modifed(struct url_bar *url_bar, nsurl *url);
+
+
+/**
* Return a pointer to the URL contained in a URL bar.
*
* \param *url_bar The URL Bar to look up the URL from.