Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/16603cea2781612649e1c...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/16603cea2781612649e1cc4...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/16603cea2781612649e1cc438...
The branch, master has been updated
via 16603cea2781612649e1cc4388913ff773395266 (commit)
from e9932f75ade2e694c9743a78bc63e2b5a1613b6a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commitdiff/16603cea2781612649e...
commit 16603cea2781612649e1cc4388913ff773395266
Author: Ole Loots <ole(a)monochrom.net>
Commit: Ole Loots <ole(a)monochrom.net>
Merged toolbar changes from master
diff --git a/atari/toolbar.c b/atari/toolbar.c
index 56d3b04..480b699 100644
--- a/atari/toolbar.c
+++ b/atari/toolbar.c
@@ -213,6 +213,25 @@ static void tb_txt_request_redraw(void *data, int x, int y, int w,
int h)
return;
}
+static void tb_txt_callback(void *data, struct textarea_msg *msg)
+{
+ switch (msg->type) {
+
+ case TEXTAREA_MSG_DRAG_REPORT:
+ break;
+
+ case TEXTAREA_MSG_REDRAW_REQUEST:
+ tb_txt_request_redraw(data,
+ msg->data.redraw.x0, msg->data.redraw.y0,
+ msg->data.redraw.x1 - msg->data.redraw.x0,
+ msg->data.redraw.y1 - msg->data.redraw.y0);
+ break;
+
+ default:
+ break;
+ }
+}
+
static struct s_tb_button *button_init(struct s_toolbar *tb, OBJECT * tree, int index,
struct s_tb_button * instance)
{
@@ -301,9 +320,24 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner)
toolbar_styles[t->style].font_height_pt * FONT_SIZE_SCALE;
toolbar_get_grect(t, TOOLBAR_AREA_URL, &url_area);
- url_area.g_h -= (TOOLBAR_URL_MARGIN_TOP + TOOLBAR_URL_MARGIN_BOTTOM);
- t->url.textarea = textarea_create(300, url_area.g_h, 0, &font_style_url,
- tb_txt_request_redraw, t);
+ url_area.g_h -= (TOOLBAR_URL_MARGIN_TOP + TOOLBAR_URL_MARGIN_BOTTOM);
+
+ textarea_setup ta_setup;
+ ta_setup.flags = TEXTAREA_INTERNAL_CARET;
+ ta_setup.width = 300;
+ ta_setup.height = url_area.g_h;
+ ta_setup.pad_top = 0;
+ ta_setup.pad_right = 4;
+ ta_setup.pad_bottom = 0;
+ ta_setup.pad_left = 4;
+ ta_setup.border_width = 1;
+ ta_setup.border_col = 0x000000;
+ ta_setup.selected_text = 0xffffff;
+ ta_setup.selected_bg = 0x000000;
+ ta_setup.text = font_style_url;
+ ta_setup.text.foreground = 0x000000;
+ ta_setup.text.background = 0xffffff;
+ t->url.textarea = textarea_create(&ta_setup, tb_txt_callback, t);
/* create the throbber widget: */
t->throbber.index = THROBBER_INACTIVE_INDEX;
@@ -436,7 +470,7 @@ void toolbar_redraw(struct s_toolbar *tb, GRECT *clip)
};
//dbg_rect("tb textarea clip: ", &r);
// TODO: let this be handled by an userdef object redraw function:
- textarea_redraw(tb->url.textarea, 0, 0, &r, &toolbar_rdrw_ctx);
+ textarea_redraw(tb->url.textarea, 0, 0, 0xffffff, &r,
&toolbar_rdrw_ctx);
}
}
@@ -763,8 +797,9 @@ void toolbar_mouse_input(struct s_toolbar *tb, short obj, short
button)
mx = mx - (work.g_x + TOOLBAR_URL_MARGIN_LEFT);
my = my - (work.g_y + TOOLBAR_URL_MARGIN_TOP);
} while (mb & 1);
-
- textarea_drag_end( tb->url.textarea, 0, mx, my);
+
+ textarea_mouse_action( tb->url.textarea, BROWSER_MOUSE_HOVER, mx,
+ my);
}
else if (button & 2) {
// TODO: open a context popup
-----------------------------------------------------------------------
Summary of changes:
atari/toolbar.c | 47 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 41 insertions(+), 6 deletions(-)
diff --git a/atari/toolbar.c b/atari/toolbar.c
index 56d3b04..480b699 100644
--- a/atari/toolbar.c
+++ b/atari/toolbar.c
@@ -213,6 +213,25 @@ static void tb_txt_request_redraw(void *data, int x, int y, int w,
int h)
return;
}
+static void tb_txt_callback(void *data, struct textarea_msg *msg)
+{
+ switch (msg->type) {
+
+ case TEXTAREA_MSG_DRAG_REPORT:
+ break;
+
+ case TEXTAREA_MSG_REDRAW_REQUEST:
+ tb_txt_request_redraw(data,
+ msg->data.redraw.x0, msg->data.redraw.y0,
+ msg->data.redraw.x1 - msg->data.redraw.x0,
+ msg->data.redraw.y1 - msg->data.redraw.y0);
+ break;
+
+ default:
+ break;
+ }
+}
+
static struct s_tb_button *button_init(struct s_toolbar *tb, OBJECT * tree, int index,
struct s_tb_button * instance)
{
@@ -301,9 +320,24 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner)
toolbar_styles[t->style].font_height_pt * FONT_SIZE_SCALE;
toolbar_get_grect(t, TOOLBAR_AREA_URL, &url_area);
- url_area.g_h -= (TOOLBAR_URL_MARGIN_TOP + TOOLBAR_URL_MARGIN_BOTTOM);
- t->url.textarea = textarea_create(300, url_area.g_h, 0, &font_style_url,
- tb_txt_request_redraw, t);
+ url_area.g_h -= (TOOLBAR_URL_MARGIN_TOP + TOOLBAR_URL_MARGIN_BOTTOM);
+
+ textarea_setup ta_setup;
+ ta_setup.flags = TEXTAREA_INTERNAL_CARET;
+ ta_setup.width = 300;
+ ta_setup.height = url_area.g_h;
+ ta_setup.pad_top = 0;
+ ta_setup.pad_right = 4;
+ ta_setup.pad_bottom = 0;
+ ta_setup.pad_left = 4;
+ ta_setup.border_width = 1;
+ ta_setup.border_col = 0x000000;
+ ta_setup.selected_text = 0xffffff;
+ ta_setup.selected_bg = 0x000000;
+ ta_setup.text = font_style_url;
+ ta_setup.text.foreground = 0x000000;
+ ta_setup.text.background = 0xffffff;
+ t->url.textarea = textarea_create(&ta_setup, tb_txt_callback, t);
/* create the throbber widget: */
t->throbber.index = THROBBER_INACTIVE_INDEX;
@@ -436,7 +470,7 @@ void toolbar_redraw(struct s_toolbar *tb, GRECT *clip)
};
//dbg_rect("tb textarea clip: ", &r);
// TODO: let this be handled by an userdef object redraw function:
- textarea_redraw(tb->url.textarea, 0, 0, &r, &toolbar_rdrw_ctx);
+ textarea_redraw(tb->url.textarea, 0, 0, 0xffffff, &r,
&toolbar_rdrw_ctx);
}
}
@@ -763,8 +797,9 @@ void toolbar_mouse_input(struct s_toolbar *tb, short obj, short
button)
mx = mx - (work.g_x + TOOLBAR_URL_MARGIN_LEFT);
my = my - (work.g_y + TOOLBAR_URL_MARGIN_TOP);
} while (mb & 1);
-
- textarea_drag_end( tb->url.textarea, 0, mx, my);
+
+ textarea_mouse_action( tb->url.textarea, BROWSER_MOUSE_HOVER, mx,
+ my);
}
else if (button & 2) {
// TODO: open a context popup
--
NetSurf Browser