Skip to content

Icon support for SettingButton and SettingPicker and trailing label support for SettingPage#19

Merged
aheze merged 2 commits into
aheze:mainfrom
Saik0s:main
Apr 29, 2023
Merged

Icon support for SettingButton and SettingPicker and trailing label support for SettingPage#19
aheze merged 2 commits into
aheze:mainfrom
Saik0s:main

Conversation

@Saik0s

@Saik0s Saik0s commented Apr 7, 2023

Copy link
Copy Markdown
Contributor

Thanks for creating an awesome library!

This PR implements icon support for SettingButton and SettingPicker, as well as trailing label support for SettingPage, to ensure consistency with the look and feel of iOS Settings.

Saik0s added 2 commits April 3, 2023 18:54
…wThis commit adds an optional `icon` property to `SettingButton` and `SettingPagePreviewView` structs, allowing for the display of an icon alongside the title in these settings components
@Saik0s

Saik0s commented Apr 7, 2023

Copy link
Copy Markdown
Contributor Author

This PR would cover #12

@aheze

aheze commented Apr 29, 2023

Copy link
Copy Markdown
Owner

Thanks for the PR - sorry for getting back to you so late. Checking this out...

@aheze
aheze merged commit 4f9c736 into aheze:main Apr 29, 2023
@aheze

aheze commented Apr 29, 2023

Copy link
Copy Markdown
Owner

Thanks!

@aheze

aheze commented Apr 29, 2023

Copy link
Copy Markdown
Owner

Resolved the merge conflict here: 4f9c736

@aheze

aheze commented Apr 29, 2023

Copy link
Copy Markdown
Owner

Added an example:

Buttons with icon on the left

SettingPage(title: "Extras", selectedChoice: "Hello, world!") {
    SettingGroup {
        SettingButton(title: "Hello, world!") {
            print("Hello world pressed!")
        }
        .icon(icon: .system(icon: "ellipsis", backgroundColor: Color.teal))
    }
    
    SettingGroup {
        SettingButton(title: ":)") {
            print(":) pressed!")
        }
        .icon(icon: .system(icon: "sparkles", backgroundColor: Color.pink))
        .indicator("face.smiling")
    }
}
.previewIcon(icon: .system(icon: "ellipsis", backgroundColor: Color.teal))

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