[gnome-maps/wip/mlundblad/transit-update-calendar-date] transitOptionsPanel: Select day when setting date button
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/transit-update-calendar-date] transitOptionsPanel: Select day when setting date button
- Date: Sun, 27 Feb 2022 20:20:03 +0000 (UTC)
commit 1edc5ec522e595c5a79f1ed6e000825e99e94caa
Author: Marcus Lundblad <ml update uu se>
Date: Sun Feb 27 21:16:37 2022 +0100
transitOptionsPanel: Select day when setting date button
Also select the day when updating the date button (e.g. when
selecting "Leave by" or "Arrive by". Otherwise the calendar would
have the last selected day selected (or the day the instance was
created, that is when Maps was started).
src/transitOptionsPanel.js | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/src/transitOptionsPanel.js b/src/transitOptionsPanel.js
index 6c23a3ee..cdadc84c 100644
--- a/src/transitOptionsPanel.js
+++ b/src/transitOptionsPanel.js
@@ -131,7 +131,15 @@ var TransitOptionsPanel = GObject.registerClass({
}
}
+ /**
+ * Update the date select button with given date, and select the
+ * corresponding day in the calendar shown when clicking the button.
+ */
_updateTransitDateButton(date) {
+ let calendar = this._transitDateButton.popover.get_child();
+
+ calendar.select_month(date.get_month(), date.get_year());
+ calendar.select_day(date.get_day_of_month());
this._transitDateButton.label =
/*
* Translators: this is a format string giving the equivalent to
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]