diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 21:26:53 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 21:26:53 +0200 |
commit | df247efec654e512242e4f4f1b0212034f9e01fe (patch) | |
tree | 25c02e16957f3aa613af30c140fd8e8a3d52fda6 /app/wlib/gtklib/control.c | |
parent | d0b6a8a4ec298024f14f704f9e40a6f9d324ccf3 (diff) | |
parent | a5ade52caa489cf0a713e0f02b764000d203140e (diff) |
Merge branch 'release/debian/1%5.2.0Beta2.1-1' into masterHEADdebian/1%5.2.0Beta2.1-1master
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); } |