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

Feature request - standardising button design #626

Open
antoinekh opened this issue Apr 29, 2024 · 5 comments
Open

Feature request - standardising button design #626

antoinekh opened this issue Apr 29, 2024 · 5 comments

Comments

@antoinekh
Copy link

Hello,

Low prio feature request.

It's mainly details on button design to have the same design for enacting, activate and cancelling a profile/tt, or doing nothing.

iAPS

@Jon-b-m
Copy link
Member

Jon-b-m commented May 1, 2024

I think this is a probably a perfect PR for you to create, as you’ve mentioned this several times before, no?

@antoinekh
Copy link
Author

I'd do it if only I had a Mac :/

@Jon-b-m
Copy link
Member

Jon-b-m commented May 6, 2024

So what is your suggestion (I have to ask since I can’t see it)?

Currently an enabled button is blue, and a disabled button is grey. This is the default SwiftUI property of buttons.

@antoinekh
Copy link
Author

Hi,
Sorry it’s only a quick idea made on my phone but

in AddTempTarget view

Modify cancel button like in override profile with large red button

 if state.isEnabled {
                    Section {
                        Button("Cancel Profile Override") {
                            state.cancelProfile()
                            dismiss()
                        }
                        .frame(maxWidth: .infinity, alignment: .center)
                        .buttonStyle(BorderlessButtonStyle())
                        .disabled(!state.isEnabled)
                        .tint(.red)
                    } footer: { Text("").padding(.bottom, 150) }

Modify start and save profile button in TT like override profile with conditional on unchanged function

label: { Text("Save as Profile") }
                           .tint(.orange)
                           .frame(maxWidth: .infinity, alignment: .trailing)
                           .buttonStyle(BorderlessButtonStyle())
                           .controlSize(.mini)
                           .disabled(unChanged())

Or at least add on L99

.disabled(state.duration == 0)

Changed the button placement on TT
Put start and save on the same section/hstack

@Jon-b-m
Copy link
Member

Jon-b-m commented May 9, 2024

Looks like you have a plan. Could you please test-build in GitHub and PR when you're feeling content?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants