-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 scrollbar offset theme constants to Tree #70901
Conversation
a4407db
to
4cbb393
Compare
I don't like that we resort to hacks to fix our inconsistencies instead of making things more consistent. Personally, I constantly have to work around the limitation of the scroll container, adding a margin container and making it a clipping rect. So I wouldn't mind having more control in both elements here, which gives us an opportunity to harmonize them instead of ad-hoc fixing the Tree in this manner. I also don't like that offsets do the opposite of their name and positive numbers are moving the scrollbar outwards instead of inwards. Though that's an easy change. I would detach the position of scrollbars from the stylebox's margins completely in Tree. We can still use the 4 constants, or we can add a new stylebox that would only contribute margins (and thus has to be StyleBoxEmpty). Same in the scroll container, we need a set of margins for the content and another for the scrollbars. Can be 4 constants each, or 2 margin-only styleboxes. |
4cbb393
to
27594b8
Compare
Updated:
|
27594b8
to
669f065
Compare
669f065
to
6f0e615
Compare
6f0e615
to
a11d604
Compare
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.
Okay, I'm done with the review. I think all the math checks out, so LGTM!
Approving tentatively but the comments above need to be resolved.
PS. I would like to repeat that it'd be nice to do the same to ScrollContainer, but it seems to be a harder task at the moment. Namely because we have a hack for the animation editor, introduced in b659fd6.
a11d604
to
74097cb
Compare
74097cb
to
498d538
Compare
Updated. I replaced |
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.
Thanks! |
This PR adds
scrollbar_offset_{left,top,right,bottom}
theme constants toTree
. These constants move scrollbar edges toward the correspoinding border.Tree
allows setting a background stylebox whileScrollContainer
don't. Scrollbars inTree
use stylebox margins when placing the scrollbars.The screenshot below is taken from Editor Settings. The scrollbar on the left is from
Tree
, and the scrollbar on the right is fromScrollContainer
.From top to bottom:
Tree
's panel stylebox.)Production edit: Closes #73139