mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-28 17:23:09 +03:00
Handle focus event within window_set_focus, select all when url input gets focus
svn path=/trunk/netsurf/; revision=13206
This commit is contained in:
parent
4313de0584
commit
dbffd36e14
@ -57,6 +57,7 @@
|
||||
#include "atari/search.h"
|
||||
#include "atari/osspec.h"
|
||||
#include "atari/encoding.h"
|
||||
#include "atari/toolbar.h"
|
||||
|
||||
extern void * h_gem_rsrc;
|
||||
extern struct gui_window *input_window;
|
||||
@ -351,7 +352,16 @@ void window_set_focus( struct gui_window * gw, enum focus_element_type type, voi
|
||||
if( gw->root->focus.type != type || gw->root->focus.element != element ) {
|
||||
LOG(("Set focus: %p (%d)\n", element, type));
|
||||
gw->root->focus.type = type;
|
||||
gw->root->focus.element = element;
|
||||
gw->root->focus.element = element;
|
||||
switch( type ){
|
||||
|
||||
case URL_WIDGET:
|
||||
textarea_keypress( ((struct s_url_widget*)(element))->textarea, KEY_SELECT_ALL );
|
||||
break;
|
||||
|
||||
default: break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -312,12 +312,10 @@ void __CDECL evnt_url_click( COMPONENT *c, long buff[8] )
|
||||
/* TODO: reset mouse state of browser window? */
|
||||
/* select whole text when newly focused, otherwise set caret to end of text */
|
||||
if( !window_url_widget_has_focus(gw) ) {
|
||||
// TODO select all ( needs textarea change )
|
||||
window_set_focus( gw, URL_WIDGET, (void*)&tb->url );
|
||||
textarea_mouse_action( tb->url.textarea, BROWSER_MOUSE_PRESS_1, mx, my );
|
||||
} else {
|
||||
if( mb & 1 ) {
|
||||
/* TODO: if the button is dragging, report draw event */
|
||||
/* TODO: if the button is dragging, report drag event */
|
||||
} else {
|
||||
/* TODO: recognize click + shift key */
|
||||
int mstate = BROWSER_MOUSE_PRESS_1;
|
||||
|
Loading…
Reference in New Issue
Block a user