Skip to content

MainWindow: use settings.create_action#160

Merged
ryonakano merged 5 commits intomainfrom
danirabbit/simple-settings
Jul 17, 2025
Merged

MainWindow: use settings.create_action#160
ryonakano merged 5 commits intomainfrom
danirabbit/simple-settings

Conversation

@danirabbit
Copy link
Member

@danirabbit danirabbit commented Jul 16, 2025

  • Use Settings.create_action to manage syncing the gsetting and action state. There's no transforms needed here
  • Make settings bind to the map GET only. We don't need to update the gsetting if the map source changes because the only way to update it is via the setting. This can be a one-way relationship where the map always follows the gsetting
  • Rename the string constants to be clearer that these constants reflect the gsettings names, not the IDs of map sources
  • Remove a bunch of binds we don't need

I still kept the transform instead of making the enum reflect map source IDs because we're going to want to keep those separate for dark mode. That way the setting is always explore or transit and then in the transform func we can figure out if that means explore-dark or explore-light etc.

If dark mode is set, we can change the map source from explore-light to explore-dark and that won't trigger a write to gsettings since the user setting didn't change here, just the name of the map source we're currently using

@danirabbit danirabbit requested a review from a team July 16, 2025 19:19
Copy link
Member

@ryonakano ryonakano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving two tiny comments (and one self-talk)

danirabbit and others added 2 commits July 17, 2025 10:06
Co-authored-by: Ryo Nakano <ryonakaknock3@gmail.com>
@danirabbit danirabbit requested a review from ryonakano July 17, 2025 17:09
@ryonakano ryonakano merged commit 31b1764 into main Jul 17, 2025
3 checks passed
@ryonakano ryonakano deleted the danirabbit/simple-settings branch July 17, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants