mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
Remove redundant scrollbar widget message.
This commit is contained in:
parent
e5928ebd5f
commit
4872bc30b8
@ -59,9 +59,6 @@ void browser_window_scroll_callback(void *client_data,
|
||||
struct browser_window *bw = client_data;
|
||||
|
||||
switch(scrollbar_data->msg) {
|
||||
case SCROLLBAR_MSG_REDRAW:
|
||||
/* TODO: Is this needed? */
|
||||
break;
|
||||
case SCROLLBAR_MSG_MOVED:
|
||||
if (bw->browser_window_type == BROWSER_WINDOW_IFRAME) {
|
||||
html_redraw_a_box(bw->parent->current_content, bw->box);
|
||||
|
@ -427,16 +427,6 @@ void scrollbar_set(struct scrollbar *s, int value, bool bar_pos)
|
||||
msg.msg = SCROLLBAR_MSG_MOVED;
|
||||
msg.scroll_offset = s->offset;
|
||||
s->client_callback(s->client_data, &msg);
|
||||
|
||||
msg.msg = SCROLLBAR_MSG_REDRAW;
|
||||
msg.x0 = s->horizontal ? SCROLLBAR_WIDTH - 1 : 0;
|
||||
msg.y0 = s->horizontal ? 0 : SCROLLBAR_WIDTH - 1;
|
||||
msg.x1 = (s->horizontal ? s->length - SCROLLBAR_WIDTH + 1 :
|
||||
SCROLLBAR_WIDTH);
|
||||
msg.y1 = (s->horizontal ? SCROLLBAR_WIDTH :
|
||||
s->length - SCROLLBAR_WIDTH + 1);
|
||||
|
||||
s->client_callback(s->client_data, &msg);
|
||||
}
|
||||
|
||||
|
||||
@ -498,16 +488,6 @@ bool scrollbar_scroll(struct scrollbar *s, int change)
|
||||
msg.scroll_offset = s->offset;
|
||||
s->client_callback(s->client_data, &msg);
|
||||
|
||||
msg.msg = SCROLLBAR_MSG_REDRAW;
|
||||
msg.x0 = s->horizontal ? SCROLLBAR_WIDTH - 1 : 0;
|
||||
msg.y0 = s->horizontal ? 0 : SCROLLBAR_WIDTH - 1;
|
||||
msg.x1 = (s->horizontal ? s->length - SCROLLBAR_WIDTH + 1 :
|
||||
SCROLLBAR_WIDTH);
|
||||
msg.y1 = (s->horizontal ? SCROLLBAR_WIDTH :
|
||||
s->length - SCROLLBAR_WIDTH + 1);
|
||||
|
||||
s->client_callback(s->client_data, &msg);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
struct scrollbar;
|
||||
|
||||
typedef enum {
|
||||
SCROLLBAR_MSG_REDRAW, /* the scrollbar requests a redraw */
|
||||
SCROLLBAR_MSG_MOVED, /* the scroll value has changed */
|
||||
SCROLLBAR_MSG_SCROLL_START, /* a scrollbar drag has started, all
|
||||
* mouse events should be passed to
|
||||
@ -47,7 +46,6 @@ typedef enum {
|
||||
* coordinates
|
||||
*/
|
||||
SCROLLBAR_MSG_SCROLL_FINISHED, /* cancel the above */
|
||||
|
||||
} scrollbar_msg;
|
||||
|
||||
struct scrollbar_msg_data {
|
||||
|
@ -1272,18 +1272,10 @@ void form_select_menu_scroll_callback(void *client_data,
|
||||
html_content *html = (html_content *)menu->c;
|
||||
|
||||
switch (scrollbar_data->msg) {
|
||||
case SCROLLBAR_MSG_REDRAW:
|
||||
menu->callback(menu->client_data,
|
||||
menu->width -
|
||||
SCROLLBAR_WIDTH + scrollbar_data->x0,
|
||||
scrollbar_data->y0,
|
||||
scrollbar_data->x1 - scrollbar_data->x0,
|
||||
scrollbar_data->y1 - scrollbar_data->y0);
|
||||
break;
|
||||
case SCROLLBAR_MSG_MOVED:
|
||||
menu->callback(menu->client_data,
|
||||
0, 0,
|
||||
menu->width - SCROLLBAR_WIDTH,
|
||||
menu->width,
|
||||
menu->height);
|
||||
break;
|
||||
case SCROLLBAR_MSG_SCROLL_START:
|
||||
|
@ -833,32 +833,8 @@ void html_overflow_scroll_callback(void *client_data,
|
||||
struct html_scrollbar_data *data = client_data;
|
||||
html_content *html = (html_content *)data->c;
|
||||
struct box *box = data->box;
|
||||
int x, y, box_x, box_y, diff_x, diff_y;
|
||||
|
||||
switch(scrollbar_data->msg) {
|
||||
case SCROLLBAR_MSG_REDRAW:
|
||||
diff_x = box->padding[LEFT] + box->width +
|
||||
box->padding[RIGHT] - SCROLLBAR_WIDTH;
|
||||
diff_y = box->padding[TOP] + box->height +
|
||||
box->padding[BOTTOM] - SCROLLBAR_WIDTH;
|
||||
|
||||
box_coords(box, &box_x, &box_y);
|
||||
if (scrollbar_is_horizontal(
|
||||
scrollbar_data->scrollbar)) {
|
||||
x = box_x + scrollbar_get_offset(box->scroll_x);
|
||||
y = box_y + scrollbar_get_offset(box->scroll_y) +
|
||||
diff_y;
|
||||
} else {
|
||||
x = box_x + scrollbar_get_offset(box->scroll_x) +
|
||||
diff_x;
|
||||
y = box_y + scrollbar_get_offset(box->scroll_y);
|
||||
}
|
||||
content__request_redraw((struct content *)html,
|
||||
x + scrollbar_data->x0,
|
||||
y + scrollbar_data->y0,
|
||||
scrollbar_data->x1 - scrollbar_data->x0,
|
||||
scrollbar_data->y1 - scrollbar_data->y0);
|
||||
break;
|
||||
case SCROLLBAR_MSG_MOVED:
|
||||
html_redraw_a_box(html->bw->current_content, box);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user