After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746267 - Fade out past events (make them transparent)
Fade out past events (make them transparent)
Status: RESOLVED FIXED
Product: gnome-calendar
Classification: Applications
Component: User Interface
unspecified
Other Linux
: Normal enhancement
: 3.26
Assigned To: GNOME Calendar maintainers
GNOME Calendar maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-16 01:40 UTC by Jean-François Fortin Tam
Modified: 2017-04-17 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
event-widget: fade out past events (1.49 KB, patch)
2016-03-12 03:22 UTC, Monique
none Details | Review
event-widget: fade out past events (1.62 KB, patch)
2016-03-13 04:14 UTC, Monique
none Details | Review
event-widget: fade out past events (1.65 KB, patch)
2016-03-13 16:46 UTC, Monique
none Details | Review
event-widget: fade out past events (1.67 KB, patch)
2016-03-14 01:09 UTC, Monique
none Details | Review
event-widget: fade out past events (1.67 KB, patch)
2016-03-14 22:36 UTC, Monique
committed Details | Review

Description Jean-François Fortin Tam 2015-03-16 01:40:57 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.
Comment 1 Erick Perez Castellanos 2015-03-16 13:00:03 UTC
Yes, I think this might be useful
Comment 2 Monique 2016-03-12 03:22:44 UTC
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.
Comment 3 Georges Basile Stavracas Neto 2016-03-13 00:53:35 UTC
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.
Comment 4 Monique 2016-03-13 04:14:19 UTC
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.
Comment 5 Monique 2016-03-13 04:16:37 UTC
Sorry for the same message over again, I forgot to change the commit message in the --amend. Guess I fixed everything!
Comment 6 Georges Basile Stavracas Neto 2016-03-13 15:19:28 UTC
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.
Comment 7 Monique 2016-03-13 16:46:42 UTC
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.
Comment 8 Georges Basile Stavracas Neto 2016-03-14 00:49:01 UTC
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.
Comment 9 Monique 2016-03-14 01:09:45 UTC
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.
Comment 10 Monique 2016-03-14 01:12:01 UTC
Sorry for such a beginner mistake! Hopefully, this time, everything is OK.
Comment 11 Georges Basile Stavracas Neto 2016-03-14 18:49:20 UTC
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.
Comment 12 Monique 2016-03-14 22:36:09 UTC
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.
Comment 13 Georges Basile Stavracas Neto 2016-03-14 22:52:38 UTC
Thanks for working on this issue.

Attachment 323931 [details] pushed as c49dae0 - event-widget: fade out past events