[evolution/gnome-3-22] [EWeekdayChooser] Selected days drawn with incorrect color



commit ca279764b46a0d545b528a1066d39edd7e155c24
Author: Milan Crha <mcrha redhat com>
Date:   Mon Feb 20 15:28:38 2017 +0100

    [EWeekdayChooser] Selected days drawn with incorrect color
    
    While the selected days in Recurrences tab of an appointment's
    week(s) occurrence type were meant to be drawn with selected color
    background, it wasn't the case, thus it could be hard to notice
    on some themes, notably on a GNOME dark theme.
    
    This had been filled downstream as:
    https://bugzilla.redhat.com/show_bug.cgi?id=1424729

 libgnomecanvas/gnome-canvas-rect.c |   37 ++++++++++++++---------------------
 1 files changed, 15 insertions(+), 22 deletions(-)
---
diff --git a/libgnomecanvas/gnome-canvas-rect.c b/libgnomecanvas/gnome-canvas-rect.c
index eefdb12..0a2089d 100644
--- a/libgnomecanvas/gnome-canvas-rect.c
+++ b/libgnomecanvas/gnome-canvas-rect.c
@@ -89,9 +89,17 @@ G_DEFINE_TYPE (GnomeCanvasRect, gnome_canvas_rect, GNOME_TYPE_CANVAS_ITEM)
 static guint32
 get_rgba_from_color (GdkColor *color)
 {
-       return ((color->red & 0xff00) << 16) |
-               ((color->green & 0xff00) << 8) |
-               (color->blue & 0xff00) | 0xff;
+       guint32 rr, gg, bb, aa;
+
+       rr = 0xFF * color->red / 65535.0;
+       gg = 0xFF * color->green / 65535.0;
+       bb = 0xFF * color->blue / 65535.0;
+       aa = 0xFF;
+
+       return (rr & 0xFF) << 24 |
+               (gg & 0xFF) << 16 |
+               (bb & 0xFF) << 8 |
+               (aa & 0xFF);
 }
 
 static gboolean
@@ -480,28 +488,13 @@ gnome_canvas_rect_bounds (GnomeCanvasItem *item,
                           gdouble *y2)
 {
        GnomeCanvasRect *rect;
-       cairo_t *cr;
 
        rect = GNOME_CANVAS_RECT (item);
 
-       cr = gnome_canvas_cairo_create_scratch ();
-
-       cairo_rectangle (
-               cr,
-               rect->priv->x1,
-               rect->priv->y1,
-               rect->priv->x2 - rect->priv->x1,
-               rect->priv->y2 - rect->priv->y1);
-
-       if (gnome_canvas_rect_setup_for_stroke (rect, cr))
-               cairo_stroke_extents (cr, x1, y1, x2, y2);
-       else if (gnome_canvas_rect_setup_for_fill (rect, cr))
-               cairo_fill_extents (cr, x1, y1, x2, y2);
-       else {
-               *x1 = *x2 = *y1 = *y2 = 0;
-       }
-
-       cairo_destroy (cr);
+       *x1 = rect->priv->x1;
+       *y1 = rect->priv->y1;
+       *x2 = rect->priv->x2;
+       *y2 = rect->priv->y2;
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]