Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR] SettingToggle ~ Icon Support with fixes +new cfgs [#42] #43

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

duraki
Copy link

@duraki duraki commented Jan 26, 2025

This PR implements #42 and fixes #37, #38.

Relevant commits:


This update fixes SettingToggle implementing icon support among other functionality, along with adequate example code. Updates on SettingToggle for #42 includes:

mehdin13 and others added 7 commits April 7, 2024 01:07
PR: Add onAppear & Icon to a SettingToggle control [via mehdin13/Setting] on aheze/Setting
…sue via nillable horizontalPadding _ref aheze#42

This update fixes SettingToggle implementing Icons among other functionality

- impl: edgePadding setter (optional) via env_var, otherwise uses horizontalPadding (default)
- fixes: Icon padding issue (ref  via nillable horizontalPadding (ref. aheze#38 (comment), covers aheze#38, aheze#37
- impl: SettingToggle extension supporting `.icon(...)` methods
- impl: SettingToggle `onChange(...)` event handler, triggering when toggle is switched on/off
…ngToggle w. Icon + onChange(...) event _ref aheze#42

This change updates the Setting/SettingExample/PreferencesView showing how to use added icon support on SettingToggle, alongside the sample code which tracks toggle switch events and trigger onChange handler via closure

Added Toggle switch example is rendered in "Extras" SettingGroup in "Preferences" tab:
- SettingToggle `toggleIcon` (bool-based @AppStorage bindings)
- SettingToggle `.icon(...)` example
- SettingToggle `onChange(...)` example

@duraki via _ref aheze#42
duraki added a commit to When-original-devs-wont-merge-good-PRs/Setting that referenced this pull request Jan 26, 2025
…menu` _ref aheze#44

This small PR fixes bug in aheze#44 where the icon is not showing in SettingPicker component, when used in combination with `Setting.ChoicesConfiguration(pickerDisplayMode: .menu, ....)`:

- Preappends `SettingIconView(...)` when using `.menu` picker's display mode
- Requires merge of base PR @ aheze#43 & aheze#42 or cherry-picking
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