summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Fryatt <stevef@netsurf-browser.org>2013-12-29 21:39:23 +0000
committerSteve Fryatt <stevef@netsurf-browser.org>2013-12-29 21:39:23 +0000
commitf825521072ed7e459e7fa465cf66efd24f5feb76 (patch)
treedb7306fcf46903828c611db5e39f43ad7174ce3a
parentd451b543c6a0ea7face2d5344de870d88ee0807a (diff)
downloadnetsurf-f825521072ed7e459e7fa465cf66efd24f5feb76.tar.gz
netsurf-f825521072ed7e459e7fa465cf66efd24f5feb76.tar.bz2
Fix hotlist icon in browser URL bar.
- Change URL container to Double/Click/Drag so that mouse actions get passed on. - Correctly parse return code from hotlist_add_url() to identify successful adds.
-rw-r--r--riscos/gui/url_bar.c12
-rw-r--r--riscos/toolbar.c2
2 files changed, 8 insertions, 6 deletions
diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c
index eede2ac88..1bc426166 100644
--- a/riscos/gui/url_bar.c
+++ b/riscos/gui/url_bar.c
@@ -337,7 +337,10 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar)
if (!url_bar->hidden && url_bar->container_icon == -1) {
icon.icon.flags = wimp_ICON_BORDER |
- (wimp_COLOUR_BLACK << wimp_ICON_FG_COLOUR_SHIFT);
+ (wimp_COLOUR_BLACK <<
+ wimp_ICON_FG_COLOUR_SHIFT) |
+ (wimp_BUTTON_DOUBLE_CLICK_DRAG <<
+ wimp_ICON_BUTTON_TYPE_SHIFT);
error = xwimp_create_icon(&icon, &url_bar->container_icon);
if (error != NULL) {
LOG(("xwimp_create_icon: 0x%x: %s",
@@ -758,9 +761,8 @@ bool ro_gui_url_bar_click(struct url_bar *url_bar,
return false;
/* If we have a click over the hotlist icon, hotlist add/remove. */
- /* TODO: this doesn't work
- * neither does the TOOLBAR_URL_DRAG_FAVICON below */
- if (pointer->buttons & (wimp_CLICK_SELECT | wimp_SINGLE_SELECT) &&
+
+ if (pointer->buttons == wimp_SINGLE_SELECT &&
url_bar->text_buffer != NULL) {
if (pos.x >= url_bar->hotlist.extent.x0 &&
pos.x <= url_bar->hotlist.extent.x1 &&
@@ -771,7 +773,7 @@ bool ro_gui_url_bar_click(struct url_bar *url_bar,
if (nsurl_create((const char *)url_bar->text_buffer,
&n) == NSERROR_OK) {
if (url_bar->hotlist.add) {
- if (hotlist_add_url(n)) {
+ if (hotlist_add_url(n) == NSERROR_OK) {
redraw = true;
url_bar->hotlist.add = false;
}
diff --git a/riscos/toolbar.c b/riscos/toolbar.c
index 4da4db478..26a9bd440 100644
--- a/riscos/toolbar.c
+++ b/riscos/toolbar.c
@@ -162,7 +162,7 @@ static wimp_window ro_toolbar_window = {
wimp_WINDOW_NEVER3D | 0x16u /* RISC OS 5.03+ */,
{0, 0, TOOLBAR_DEFAULT_WIDTH, 16384},
0,
- wimp_BUTTON_CLICK_DRAG << wimp_ICON_BUTTON_TYPE_SHIFT,
+ wimp_BUTTON_DOUBLE_CLICK_DRAG << wimp_ICON_BUTTON_TYPE_SHIFT,
wimpspriteop_AREA,
1,
1,