diff options
author | Daniel Carl <danielcarl@gmx.de> | 2012-12-23 02:40:42 +0100 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2012-12-23 02:40:42 +0100 |
commit | 06e7ae451015635c07b79f019c5ef0870c53f8bc (patch) | |
tree | dbdba09b75ba9ce4dccd71e5e106c54fe8c89a54 /src/hints.c | |
parent | e8f998d384578e9fac75a3e85448fee3313b1840 (diff) |
Allow to set hint element style on runtime.
Diffstat (limited to 'src/hints.c')
-rw-r--r-- | src/hints.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/hints.c b/src/hints.c index 8f81cdb..906207e 100644 --- a/src/hints.c +++ b/src/hints.c @@ -27,10 +27,6 @@ #define HINT_CONTAINER_ID "__hint_container" #define HINT_CLASS "__hint" -#define ELEM_BACKGROUND "#ff0" -#define ELEM_BACKGROUND_FOCUS "#8f0" -#define ELEM_COLOR "#000" - #define HINT_CONTAINER_STYLE "line-height:1em;" #define HINT_STYLE "z-index:100000;"\ "position:absolute;"\ @@ -293,8 +289,8 @@ static void hints_create_for_window(const gchar* input, Window* win, gulong hint g_free(num); /* change the style of the hinted element */ - dom_element_style_set_property(newHint->elem, "background-color", ELEM_BACKGROUND); - dom_element_style_set_property(newHint->elem, "color", ELEM_COLOR); + dom_element_style_set_property(newHint->elem, "background-color", vp.style.hint_bg); + dom_element_style_set_property(newHint->elem, "color", vp.style.hint_fg); webkit_dom_node_append_child(WEBKIT_DOM_NODE(container), WEBKIT_DOM_NODE(hint), NULL); } @@ -322,7 +318,7 @@ static void hints_focus(const gulong num) Hint* hint = hints_get_hint_by_number(vp.hints.focusNum); if (hint) { /* reset previous focused element */ - dom_element_style_set_property(hint->elem, "background-color", ELEM_BACKGROUND); + dom_element_style_set_property(hint->elem, "background-color", vp.style.hint_bg); doc = webkit_dom_node_get_owner_document(WEBKIT_DOM_NODE(hint->elem)); dom_dispatch_mouse_event(doc, hint->elem, "mouseout", 0); @@ -331,7 +327,7 @@ static void hints_focus(const gulong num) hint = hints_get_hint_by_number(num); if (hint) { /* mark new hint as focused */ - dom_element_style_set_property(hint->elem, "background-color", ELEM_BACKGROUND_FOCUS); + dom_element_style_set_property(hint->elem, "background-color", vp.style.hint_bg_focus); doc = webkit_dom_node_get_owner_document(WEBKIT_DOM_NODE(hint->elem)); dom_dispatch_mouse_event(doc, hint->elem, "mouseover", 0); |