Use interface to set drag type. Longer term, it would be better to avoid using bw altogether.

This commit is contained in:
Michael Drake 2012-08-18 22:45:17 +01:00
parent 5a2d4c6ddb
commit c4b284e43c
1 changed files with 4 additions and 3 deletions

View File

@ -628,7 +628,7 @@ void textplain_mouse_track(struct content *c, struct browser_window *bw,
{
textplain_content *text = (textplain_content *) c;
if (bw->drag_type == DRAGGING_SELECTION && !mouse) {
if (browser_window_get_drag_type(bw) == DRAGGING_SELECTION && !mouse) {
int dir = -1;
size_t idx;
@ -641,7 +641,7 @@ void textplain_mouse_track(struct content *c, struct browser_window *bw,
browser_window_set_drag_type(bw, DRAGGING_NONE, NULL);
}
switch (bw->drag_type) {
switch (browser_window_get_drag_type(bw)) {
case DRAGGING_SELECTION: {
int dir = -1;
@ -687,7 +687,8 @@ void textplain_mouse_action(struct content *c, struct browser_window *bw,
if (selection_click(&text->sel, mouse, idx)) {
if (selection_dragging(&text->sel)) {
bw->drag_type = DRAGGING_SELECTION;
browser_window_set_drag_type(bw,
DRAGGING_SELECTION, NULL);
status = messages_get("Selecting");
}
else