~macslow/notify-osd/fix.810325-2

« back to all changes in this revision

Viewing changes to src/bubble.c

  • Committer: Mirco Müller
  • Date: 2012-02-07 12:09:33 UTC
  • mfrom: (442.2.3 notify-osd)
  • Revision ID: mirco.mueller@canonical.com-20120207120933-3zv9gpspva6a19eh
Update the branch to latest trunk and add a runtime-test for the Unity schema and its avg. bg-color key, thus notify-osd doesn't crash, if those aren't available

Show diffs side-by-side

added added

removed removed

Lines of Context:
663
663
        }
664
664
 
665
665
        // clear, render top-left part of shadow/background in scratch-surface
666
 
        cairo_scale (cr, 1.0f, 1.0f);
 
666
    cairo_scale (cr, 1.0f, 1.0f);
667
667
        cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
668
668
        cairo_paint (cr);
669
669
        cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
670
670
 
 
671
        GdkColor color;
 
672
        gchar* color_string = NULL;
 
673
    color_string = defaults_get_bubble_bg_color (d);
 
674
        gdk_color_parse (color_string, &color);
 
675
    g_free (color_string);
 
676
        
671
677
        if (priv->composited)
672
678
        {
673
679
                _draw_shadow (
689
695
                cairo_fill (cr);
690
696
                cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
691
697
                cairo_set_source_rgba (cr,
692
 
                                       BUBBLE_BG_COLOR_R,
693
 
                                       BUBBLE_BG_COLOR_G,
694
 
                                       BUBBLE_BG_COLOR_B,
 
698
                                       0.75 * ((double) color.red / 65535.0),
 
699
                                       0.75 * ((double) color.green / 65535.0),
 
700
                                       0.75 * ((double) color.blue / 65535.0),
695
701
                                       BUBBLE_BG_COLOR_A);
696
702
        }
697
703
        else
698
704
                cairo_set_source_rgb (cr,
699
 
                                      BUBBLE_BG_COLOR_R,
700
 
                                      BUBBLE_BG_COLOR_G,
701
 
                                      BUBBLE_BG_COLOR_B);
 
705
                                       0.75 * ((double) color.red / 65535.0),
 
706
                                       0.75 * ((double) color.green / 65535.0),
 
707
                                       0.75 * ((double) color.blue / 65535.0));
702
708
 
703
709
        draw_round_rect (
704
710
                cr,