[evolution/clutter-calendar-v2] Fix gradients.



commit faa90858f25254f20f2d0d7038e66c8e0e4f2690
Author: Srinivasa Ragavan <sragavan gnome org>
Date:   Thu Sep 30 00:14:15 2010 +0530

    Fix gradients.

 calendar/gui/e-day-view-clutter-event-item.c  |   17 +++++++++++------
 calendar/gui/e-day-view-clutter-main-item.c   |    5 +++--
 calendar/gui/e-week-view-clutter-event-item.c |    4 ++--
 3 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/calendar/gui/e-day-view-clutter-event-item.c b/calendar/gui/e-day-view-clutter-event-item.c
index 31f0b48..8874768 100644
--- a/calendar/gui/e-day-view-clutter-event-item.c
+++ b/calendar/gui/e-day-view-clutter-event-item.c
@@ -639,7 +639,8 @@ day_view_clutter_event_item_draw_long (EDayViewClutterEventItem *main_item)
 	if (gradient) {
 		pat = cairo_pattern_create_linear (item_x - x + 5.5, item_y + 2.5 - y,
 						item_x - x + 5, item_y - y + item_h + 7.5);
-		cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8);
+		//cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8);		
+		cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.4);
 		cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.4);
 		cairo_set_source (cr, pat);
 		cairo_fill_preserve (cr);
@@ -1241,13 +1242,17 @@ day_view_clutter_event_item_draw_normal (EDayViewClutterEventItem *main_item)
 		pat = cairo_pattern_create_linear (item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 7.75,
 							item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + item_h - 7.75);
 		if (!short_event) {
-			cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8);
-			cairo_pattern_add_color_stop_rgba (pat, 1/(date_fraction + (rect_height/18)), red/cc, green/cc, blue/cc, 0.8);
+			float midpoint = (1 - 1/(date_fraction + (rect_height/18)))/2;
+			cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.8);
+			cairo_pattern_add_color_stop_rgba (pat, (1/(date_fraction + (rect_height/18))) - 0.0001, red/cc, green/cc, blue/cc, 0.8);			
 			cairo_pattern_add_color_stop_rgba (pat, 1/(date_fraction + (rect_height/18)), red/cc, green/cc, blue/cc, 0.4);
-			cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8);
+			//cairo_pattern_add_color_stop_rgba (pat, midpoint, red/cc, green/cc, blue/cc, 0.8);
+			cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.4);
 		} else {
-			cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8);
-			cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.4);
+			cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.4);			
+			//cairo_pattern_add_color_stop_rgba (pat, 0.25, red/cc, green/cc, blue/cc, 0.8);
+			//cairo_pattern_add_color_stop_rgba (pat, 0.75, red/cc, green/cc, blue/cc, 0.8);			
+			cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.4);
 		}
 		cairo_set_source (cr, pat);
 		cairo_fill_preserve (cr);
diff --git a/calendar/gui/e-day-view-clutter-main-item.c b/calendar/gui/e-day-view-clutter-main-item.c
index 8de466f..82a5d9b 100644
--- a/calendar/gui/e-day-view-clutter-main-item.c
+++ b/calendar/gui/e-day-view-clutter-main-item.c
@@ -119,7 +119,7 @@ day_view_clutter_main_item_draw_long_events_in_vbars (EDayViewClutterMainItem *m
 			continue;
 
 		/* If the event is TRANSPARENT, skip it. */
-		if (icalcomp_is_transparent (event->comp_data->icalcomp)) {
+		if (0 && icalcomp_is_transparent (event->comp_data->icalcomp)) {
 			continue;
 		}
 
@@ -882,7 +882,8 @@ day_view_clutter_main_item_draw_events_in_vbars (EDayViewClutterMainItem *main_i
 
 		/* We can skip the events in the first column since they will
 		   draw over this anyway. */
-		if (event->num_columns > 0 && event->start_row_or_col == 0) {
+		
+		if (0 && event->num_columns > 0 && event->start_row_or_col == 0) {
 			continue;
 		}
 
diff --git a/calendar/gui/e-week-view-clutter-event-item.c b/calendar/gui/e-week-view-clutter-event-item.c
index 09bf887..dfb94dc 100644
--- a/calendar/gui/e-week-view-clutter-event-item.c
+++ b/calendar/gui/e-week-view-clutter-event-item.c
@@ -1626,7 +1626,7 @@ scale_stage1 (ClutterAnimation *amim, struct _anim_data *data)
 
 	clutter_actor_animate (data->item, CLUTTER_EASE_IN_SINE,
 				200,
-				"scale-x", 1.0,
+				"scale-y", 1.0,
 				"signal-after::completed", scale_stage2, data,
 				NULL);
 	
@@ -1656,7 +1656,7 @@ wvce_animate_scale (ClutterActor *item,
 
 	clutter_actor_animate (item, CLUTTER_EASE_OUT_SINE,
 				200,
-				"scale-x", 0.0,
+				"scale-y", 0.0,
 				"signal-after::completed", scale_stage1, data,
 				NULL);
 }



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