GNOME Bugzilla – Bug 746267
Fade out past events (make them transparent)
Last modified: 2017-04-17 18:20:40 UTC
In month view or other views, events that are earlier than the current date should be half transparent to allow the eye to easily find where the current date/time is.
Yes, I think this might be useful
Created attachment 323741 [details] [review] event-widget: fade out past events When an event is earlier than the current date, it gets faded out. Every event from the same calendar showed the same shade of color, either it was an old, current or forward event. That could be tricky for the user to identify which ones were already over. Now, events that are earlier thant the current date are half transparent to allow the user to easily track where the current date/time is.
Review of attachment 323741 [details] [review]: Still needs some work. ::: src/gcal-event-widget.c @@ +108,3 @@ context = gtk_widget_get_style_context (GTK_WIDGET (self)); color = gcal_event_get_color (self->event); + now = g_date_time_new_now_local(); This datetime is leaking, unref it after use. @@ +109,3 @@ color = gcal_event_get_color (self->event); + now = g_date_time_new_now_local(); + date_compare = g_date_time_compare (gcal_event_get_date_end (self->event), now); Compare with the event-widget's end date, not the event's one. @@ +112,3 @@ + + /*Fades out an event that's older than the current date*/ + if (date_compare == -1) You should check < 0, not == -1. @@ +113,3 @@ + /*Fades out an event that's older than the current date*/ + if (date_compare == -1) + { Don't need curly braces for a single-line if statement.
Created attachment 323777 [details] [review] event-widget: fade out past events When an event is earlier than the current date, it gets faded out. Every event from the same calendar showed the same shade of color, either it was an old, current or forward event. That could be tricky for the user to identify which ones were already over. Now, events that are earlier thant the current date are half transparent to allow the user to easily track where the current date/time is.
Sorry for the same message over again, I forgot to change the commit message in the --amend. Guess I fixed everything!
Review of attachment 323777 [details] [review]: Still some things to review. Please, always follow the GNU C Coding Style when sending patches for Calendar [1]. [1] https://developer.gnome.org/programming-guidelines/stable/c-coding-style.html.en ::: src/gcal-event-widget.c @@ +109,3 @@ color = gcal_event_get_color (self->event); + now = g_date_time_new_now_local(); + date_compare = g_date_time_compare (gcal_event_widget_get_date_end (self), now); Use self->dt_end directly. @@ +111,3 @@ + date_compare = g_date_time_compare (gcal_event_widget_get_date_end (self), now); + + /*Fades out an event that's earlier than the current date*/ Put a space between both '*' and the comment text. @@ +113,3 @@ + /*Fades out an event that's earlier than the current date*/ + if (date_compare < 0) + gtk_widget_set_opacity(GTK_WIDGET (self), 0.5); Put a space between the function name and '('. @@ +144,2 @@ g_free (color_str); + g_date_time_unref(now); 1. Use g_clear_pointer() 2. Put a space between the function name and '('. 3. Put this code before the 'g_free()' line.
Created attachment 323802 [details] [review] event-widget: fade out past events When an event is earlier than the current date, it gets faded out. Every event from the same calendar showed the same shade of color, either it was an old, current or forward event. That could be tricky for the user to identify which ones were already over. Now, events that are earlier thant the current date are half transparent to allow the user to easily track where the current date/time is.
Review of attachment 323802 [details] [review]: One more point to solve. ::: src/gcal-event-widget.c @@ +142,3 @@ self->css_class = css_class; + g_clear_pointer (now); This code doesn't compile.
Created attachment 323832 [details] [review] event-widget: fade out past events When an event is earlier than the current date, it gets faded out. Every event from the same calendar showed the same shade of color, either it was an old, current or forward event. That could be tricky for the user to identify which ones were already over. Now, events that are earlier thant the current date are half transparent to allow the user to easily track where the current date/time is.
Sorry for such a beginner mistake! Hopefully, this time, everything is OK.
Review of attachment 323832 [details] [review]: The patch looks mostly good. I just tested it in my end, and now I'm certain that 0.5 is too much and harms the legibility. Testing some values, I found that 0.6 works the best in this situation. Change this final issue and the patch will be ready to be pushed. ::: src/gcal-event-widget.c @@ +113,3 @@ + /* Fades out an event that's earlier than the current date */ + if (date_compare < 0) + gtk_widget_set_opacity (GTK_WIDGET (self), 0.5); Change to 0.6.
Created attachment 323931 [details] [review] event-widget: fade out past events When an event is earlier than the current date, it gets faded out. Every event from the same calendar showed the same shade of color, either it was an old, current or forward event. That could be tricky for the user to identify which ones were already over. Now, events that are earlier thant the current date are half transparent to allow the user to easily track where the current date/time is.
Thanks for working on this issue. Attachment 323931 [details] pushed as c49dae0 - event-widget: fade out past events