-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add inner_item_margin_*
Theme constants to the Tree control
#75460
Add inner_item_margin_*
Theme constants to the Tree control
#75460
Conversation
Basically #74321, but with different branches |
3574dd7
to
0b4bad9
Compare
The StyleBox does not work well if it draws anything: godot.windows.editor.dev.x86_64_rzRLAYLYKz.mp4It overrides any other style. If your aim is only to increase spacing, maybe it should be a theme constant instead? |
What I meant is that selected and focused style no longer shows, because item overrides it, which is wrong. |
Do you rather I force-push to this branch or create another PR altogether? |
Force-push this one, but you'll need to update commit message and title. |
Sure thing! |
0b4bad9
to
20d8892
Compare
20d8892
to
7178c71
Compare
Done! Thank you for the suggestion, this new approach is not only simpler, but also stabler when on RTL, given that the text no longer "moves" around when resizing the item. |
7178c71
to
ecbde52
Compare
Force-pushed again to update the default value for the editor theme. |
ecbde52
to
6590d94
Compare
6590d94
to
a8453cb
Compare
Github apparently had a stroke and force-closed my issue :/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The feature itself works correctly and implementation looks ok.
There is no linked proposal though.
There is now: godotengine/godot-proposals#6902 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The StyleBox does not work well if it draws anything:
I think we should start accepting cases where only StyleBoxEmpty
makes sense. We have pleeeeenty of controls that need 4 numeric definitions for each side. Using 4 constants or arbitrary using only one constant doesn't seem practical. Like, why we only add one constant here? And with such vague name too.
If we don't want to go the StyleBoxEmpty
route, then this PR needs to be updated to introduce 4 constants, like we did in #70901.
item_margin_top
item_margin_bottom
item_margin_left
item_margin_right
Interesting, if we were to add the |
0d94d51
to
ac7807e
Compare
@YuriSizov Went with the 4 constants route, as per #70901. |
Ah, right. That existing property is some weird hack, but I guess we have to work around it now. |
Not sure if it's just me but I do like the "before" look more. The "after" seems like wasting horizontal space for no reason/gain. |
I think the "wasted space" is an illusion because of that icon in particular (the teardrop rainbow). |
I definitely don't like how it looks now, and it bothered me for years at this point, but I agree that we can use a smaller extra margin by default (and we can perhaps respect the additional spacing editor setting here for a bit of extra space for those who need it). |
Great idea! |
b7d8f34
to
6938797
Compare
This PR adds the "inner_item_margin" Theme constant to the Tree Control. It behaves like a horizontal padding (in CSS), but only in the active writing direction (So on LTR it'll apply a left padding and on RTL right padding). The Editor Theme has been updated to make use of this and a result items in Trees and ItemLists no longer "hugs" their border, expressing a proper spacing instead.
6938797
to
670b7be
Compare
Thanks! |
inner_item_margin_*
Theme constants to the Tree control
Description
This PR adds the "inner_item_margin" Theme constant to the Tree Control.
It behaves like a horizontal padding (in CSS), but only in the active
writing direction (So on LTR it'll apply a left padding and on RTL right
padding).
This PR also makes use of this newly added feature to adjust the Editor Theme.
Previously, icons, like the ones in the FileSystemDock or even in the SceneTree, didn't have proper spacing between borders and would therefore appear too close to them, which was specially noticeable with large Corner Radius values, such as 6.
Comparisons
Currently (pre-PR)
File System Dock
File System Dock in RTL
With PR
File System Dock
File System Dock in RTL
Note 2: This superseeds my first PR and also my second PR