858
858
murrine_style_draw_option (DRAW_ARGS)
860
860
MurrineStyle *murrine_style = MURRINE_STYLE (style);
861
MurrineColors *colors = &murrine_style->colors;
863
WidgetParameters params;
865
cr = murrine_begin_paint (window, area);
867
murrine_sanitize_size (window, &width, &height);
869
murrine_set_widget_parameters (widget, style, state_type, ¶ms);
871
params.hilight_ratio = murrine_style->hilight_ratio;
872
params.glazestyle = murrine_style->glazestyle;
873
params.gradients = murrine_style->gradients;
875
OptionParameters option;
877
option.draw_bullet = ((shadow_type == GTK_SHADOW_IN) || (shadow_type == GTK_SHADOW_ETCHED_IN));
878
option.inconsistent = (shadow_type == GTK_SHADOW_ETCHED_IN);
863
879
double trans = 1.0;
864
gboolean draw_bullet = (shadow_type == GTK_SHADOW_IN);
866
cairo_t *cr = murrine_begin_paint (window, area);
869
#ifdef HAVE_ANIMATION
870
if (murrine_style->animation)
871
murrine_animation_connect_checkbox (widget);
874
if (state_type == GTK_STATE_INSENSITIVE)
876
border = &murrine_style->colors.shade[3];
877
dot = &murrine_style->colors.shade[3];
881
border = &murrine_style->colors.shade[5];
883
border = &murrine_style->colors.spot[2];
884
dot = &murrine_style->colors.text[state_type];
887
murrine_shade (border, &shadow, 0.9);
889
cairo_translate (cr, x, y);
891
cairo_set_line_width (cr, 2);
892
cairo_arc (cr, 7, 7, 6, 0, M_PI*2);
893
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.15);
896
cairo_set_line_width (cr, 1);
898
cairo_arc (cr, 7, 7, 5.5, 0, M_PI*2);
900
if (state_type != GTK_STATE_INSENSITIVE)
902
MurrineRGB *bg = &murrine_style->colors.base[0];
904
bg = &murrine_style->colors.spot[1];
905
if (murrine_style->glazestyle != 2) {
907
murrine_shade (bg, &hilight, 1.1*murrine_style->hilight_ratio);
908
murrine_set_gradient (cr, &hilight, 1.1, 0, 14, murrine_style->gradients, FALSE);
881
#ifdef HAVE_ANIMATION
882
if (murrine_style->animation)
883
murrine_animation_connect_checkbox (widget);
885
if (murrine_style->animation && GTK_IS_CHECK_BUTTON (widget) && murrine_animation_is_animated (widget) && !gtk_toggle_button_get_inconsistent (GTK_TOGGLE_BUTTON (widget)))
887
gfloat elapsed = murrine_animation_elapsed (widget);
888
trans = sqrt (sqrt (MIN(elapsed / CHECK_ANIMATION_TIME, 1.0)));
911
murrine_set_gradient (cr, bg, 1.1, 0, 14, murrine_style->gradients, FALSE);
912
cairo_fill_preserve (cr);
915
cairo_set_source_rgb (cr, border->r, border->g, border->b);
918
cairo_arc (cr, 7, 7, 5, 0, M_PI*2);
921
if (state_type != GTK_STATE_INSENSITIVE)
923
MurrineRGB *bg = &murrine_style->colors.base[0];
925
bg = &murrine_style->colors.spot[1];
927
cairo_rectangle (cr, 0, 7, width, height);
928
if (murrine_style->glazestyle == 2) {
930
murrine_shade (bg, &hilight, 1.1*murrine_style->hilight_ratio);
931
murrine_set_gradient (cr, &hilight, 1.1, 0, 14, murrine_style->gradients, FALSE);
934
murrine_set_gradient (cr, bg, 1.1, 0, 14, murrine_style->gradients, FALSE);
939
#ifdef HAVE_ANIMATION
940
if (murrine_style->animation && GTK_IS_CHECK_BUTTON (widget) &&
941
murrine_animation_is_animated (widget) &&
942
!gtk_toggle_button_get_inconsistent (GTK_TOGGLE_BUTTON (widget)))
944
gfloat elapsed = murrine_animation_elapsed (widget);
947
trans = sqrt (sqrt (MIN(elapsed / CHECK_ANIMATION_TIME, 1.0)));
949
trans = 1.0 - sqrt (sqrt (MIN(elapsed / CHECK_ANIMATION_TIME, 1.0)));
955
/* inconsistent state is missing? */
958
cairo_arc (cr, 7, 7, 2, 0, M_PI*2);
959
//cairo_set_source_rgb (cr, dot->r, dot->g, dot->b);
960
cairo_set_source_rgba (cr, dot->r, dot->g, dot->b,trans);
892
murrine_draw_radiobutton (cr, colors, ¶ms, &option, x, y, width, height, trans);
964
894
cairo_destroy (cr);
968
898
murrine_style_draw_check (DRAW_ARGS)
970
900
MurrineStyle *murrine_style = MURRINE_STYLE (style);
901
MurrineColors *colors = &murrine_style->colors;
903
WidgetParameters params;
905
cr = murrine_begin_paint (window, area);
907
murrine_sanitize_size (window, &width, &height);
909
murrine_set_widget_parameters (widget, style, state_type, ¶ms);
911
params.hilight_ratio = murrine_style->hilight_ratio;
912
params.glazestyle = murrine_style->glazestyle;
913
params.gradients = murrine_style->gradients;
915
OptionParameters option;
917
option.draw_bullet = ((shadow_type == GTK_SHADOW_IN) || (shadow_type == GTK_SHADOW_ETCHED_IN));
918
option.inconsistent = (shadow_type == GTK_SHADOW_ETCHED_IN);
973
919
double trans = 1.0;
974
gboolean draw_bullet = (shadow_type == GTK_SHADOW_IN || shadow_type == GTK_SHADOW_ETCHED_IN);
976
cairo_t *cr = murrine_begin_paint (window, area);
979
#ifdef HAVE_ANIMATION
980
if (murrine_style->animation)
981
murrine_animation_connect_checkbox (widget);
984
if (state_type == GTK_STATE_INSENSITIVE)
986
border = &murrine_style->colors.shade[3];
987
dot = &murrine_style->colors.shade[3];
991
border = &murrine_style->colors.shade[5];
993
border = &murrine_style->colors.spot[2];
994
dot = &murrine_style->colors.text[state_type];
997
murrine_shade (border, &shadow, 0.9);
999
cairo_translate (cr, x, y);
1000
cairo_set_line_width (cr, 1);
1002
if (style->xthickness > 2 && style->ythickness > 2)
1004
cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
1005
cairo_set_source_rgba (cr, shadow.r, shadow.g, shadow.b, 0.15);
1008
/* Draw the rectangle for the checkbox itself */
1009
cairo_rectangle (cr, 1.5, 1.5, width-3, height-3);
1013
cairo_rectangle (cr, 0.5, 0.5, width-1, height-1);
1017
if (state_type != GTK_STATE_INSENSITIVE)
1019
MurrineRGB *bg = &murrine_style->colors.base[0];
1021
bg = &murrine_style->colors.spot[1];
1023
if (murrine_style->glazestyle == 2) {
1025
murrine_shade (bg, &hilight, 1.1*murrine_style->hilight_ratio);
1026
murrine_set_gradient (cr, &hilight, 1.1, 0, 14, murrine_style->gradients, FALSE);
1029
murrine_set_gradient (cr, bg, 1.1, 0, 14, murrine_style->gradients, FALSE);
1030
cairo_fill_preserve (cr);
1033
cairo_set_source_rgb (cr, border->r, border->g, border->b);
1036
if (state_type != GTK_STATE_INSENSITIVE)
1038
MurrineRGB *bg = &murrine_style->colors.base[0];
1040
bg = &murrine_style->colors.spot[1];
1043
murrine_shade (bg, &hilight, 1.1*murrine_style->hilight_ratio);
1044
if (style->xthickness > 2 && style->ythickness > 2)
1045
cairo_rectangle (cr, 2, 2, width-4, (height-4)/2);
1047
cairo_rectangle (cr, 1, 1, width-2, (height-2)/2);
1049
if (murrine_style->glazestyle != 2) {
1051
murrine_shade (bg, &hilight, 1.1*murrine_style->hilight_ratio);
1052
murrine_set_gradient (cr, &hilight, 1.1, 0, 14, murrine_style->gradients, FALSE);
1055
murrine_set_gradient (cr, bg, 1.1, 0, 14, murrine_style->gradients, FALSE);
1059
#ifdef HAVE_ANIMATION
1060
if (murrine_style->animation && GTK_IS_CHECK_BUTTON (widget) &&
1061
murrine_animation_is_animated(widget) &&
1062
!gtk_toggle_button_get_inconsistent (GTK_TOGGLE_BUTTON (widget)))
1064
gfloat elapsed = murrine_animation_elapsed (widget);
921
#ifdef HAVE_ANIMATION
922
if (murrine_style->animation)
923
murrine_animation_connect_checkbox (widget);
925
if (murrine_style->animation && GTK_IS_CHECK_BUTTON (widget) && murrine_animation_is_animated (widget) && !gtk_toggle_button_get_inconsistent (GTK_TOGGLE_BUTTON (widget)))
927
gfloat elapsed = murrine_animation_elapsed (widget);
1067
928
trans = sqrt (sqrt (MIN(elapsed / CHECK_ANIMATION_TIME, 1.0)));
1069
trans = 1.0 - sqrt (sqrt (MIN(elapsed / CHECK_ANIMATION_TIME, 1.0)));
932
murrine_draw_checkbutton (cr, colors, ¶ms, &option, x, y, width, height, trans);
1075
cairo_scale (cr, width / 13.0, height / 13.0);
1078
if (shadow_type == GTK_SHADOW_ETCHED_IN) /* Inconsistent */
1080
cairo_set_line_width (cr, 2.0);
1081
cairo_move_to (cr, 3, height*0.5);
1082
cairo_line_to (cr, width-3, height*0.5);
1085
cairo_translate (cr, -2, 0);
1087
if (widget && widget->parent && GTK_IS_MENU(widget->parent))
1088
cairo_translate (cr, 0, 0);
1090
cairo_move_to (cr, 4, 8);
1091
cairo_rel_line_to (cr, 5, 4);
1092
cairo_rel_curve_to (cr, 1.4, -5, -1, -1, 5.7, -12.5);
1093
cairo_rel_curve_to (cr, -4, 4, -4, 4, -6.7, 9.3);
1094
cairo_rel_line_to (cr, -2.3, -2.5);
1097
cairo_set_source_rgba (cr, dot->r, dot->g, dot->b, trans);
1100
934
cairo_destroy (cr);
1139
murrine_style_draw_layout (GtkStyle * style,
1141
GtkStateType state_type,
1143
GdkRectangle * area,
1145
const gchar * detail, gint x, gint y, PangoLayout * layout)
1149
g_return_if_fail (GTK_IS_STYLE (style));
1150
g_return_if_fail (window != NULL);
1152
gc = use_text ? style->text_gc[state_type] : style->fg_gc[state_type];
1155
gdk_gc_set_clip_rectangle (gc, area);
1157
if (state_type == GTK_STATE_INSENSITIVE) {
1158
MurrineStyle *murrine_style = MURRINE_STYLE (style);
1159
MurrineColors *colors = &murrine_style->colors;
1161
WidgetParameters params;
1163
murrine_set_widget_parameters (widget, style, state_type, ¶ms);
1168
if (GTK_WIDGET_NO_WINDOW (widget))
1169
murrine_shade (¶ms.parentbg, &temp, 1.2);
1171
murrine_shade (&colors->bg[widget->state], &temp, 1.2);
1172
etched.red = (int) (temp.r * 65535);
1173
etched.green = (int) (temp.g * 65535);
1174
etched.blue = (int) (temp.b * 65535);
1176
gdk_draw_layout_with_colors (window, style->text_gc[state_type], x + 1, y + 1, layout, &etched, NULL);
1177
gdk_draw_layout (window, style->text_gc[state_type], x, y, layout);
1180
gdk_draw_layout (window, gc, x, y, layout);
1183
gdk_gc_set_clip_rectangle (gc, NULL);
1305
1187
murrine_style_init_from_rc (GtkStyle * style,
1306
1188
GtkRcStyle * rc_style)