leocb / MaterialSkin

Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles.
MIT License
438 stars 132 forks source link

MaterialButton add Tab Focus #285

Closed orapps44 closed 2 years ago

orapps44 commented 2 years ago

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

orapps44 commented 2 years ago

Animation

valimaties commented 2 years ago

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

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

Right, I will rework that.

valimaties commented 2 years ago

Right, I will rework that.

Thanks :)

orapps44 commented 2 years ago

That should work as expected with last commit.

valimaties commented 2 years ago

YEEESSS... This must be quickly merged 💯