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 747963 - The Today button should be insensitive when today is visible.
The Today button should be insensitive when today is visible.
Status: RESOLVED FIXED
Product: gnome-calendar
Classification: Applications
Component: User Interface
3.16.x
Other Linux
: Normal normal
: 3.26
Assigned To: GNOME Calendar maintainers
GNOME Calendar maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-16 04:20 UTC by Erick Perez Castellanos
Modified: 2017-04-17 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Today button is only sensitive when a view does not show the current day. (3.31 KB, patch)
2015-06-06 10:40 UTC, Javier Sánchez Ochando
none Details | Review
This patch makes today button sensitive only when today is not shown. (2.78 KB, patch)
2016-03-26 11:12 UTC, Javier Sánchez Ochando
none Details | Review
This patch makes today button sensitive only when today is not shown. (2.80 KB, patch)
2016-03-27 10:39 UTC, Javier Sánchez Ochando
committed Details | Review

Description Erick Perez Castellanos 2015-04-16 04:20:03 UTC
When a view shows the current day, the Today button should be insensitive.
Comment 1 Javier Sánchez Ochando 2015-06-06 10:40:04 UTC
Created attachment 304681 [details] [review]
Today button is only sensitive when a view does not show the current day.
Comment 2 Erick Perez Castellanos 2015-06-06 23:47:37 UTC
(In reply to Javier Sánchez Ochando from comment #1)
> Created attachment 304681 [details] [review] [review]
> Today button is only sensitive when a view does not show the current day.

Thank you, I'll review it on Tuesday.
Comment 3 Georges Basile Stavracas Neto 2016-01-30 20:18:45 UTC
Review of attachment 304681 [details] [review]:

The patch does not apply to master.
Comment 4 Javier Sánchez Ochando 2016-03-26 11:12:36 UTC
Created attachment 324786 [details] [review]
This patch makes today button sensitive only when today is not shown.
Comment 5 Georges Basile Stavracas Neto 2016-03-26 19:48:14 UTC
Review of attachment 324786 [details] [review]:

Some style issues left.

::: src/gcal-window.c
@@ +153,3 @@
+                                                          icaltimetype        *new_date);
+
+static gboolean       update_current_date                (GcalWindow          *window);

These 2 prototypes are not needed, only add the update_today_button_sensitive() one.

@@ +426,3 @@
+      sensitive =
+        window->active_date->year  != window->current_date->year  ||
+        window->active_date->month != window->current_date->month;

The alignment is wrong, write it as follows:

sensitive = cond1 ||
            cond2;

@@ +431,3 @@
+    case GCAL_WINDOW_VIEW_YEAR:
+      sensitive =
+        window->active_date->year != window->current_date->year;

Put this only in one line.

@@ +437,3 @@
+      sensitive =
+        window->active_date->year  != window->current_date->year  ||
+        window->active_date->month != window->current_date->month;

in default, set sensitive to TRUE.
Comment 6 Javier Sánchez Ochando 2016-03-27 10:39:42 UTC
Created attachment 324832 [details] [review]
This patch makes today button sensitive only when today is not shown.

Fixed some coding style issues.
Comment 7 Georges Basile Stavracas Neto 2016-03-27 14:30:06 UTC
Thanks for fixing the bug.
Comment 8 Sebastien Bacher 2016-04-08 09:31:33 UTC
That change is a bit confusing. In month view you can see the selected day (it has a doted-line rectangle), wouldn't it make sense to rather active "today" when the selected day is not today and have the button brings back the selection on the actual day?
Comment 9 Erick Perez Castellanos 2016-04-08 15:26:40 UTC
(In reply to Sebastien Bacher from comment #8)
> That change is a bit confusing. In month view you can see the selected day
> (it has a doted-line rectangle), wouldn't it make sense to rather active
> "today" when the selected day is not today and have the button brings back
> the selection on the actual day?

Only month-view has a notion of selection and Today button apply for both views, so it should do the same on both views.