~dbarth/compiz/reworked-fix-744104

« back to all changes in this revision

Viewing changes to unity/unity_window_decorator/src/style.c

  • Committer: David Barth
  • Date: 2011-04-05 20:20:54 UTC
  • Revision ID: david.barth@canonical.com-20110405202054-fnh0y5t2s228mf4k
re-integrate the unity-window-decorator, for real this time

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "gtk-window-decorator.h"
 
2
 
 
3
void
 
4
update_style (GtkWidget *widget)
 
5
{
 
6
    GtkStyle      *style;
 
7
    decor_color_t spot_color;
 
8
    
 
9
    style = gtk_widget_get_style (widget);
 
10
    g_object_ref (G_OBJECT (style));
 
11
    
 
12
    style = gtk_style_attach (style, widget->window);
 
13
    
 
14
    spot_color.r = style->bg[GTK_STATE_SELECTED].red   / 65535.0;
 
15
    spot_color.g = style->bg[GTK_STATE_SELECTED].green / 65535.0;
 
16
    spot_color.b = style->bg[GTK_STATE_SELECTED].blue  / 65535.0;
 
17
    
 
18
    g_object_unref (G_OBJECT (style));
 
19
    
 
20
    shade (&spot_color, &_title_color[0], 1.05);
 
21
    shade (&_title_color[0], &_title_color[1], 0.85);
 
22
    
 
23
}
 
24
 
 
25
void
 
26
style_changed (GtkWidget *widget)
 
27
{
 
28
    GdkDisplay *gdkdisplay;
 
29
    GdkScreen  *gdkscreen;
 
30
    WnckScreen *screen;
 
31
 
 
32
    gdkdisplay = gdk_display_get_default ();
 
33
    gdkscreen  = gdk_display_get_default_screen (gdkdisplay);
 
34
    screen     = wnck_screen_get_default ();
 
35
 
 
36
    update_style (widget);
 
37
 
 
38
    pango_cairo_context_set_resolution (pango_context,
 
39
                                        gdk_screen_get_resolution (gdkscreen));
 
40
 
 
41
    decorations_changed (screen);
 
42
}