Skip to content
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

Layers button textures don't update properly #404

Closed
the-silv opened this issue Dec 18, 2020 · 2 comments
Closed

Layers button textures don't update properly #404

the-silv opened this issue Dec 18, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@the-silv
Copy link

Pixelorama version:
v0.8.2

OS/device including version:
Linux Debian 10

Issue description:
The buttons in the layer don't change icons after a theme change.
This only happens in the layer's buttons and not in the other's.

Steps to reproduce:

  • Change from dark theme to a different type of theme (light theme)
  • Click the hide/lock/link button
  • The textures should be taken from the dark theme instead of the correct one
@the-silv the-silv added the bug Something isn't working label Dec 18, 2020
@the-silv
Copy link
Author

SOLVED: add these lines of code in res://src/UI/Timeline/LayerButton.gd line 19:

# Reload button texture themes after they're created (or reloaded, see res://src/Classes/Project.gd:layers_changed())
	for button in [visibility_button, lock_button, linked_button]:
		var texture: TextureRect = button.get_child(0)
		var last_backslash = texture.texture.resource_path.get_base_dir().find_last("/")
		var button_category = texture.texture.resource_path.get_base_dir().right(last_backslash + 1)
		var normal_file_name = texture.texture.resource_path.get_file()
		var theme_type := Global.theme_type
		if theme_type == Global.Theme_Types.CARAMEL or (theme_type == Global.Theme_Types.BLUE and button_category != "tools"):
			theme_type = Global.Theme_Types.DARK

		var theme_type_string : String = Global.Theme_Types.keys()[theme_type].to_lower()
		texture.texture = load("res://assets/graphics/%s_themes/%s/%s" % [theme_type_string, button_category, normal_file_name])```

@OverloadedOrama
Copy link
Member

The issue has been fixed in ab583a7 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants