From b623f5953691b2a0614e6f1f4def86bdbb9a4113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Aug 2020 11:53:00 +0200 Subject: New upstream version 5.2.0Beta2.1 --- app/wlib/gtklib/control.c | 59 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 14 deletions(-) (limited to 'app/wlib/gtklib/control.c') 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 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); } -- cgit v1.2.3