-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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/buttonkeys #2263
Feature/buttonkeys #2263
Conversation
Could buttons and hyperlinks be actioned by tapping |
Move Entry to request focus when tapped instead
So far we have just used space for activation. |
|
||
### Updated | ||
|
||
* Focusable widgets are no longer focused on tap, add canvas.Focus(obj) in Tapped handler if required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would also mean that custom widgets that are focused when tapped cannot be extended? (Because .super() is private? 🤔)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks - I missed some elements here and have tidied it all up
I don't understand how Enter-key action would lead to inconsistencies as it would only work when the button is focused. 🤔 |
Because depending on what widget is focused the Enter button would change from actioning an item to submitting the form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some comments.
@@ -309,25 +334,15 @@ func (r *buttonRenderer) buttonColor() color.Color { | |||
switch { | |||
case r.button.Disabled(): | |||
return theme.DisabledButtonColor() | |||
case r.button.focused: | |||
return blendColor(theme.ButtonColor(), theme.FocusColor()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the corresponding bg color depending on the importance, however I agree that the color resulted after blending with the primary color does not have any appreciable difference, maybe this could be improved if we decide in the future to change the Focus color (to something similar to MaterialDesign), this should be needed if we want different colored buttons (primary, secondary, success, danger, etc). However, for now I think it is ok :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I wondered that as well, but it just didn't seem to look good. Maybe we can revisit it somehow, like if the focus was not a directly less-vibrant version of primary.
Description:
Add focus state to
Button
andHyperlink
and enable space-bar to action them.This added a new focus rect around hyperlink as is seen in web browsers:
Relates to #1515
Checklist: