[gnome-maps/wip/mlundblad/always-show-transit-button: 2/2] sidebar: Grey-out transit switch when not available
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/always-show-transit-button: 2/2] sidebar: Grey-out transit switch when not available
- Date: Wed, 21 Apr 2021 21:22:32 +0000 (UTC)
commit b10edea723ce0eb758b1d3fd89142c8c9308a114
Author: Marcus Lundblad <ml update uu se>
Date: Wed Apr 21 23:16:44 2021 +0200
sidebar: Grey-out transit switch when not available
Due to a bug in GTK where setting visible false on a linked
button not working properly, we used to call destroy()
on this button when transit providers where not available.
Since calling destroy() on widgets will not be supported
in GTK 4 and we could instead dim the button in this case
as this feature has now been exposed by default for a while.
And originally it was hidden since the feature where itself
hidden.
src/sidebar.js | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/sidebar.js b/src/sidebar.js
index e623d4bf..3e97e3dc 100644
--- a/src/sidebar.js
+++ b/src/sidebar.js
@@ -97,13 +97,9 @@ var Sidebar = GObject.registerClass({
this._switchRoutingMode(Application.routeQuery.transportation);
/* Enable/disable transit mode switch based on the presence of
* public transit providers.
- * For some reason, setting visible to false in the UI file and
- * dynamically setting visible false here doesn't work, maybe because
- * it's part of a radio group? As a workaround, just remove the button
- * instead.
*/
- if (!Application.routingDelegator.transitRouter.enabled)
- this._modeTransitToggle.destroy();
+ this._modeTransitToggle.sensitive =
+ Application.routingDelegator.transitRouter.enabled;
}
_initTransportationToggles(pedestrian, bike, car, transit) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]