pidgin/gtkconv.c

changeset 35533
8ca83abbc248
parent 35528
e04ba70092e9
child 35548
e3ee59a7965c
child 37110
4309235d2a46
equal deleted inserted replaced
35532:2c802bb77720 35533:8ca83abbc248
228 #endif 228 #endif
229 static GdkColor col; 229 static GdkColor col;
230 float scale; 230 float scale;
231 231
232 col = g_array_index(gtkconv->nick_colors, GdkColor, g_str_hash(name) % gtkconv->nick_colors->len); 232 col = g_array_index(gtkconv->nick_colors, GdkColor, g_str_hash(name) % gtkconv->nick_colors->len);
233
234 g_return_val_if_fail(style != NULL, &col);
235
233 #if GTK_CHECK_VERSION(3,0,0) 236 #if GTK_CHECK_VERSION(3,0,0)
234 gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &rgba); 237 gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &rgba);
235 scale = (1 - LUMINANCE(rgba)) * ((float)0xffff / MAX(MAX(col.red, col.blue), col.green)); 238 scale = (1 - LUMINANCE(rgba)) * ((float)0xffff / MAX(MAX(col.red, col.blue), col.green));
236 #else 239 #else
237 scale = ((1-(LUMINANCE(style->base[GTK_STATE_NORMAL]) / LUMINANCE(style->white))) * 240 scale = ((1-(LUMINANCE(style->base[GTK_STATE_NORMAL]) / LUMINANCE(style->white))) *

mercurial