MonoGame.Extended icon indicating copy to clipboard operation
MonoGame.Extended copied to clipboard

[GUI] Focus improvements

Open thecack opened this issue 7 years ago • 3 comments

This isn't so much an issue as it would be a feature request - and I'm not really sure how pull requests work. I've noticed that you're working on a 2.0 version, and I feel like there's a couple things that could be considered about how focus is handled.

First, that some controls might not want to be focused. Things like generic labels and panels probably shouldn't consume focus from buttons and the like on errant pointer presses. Adding a CanFocus property to Control and modifying GuiSystem to respect it would be pretty minimal.

Second, a focus-manager type system. It's definitely a more keyboard specific thing, but it's nice to be able to advance to the next or previous focusable control. I would think you could get an enumerable of focusable items from GuiSystem with the currently focused control as the current item. WinForms uses TabStops, which aren't particularly elegant but could allow for a bit more behavior customization.

Third, a FocusedControlStyle. Visual cues are always a nice touch to know what particular control has focus.

thecack avatar Apr 06 '18 22:04 thecack

@thecack All good ideas. I'll consider them for 2.0.

craftworkgames avatar Apr 08 '18 12:04 craftworkgames

I'm quite new to this project, but it seems to be really useful!

I've written a couple UI frameworks during my time as dev. @craftworkgames going to dig into the UI system and will PR if I think I have something to contribute :)

HateMeLikeAPro avatar Apr 12 '18 15:04 HateMeLikeAPro

@itswiki Just keep in mind that I've done some serious refactoring in the 2.0 branch. The GUI system will be quite difference in the next major release.

craftworkgames avatar Apr 18 '18 04:04 craftworkgames