-
-
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
Tweak Quick Open theming #101598
Tweak Quick Open theming #101598
Conversation
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.
Tested locally, it works as expected.
The amount of spacing looks good to me. However, the icons aren't centered in the hovered/selected area:
There are 6 pixels above the icon and 7 pixels below the icon. (The icon is 36 pixels tall.)
I can notice this issue across every item, so it's not specific to some items on the list.
I suggest adding 1 pixel of padding at the top so it's even.
Sure. This is because the vboxcontainer with the text is 37px tall, because text has this tendence of taking more space than what it seems like it should. I'll fix it. |
90ba26b
to
3ddf6ad
Compare
Doned, bumping up the "anti-separation" of the two labels by 1 more pixel looks good to me even with the maximum ascents/descents in the default font. |
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.
Since the dialog redesign is new to 4.4, I think it'd be great to merge the theming fixes timely. |
3ddf6ad
to
b857873
Compare
b857873
to
779f5fb
Compare
Okay, I added SNAME where you suggested, but I honestly still don't get when it should be used and why it was suggested only for some strings. "separation" outside of the lines I changed also don't have it, "selected" next to my lines doesn't, and even "margin_*" constants in the lines I did change. |
@MewPurPur I searched where else in codebase SNAME is used for specific strings (where specific strings are cached already and where is is used multiple times). Unfortunately, there is no consistency in it right now to make it clear where it should or should not be used, but as I see, if it was used multiple times in other places, it's ok to use it in new code. |
Here's what I don't think there is an "official" recommendation for when to use it, but if i were to make one, I'd probably suggest using it for most static strings since most are expected to be kept in memory for one reason or another anyway. The cost of a reference to it is rather small. |
The general recommendation is to use it in hot paths, and not to use it everywhere. In modern cases speed usually wins over memory when prioritising but there's no use in doing it in paths that are called exactly once in a run Note further that |
@Ivorforce thanks for explanation. So actually "if it was used multiple times in other places" is not necessary, it is enough if it is already used in any "common" path (i.e. already cached). |
"Exactly once" is not that obvious. |
I think the important takeaway is that optimization (or any code pattern) should be applied with intentionality, with an understanding of why it's used, and that any pattern used "just because" is a code smell.
Edit: note to self to write some contributor documentation on some of this |
Thanks! |
Addresses some, but not all points in: godotengine/godot-proposals#11558
The things I've fixed are the issues with spacing and sizing.
Changed up the structure of list elements to prevent thumbnails from stretching vertically. Here's how this looked before:
Changed up the structure of grid elements too, to give some space above and to have better spacing. Here's how it looked before:
And there's now no spacing between elements, prevent you from accidentally clicking on the tiny space between.
I've also fixed the ugly hover style, which came from overriding the nonexistent "hover" style instead of "hovered".
Here's how it looks now:
Please tell me if you think the spacing is too tight now.