-
-
Notifications
You must be signed in to change notification settings - Fork 314
Description
I was trying to have a button with a toolBar style, but when I did this:
FlatButton button = new FlatButton();
button.setButtonType(ButtonType.toolBarButton);
I got a focusBorder, which a normal toolBarButton in a toolBar doesn't have:

So I played with settings and I found out that if I set these properties in the Laf file (or if I instead use setFocusable(false)):
Component.focusWidth = 0
Component.innerFocusWidth = 0
HelpButton.focusWidth = 0
HelpButton.innerFocusWidth = 0
Button.focusWidth = 0
Button.innerFocusWidth = 0
Button.default.focusWidth = 0
Button.default.innerFocusWidth = 0
Button.toolbar.focusWidth = 0
Button.toolbar.innerFocusWidth = 0
It fixes the issue, but I still noticed weird border insets/spacing:

So I tried with this button type:
button.setButtonType(ButtonType.borderless);
But with the properties set, I still get a focus border:

The only way to fix it that I found is to set it not focusable manually:
button.setFocusable(false);
which results in this:

This is what I was looking for, it doesn't feel intuitive, I thought I would achive this result by default just by setting the style to toolBarButton, so either I'm missing something or there is some weird logic around the focus border drawing...