diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-22 14:05:41 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-22 14:05:41 +0200 |
commit | b55285a77da0e0b829e4ce8d7e09debaabc68e15 (patch) | |
tree | f622559ef65bbdd3e1c5bdb06098a8f89eec0563 /app/wlib/gtklib/control.c | |
parent | d3897ce090dbeb220ed2c782f095597e417cf3cc (diff) | |
parent | d1ae75703e1ed81d65ea16946dcdb77e7a13adc9 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'app/wlib/gtklib/control.c')
-rw-r--r-- | app/wlib/gtklib/control.c | 59 |
1 files changed, 45 insertions, 14 deletions
diff --git a/app/wlib/gtklib/control.c b/app/wlib/gtklib/control.c index c891924..07d9210 100644 --- a/app/wlib/gtklib/control.c +++ b/app/wlib/gtklib/control.c @@ -35,7 +35,7 @@ #include "gtkint.h" -#define GTKCONTROLHILITEWIDTH (3) +#define GTKCONTROLHILITEWIDTH (4) /** * Cause the control <b> to be displayed or hidden. @@ -252,6 +252,46 @@ void wControlSetFocus( { } +wBool_t wControlExpose ( + GtkWidget * widget, + GdkEventExpose * event, + wControl_p b + ) +{ + GdkWindow * win = gtk_widget_get_window(b->widget); + cairo_t * cr = NULL; + if (win) { + cr = gdk_cairo_create(win); + } else return TRUE; + +#ifdef CURSOR_SURFACE + if (b && b->cursor_surface.surface && b->cursor_surface.show) { + cairo_set_source_surface(cr,b->cursor_surface.surface,event->area.x, event->area.y); + cairo_set_operator(cr,CAIRO_OPERATOR_OVER); + cairo_rectangle(cr,event->area.x, event->area.y, + event->area.width, event->area.height); + cairo_fill(cr); + } +#endif + + if (b->outline) { + cairo_set_source_rgb(cr, 0.23, 0.37, 0.80); + cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); + cairo_set_line_width(cr, GTKCONTROLHILITEWIDTH); + cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); + cairo_set_line_join(cr, CAIRO_LINE_JOIN_MITER); + cairo_rectangle(cr,event->area.x+2, event->area.y+2, + event->area.width-4, event->area.height-4); + cairo_stroke(cr); + } + + + cairo_destroy(cr); + + + return FALSE; +} + /** * Draw a rectangle around a control * \param b IN the control @@ -279,17 +319,8 @@ void wControlHilite( return; } - cr = gdk_cairo_create(gtk_widget_get_window(b->parent->gtkwin)); - cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); - cairo_set_operator(cr, CAIRO_OPERATOR_XOR); - cairo_set_line_width(cr, GTKCONTROLHILITEWIDTH); - cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); - cairo_set_line_join(cr, CAIRO_LINE_JOIN_MITER); - cairo_rectangle(cr, - b->realX - GTKCONTROLHILITEWIDTH, - b->realY - off, - b->w + GTKCONTROLHILITEWIDTH, - b->h + off + 1); - cairo_stroke(cr); - cairo_destroy(cr); + b->outline = hilite; + + if (b->widget) + gtk_widget_queue_draw(b->widget); } |