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

MaterialButton add Tab Focus #285

Merged
merged 2 commits into from
Nov 7, 2021
Merged

Conversation

orapps44
Copy link
Collaborator

@orapps44 orapps44 commented Nov 5, 2021

Add focus to MaterialButton when Tab Key is pressed.
Fix Enter KeyDown animation.

Add focus to MaterialButton when Tab Key is pressed.
Fix Enter KeyDown animation.
@orapps44 orapps44 linked an issue Nov 5, 2021 that may be closed by this pull request
@orapps44 orapps44 added this to the 2.3.0 milestone Nov 5, 2021
@orapps44
Copy link
Collaborator Author

orapps44 commented Nov 6, 2021

Animation

@valimaties
Copy link

valimaties commented Nov 6, 2021

Hi @orapps44 ,

I've tested this PR, and it is not good approach! If you leave the button with mouse, you will lose the focused effect. You will not know which button has the focus.
I think it is not a good idea to eliminate the focused effect when mouse is leaving the object. I must know in anytime which is the focused button. What will happening if from mistake I will grab mouse over the focused button and leave?! I will not know which is the button which has the focus.
I consider my approach, having all the time the focus color different than other buttons is better. Maybe not as I did it, using ControlPaint, but think of it.
As I can think of, this PR is not helping me.

BTW: Look how Google implemented focused effect on their buttons:
GoogleApproachForButtons

MouseOver and MouseLeave does not affect focused border...

@valimaties
Copy link

valimaties commented Nov 6, 2021

And BTW, it is not good to force Focus on a object only dragging mouse over it. That is not Focus, that is only hover!
In this PR if I move mouse over a button it will have the Focus... This is very wrong, because if I hit EnterKey it will execute Click event of focused button. You change Focus by moving mouse over the objects. It is wrong!

@orapps44
Copy link
Collaborator Author

orapps44 commented Nov 6, 2021

Right, I will rework that.

@valimaties
Copy link

Right, I will rework that.

Thanks :)

Add _focusAnimationManager
@orapps44
Copy link
Collaborator Author

orapps44 commented Nov 6, 2021

That should work as expected with last commit.

@valimaties
Copy link

YEEESSS... This must be quickly merged 💯

@orapps44 orapps44 merged commit 5b76779 into master Nov 7, 2021
@orapps44 orapps44 deleted the orapps44-MaterialButton-Tab-Focus branch November 7, 2021 21:28
@orapps44 orapps44 changed the title MaterialButton Tab Focus MaterialButton add Tab Focus Nov 7, 2021
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.

Focused button visibility
2 participants