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.
This commit is contained in:
Steve Fryatt 2013-12-29 21:39:23 +00:00
parent d451b543c6
commit f825521072
2 changed files with 8 additions and 6 deletions

View File

@ -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;
}

View File

@ -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,