Artificial-Pancreas / iAPS

MIT License
164 stars 682 forks source link

Feature request - standardising button design #626

Open antoinekh opened 2 months ago

antoinekh commented 2 months ago

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 commented 2 months ago

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

antoinekh commented 2 months ago

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

Jon-b-m commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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