Skip to content

[FEAT] Make use of theme_type_variation variable #10

@Pheubel

Description

@Pheubel

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When creating an option menu with the plugin, i wanted to make use of a theme that i can reuse for the rest of my controls, so that i have to do less manual work dragging and dropping assets.

When i was trying to change the buttons for the spinbox, i followed the instructions in the wiki. But when i made the custom type as described in the how to create a theme section it did not seem to apply it as expected. I have my theme as a project default to automatically apply it to control nodes to reduce work. Instead of arrow icons, i did not get any visible arrows

Describe the solution you'd like
Instead of setting the theme for each component in a SB control node from the inspector, it would be a nicer solution to have the theme_type_variation be set for each of the components in the SB control nodes and to instead use the theme attached to the control node as the base used for the components. I tried it on my own in the SBSpinButton

func _setup_variables() -> void:
	_update_popup_items()
	prev_button.theme = nav_theme
	next_button.theme = nav_theme
	prev_button.flat = nav_button_flat
	next_button.flat = nav_button_flat
	next_button.theme_type_variation = &"SBNextNav"
	prev_button.theme_type_variation = &"SBPrevNav"
	content_container.add_theme_constant_override("separation", nav_separation)

This small addition made my arrows appear as expected, as i had the icons set in the SBNextNav and SBPrevNav types in the theme.

To me it makes sense that it should be used, as the components are fully named and documented in the Theme module section on the wiki and as mentioned earlier, in the how to create a theme section, it is explained how to you should go about naming the types.

Describe alternatives you've considered
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions