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

Linux: Focus box drawing incorrectly #369

Closed
erco77 opened this issue Jan 14, 2022 · 3 comments
Closed

Linux: Focus box drawing incorrectly #369

erco77 opened this issue Jan 14, 2022 · 3 comments
Assignees

Comments

@erco77
Copy link
Contributor

erco77 commented Jan 14, 2022

While looking closely at the Fl_Input_Choice widget, I noticed the lower right and bottom part of the focus box wasn't being drawn, e.g. with test/input_choice:
input_choice_focusbox_bug

This wasn't introduced by my recent changes to Fl_Input_Choice; the older code did this too; I just tested a July 2021 snapshot and it had it too.

Not sure if this is unique to Fl_Input_Choice, or just due to how small the button is.

Since the focus box dotted line issue comes up a lot, we should probably have a unit test for it (I don't think we have one currently).

As a side note while sniffing around, I'm also noticing Fl_Choice does not show a focus box at all, but does if you change the scheme(). This can be seen by running the test/unittests -> "schemes test", and changing the "FLTK Scheme" chooser from one scheme to another. (Only the "none" scheme has no focus box). EDIT: This might be by design; "focus" is perhaps shown by the highlight color for the default scheme; the widget has a very different look in the default scheme when compared to the other scheme settings.

@erco77 erco77 self-assigned this Jan 14, 2022
@erco77
Copy link
Contributor Author

erco77 commented Jan 14, 2022

Might be specific to this widget.

Apparently even though the custom menu button widget's ctor sets the box() type to FL_UP_BOX, it's set back to FL_FLAT_BOX by the time draw() is called, causing draw_focus() to draw a focus box appropriate for an FL_FLAT_BOX, and not an FL_UP_BOX. Hence the issue.

Still investigating.. but seems to be related to that.

@erco77
Copy link
Contributor Author

erco77 commented Jan 14, 2022

Seems to be a problem introduced by user-submitted patch in STR#2750 by user "dfatfl", accepted in a1d555b, when Fl_Input_Choice was separated from a single .H file into separate .H + .cxx files, back in 2017.

Seems the FL_FLAT_BOX is coming from this line added in the ctor by that patch:
menu_->box(FL_FLAT_BOX); // cosmetic
Going to back that out, but we should probably carefully look at that patch to see what else was changed during the code split, as there are at least two of these 'cosmetic' entries that were not in the original code.

@erco77 erco77 closed this as completed in c45bf57 Jan 14, 2022
@erco77
Copy link
Contributor Author

erco77 commented Jan 14, 2022

Fixed as described, also updated the widget doc's screenshot to include our current scheme() variations.

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

No branches or pull requests

1 participant