mabe02 / lanterna

Java library for creating text-based GUIs
GNU Lesser General Public License v3.0
2.23k stars 243 forks source link

Disable thumb in SplitPanel #542

Closed ivanyu closed 11 months ago

ivanyu commented 3 years ago

Currently, the thumb in SplitPanel gets focus on Tab, but itself doesn't handle Tab key again to pass the focus forward. Same for reverse Tab. This effectively breaks the whole tabbing idea if any SplitPanel is present in the window.

To fix this, this change disables the thumb component.

mabe02 commented 11 months ago

Thanks!

avl42 commented 11 months ago

Just wondering, if this is the correct solution. If the thumb is "disabled" then I'd presume there isn't any way to actually move it at all by the user.

I haven't used the SplitPanel yet, so I may be wrong here, but for a "way forward" I would have expected some keybindings being added to the "thumb", both, for actually moving it and for tabbing out of it forward or backwards. Finally, some new option could be defined on the SplitPane to disable the thumb in cases where it really doesn't need to be moveable by the user.

I'm just curious if I'm just talking from my ignorance, or whether it's just a question of someone starting to implement the fancier approach.

On Sun, Jul 16, 2023 at 3:00 PM mabe02 @.***> wrote:

Thanks!

— Reply to this email directly, view it on GitHub https://github.com/mabe02/lanterna/pull/542#issuecomment-1637078876, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIDBMRXKTS5NPCLZHG57GTXQPQYFANCNFSM433MD3IQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mabe02 commented 11 months ago

Good question. I didn't actually test it :D Will give it a try

mabe02 commented 11 months ago

This was a contributed component and upon closer inspection it looks like it only implemented interactions through mouse, not keyboard. The original issue is valid though, once the thumb gets focus you can "escape" from it. The bugfix technically works, but still the component can get into a focused state where nothing seems to be in focus. I'll try to see if I can fix it.

mabe02 commented 11 months ago

I've fixed a couple of things, but the resize is still a bit weird because it only works by mouse (apparently; I didn't get it to work). Will see if I can fix keyboard-based resizing next.