From 83471527303891bfa506feb603fb5e904b571e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 8 Jul 2016 02:06:31 +0200 Subject: [PATCH] calendar: Do not overload :active to mark selected day We currently use the :active pseudo class to mark the selected day in the calendar. Whenever the selected date changes, the class is added to the corresponding button and removed from all others. However when the selected date doesn't change (i.e. when clicking the already selected date), the buttons are not updated and the use of the :active class conflicts with StButton's builtin handling of the class - the class is removed on the button up event and the button is deselected. Fix this by simply using a different pseudo class. https://bugzilla.gnome.org/show_bug.cgi?id=746867 --- data/theme/gnome-shell-high-contrast.css | 2 +- data/theme/gnome-shell-sass | 2 +- data/theme/gnome-shell.css | 2 +- js/ui/calendar.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/theme/gnome-shell-high-contrast.css b/data/theme/gnome-shell-high-contrast.css index bb1255a17..190aef523 100644 --- a/data/theme/gnome-shell-high-contrast.css +++ b/data/theme/gnome-shell-high-contrast.css @@ -769,7 +769,7 @@ StScrollBar { border-radius: 1.4em; } .calendar-day-base:hover, .calendar-day-base:focus { background-color: #0d0d0d; } - .calendar-day-base:active { + .calendar-day-base:active, .calendar-day-base:selected { color: white; background-color: #215d9c; border-color: transparent; } diff --git a/data/theme/gnome-shell-sass b/data/theme/gnome-shell-sass index 31aac7f7b..d184e5c44 160000 --- a/data/theme/gnome-shell-sass +++ b/data/theme/gnome-shell-sass @@ -1 +1 @@ -Subproject commit 31aac7f7b524786965e4c9a1890009ea362b9c87 +Subproject commit d184e5c44ed824ab62fc35a4a8d75cda1f387206 diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index d3155edf1..5b6135940 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -769,7 +769,7 @@ StScrollBar { border-radius: 1.4em; } .calendar-day-base:hover, .calendar-day-base:focus { background-color: #454c4c; } - .calendar-day-base:active { + .calendar-day-base:active, .calendar-day-base:selected { color: white; background-color: #215d9c; border-color: transparent; } diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 7958e9d16..ec3732e00 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -686,12 +686,12 @@ const Calendar = new Lang.Class({ this._buttons.forEach(Lang.bind(this, function(button) { if (sameDay(button._date, this._selectedDate)) { - button.add_style_pseudo_class('active'); + button.add_style_pseudo_class('selected'); if (this._shouldDateGrabFocus) button.grab_key_focus(); } else - button.remove_style_pseudo_class('active'); + button.remove_style_pseudo_class('selected'); })); } });