diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-08 11:53:00 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-08 11:53:00 +0200 |
commit | b623f5953691b2a0614e6f1f4def86bdbb9a4113 (patch) | |
tree | 18102bd36f7e22eb2ba2b9f880e4cb29346f4cb8 /app/wlib/gtklib/control.c | |
parent | 359b557176b9bb2ff1aed2082641eed39c358d0d (diff) |
New upstream version 5.2.0Beta2.1upstream/5.2.0Beta2.1
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); } |