summaryrefslogtreecommitdiff
path: root/src/html.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2011-09-12 17:51:40 +0200
committerportix <portix@gmx.net>2011-09-12 17:51:40 +0200
commit8411746e65e6a2f859b584ff6b7901b566c84e9f (patch)
tree366507fca4060ca29e3ddb63a6e81abad09221b8 /src/html.c
parenta58aee584039682c714b29faa268d29a86c8f921 (diff)
downloaddwb-8411746e65e6a2f859b584ff6b7901b566c84e9f.zip
Automated creation of settings, fix of small mode-issue in settings-view
--HG-- branch : develop
Diffstat (limited to 'src/html.c')
-rw-r--r--src/html.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/html.c b/src/html.c
index cfcfeb76..3c4b6027 100644
--- a/src/html.c
+++ b/src/html.c
@@ -101,10 +101,19 @@ dwb_html_settings_changed_cb(WebKitDOMElement *el, WebKitDOMEvent *ev, WebKitWeb
return true;
}
gboolean
-dwb_html_focus_cb(WebKitDOMElement *el, WebKitDOMEvent *ev, WebKitWebView *wv) {
- dwb_insert_mode(NULL);
+dwb_html_settings_really_changed_cb(WebKitDOMElement *el, WebKitDOMEvent *ev, WebKitWebView *wv) {
+ webkit_dom_element_blur(el);
return true;
}
+gboolean
+dwb_html_focus_cb(WebKitDOMElement *el, WebKitDOMEvent *ev, WebKitWebView *wv) {
+ char *type = webkit_dom_element_get_attribute(el, "type");
+ if (!strcmp(type, "text")) {
+ dwb_insert_mode(NULL);
+ return true;
+ }
+ return false;
+}
void
dwb_html_settings_fill(char *key, WebSettings *s, WebKitWebView *wv) {
char *value = dwb_util_arg_to_char(&s->arg, s->type);
@@ -117,7 +126,7 @@ dwb_html_settings_fill(char *key, WebSettings *s, WebKitWebView *wv) {
webkit_dom_html_input_element_set_value(WEBKIT_DOM_HTML_INPUT_ELEMENT(e), value);
g_free(value);
}
- webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(e), "change", G_CALLBACK(dwb_html_settings_changed_cb), false, wv);
+ webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(e), "change", G_CALLBACK(dwb_html_settings_really_changed_cb), false, wv);
webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(e), "blur", G_CALLBACK(dwb_html_settings_changed_cb), false, wv);
webkit_dom_event_target_add_event_listener(WEBKIT_DOM_EVENT_TARGET(e), "focus", G_CALLBACK(dwb_html_focus_cb), false, wv);
}