godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 95 forks source link

Allow scaling icons in theme editor #5414

Open nonunknown opened 2 years ago

nonunknown commented 2 years ago

Describe the project you are working on

Godot Kart Racing

Describe the problem or limitation you are having in your project

I'm creating a custom theme, now for checkbox button, and I'm not allowed to scale the checkbox icon!

image

implementing this should fix https://github.com/godotengine/godot-proposals/issues/4442

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add a property to scale the icons for any node that uses this feature

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

a slider or spinbutton to scale icons

If this enhancement will not be used often, can it be worked around with a few lines of script?

no, as far as I know

Is there a reason why this should be core and not an add-on in the asset library?

core feature

YuriSizov commented 2 years ago

What do you mean by scaling them? Do you want to change the texture itself somehow? Or do you want to change the preview?

KoBeWi commented 2 years ago

CheckBox has expand_icon property that isn't available in the theme editor. Although it can be worked around by using custom preview scene.

YuriSizov commented 2 years ago

Yes, but the other linked proposal, https://github.com/godotengine/godot-proposals/issues/4442, implies that they want some way to control the scale precisely. Which is not related to the Theme editor. Preview you can indeed customize to your needs, but it cannot be do something that controls don't already support.

nonunknown commented 2 years ago

@YuriSizov I want to modify the checkbox size to any size I want, take button as an example, you can modify everything on it, Azagaya had an awesome idea, which is turning the button icons into styleboxes, that way we can customize anyway we want!

YuriSizov commented 2 years ago

This is completely unrelated to the Theme editor. The Theme editor lets you edit the Theme resource. It supports what controls support, and gives you tools to edit it. If you want more control over the icon of checkbox/checkbutton, then that's what you need to make a proposal about (with concrete properties that you want to add, and a description of how they should work).

QueenOfSquiggles commented 2 years ago

I like this proposal in general. I'll await the proposal compliant with @YuriSizov 's specifications <3

nonunknown commented 2 years ago

@YuriSizov sorry but I have no idea how to be more specific than that! why you can customize button in any way, but you cant do for its checkbox? gotcha?

YuriSizov commented 2 years ago

@nonunknown You can customize CheckBox in the same ways you can customize Button, because CheckBoxes are Buttons and they have all the same theme properties.

nonunknown commented 2 years ago

I'm talking about the checkbox/radio texture itself, that's what I want to resize, you cant resize that texture

Calinou commented 2 years ago

Downscaling textures significantly should be avoided for two reasons:

You can reduce a texture's size on import using the Max Size import option. This can be used if you want to use the source image at higher resolutions for other purposes, but it never needs to be displayed at full resolution within the project.

If you want a theme to scale well to any resolution, use a high base resolution for your project (such as 3840×2160) and design icons for that resolution. Use the 2d/canvas_items stretch mode to scale down to lower resolutions, and set the window size override to a lower value so the project spawns in a smaller window when running it from the editor (or enable fullscreen).

nonunknown commented 2 years ago

Downscaling textures significantly should be avoided for two reasons:

  • It results in aliasing if mipmaps are disabled (which is the default in 2D in Godot, as it saves memory when mipmaps are not needed).
  • It wastes memory by never displaying a texture at its full size.

actually if you want a proper size for your checkbox/radio texture you have to do that, and this proposal solves that

YuriSizov commented 2 years ago

I'm talking about the checkbox/radio texture itself, that's what I want to resize, you cant resize that texture

Okay, then you need to make a proposal for new properties of CheckBox/CheckButton to control scaling of the checkmark. As I mentioned before, this is unrelated to the Theme editor.

Edit: To reiterate. The Theme editor only displays and allows to edit theme properties of various controls. It doesn't add those properties and doesn't add any special properties on top of the existing ones. If you want to have more control over how the checkmark is rendered, then you need to propose what kind of properties you would want to introduce to CheckBox and CheckButton to get that control. Your other proposal, for example, is already like that. So I'm not sure why you've made this one.