-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Allow ScrollContainer to be clicked for focus and border #59362
Conversation
dce8b7a
to
085682c
Compare
We discussed this in a PR meeting. This is probably good, needs an approving review. |
085682c
to
2ba3a4f
Compare
aa17944
to
0c221f0
Compare
a222882
to
06a016b
Compare
This has now been generalised in order to make the focus border available in any instance of ScrollContainer. I hope this is OK as I didn't make a proposal about it, but since this behaviour is consistent with Tree and ItemList (using the As a consequence, many more editor docks/panels now have focus borders which makes the editor more consistent and accessible. |
Found a bug in TileSet editor: Here's a rebased patch: |
06a016b
to
aa5e785
Compare
aa5e785
to
a9ba52d
Compare
Something went wrong and I became author of the commit. |
That's weird, I suppose it was the way I applied the patch. Does it matter? |
By the way, I have addressed your issue with the latest push. I thought that part of the |
I think the problem is that you are ignoring clipping for the focus style. Even if you fix tile editor, this makes a generic problem with nested scroll containers and there might be other broken places.
Probably. There is a way to change the author though. In worst case you can manually modify the patch. |
That's true - as far as I can tell it happens with |
76820fc
to
2a90293
Compare
2a90293
to
4b9c8c2
Compare
The default theme no longer includes borders for ScrollContainers so there should not be a general problem with the slightly hacky method I used. |
@ator-dev If it's fine with you, I can try to implement this on |
Of course, I'd be delighted to see this merged! Go ahead @pafuent :) |
Superseded by #97521. |
The SceneTree and FileSystem docks have focus borders automatically since TreeDialog is one of the few classes which provides this, and also offer focus-on-click. In my opinion the style of this works well with Godot and is potentially useful for checking what the user is currently doing - for example, if they are editing the SceneTree then that dock has focus.
In order to make the Inspector dock more consistent with this style, since it has a similar feel and context anyway, I have made it (a) clickable and (b) draw the same border when focused. This is a really useful feature for another PR I'm making soon which needs to recognise what dock the user is working in, but it certainly has other use cases (e.g. for plugins) as well and just looks nice.
Problems:
The border-focus stylebox is drawn underneath elements such as text boxes. I don't know if this matters, but it's something that could be fixed if necessary.This has now been fixed by using a more general and standard method for drawing the focus stylebox.When doing something like dragging a slider immediately after something else was focused, focus returns to that area and not the Inspector. This probably doesn't matter though and, again, could be fixed.This still occurs but is no longer a problem, since recent updates have made focus changes more stable.Update 2022-09-01: additionally, the focus border has been made available in ScrollContainer as a whole.