Skip to content

Commit

Permalink
Made Timeline & Tool buttons change depending on theme type
Browse files Browse the repository at this point in the history
Changed "LayerButtons" group to "UIButtons", as it includes most UI buttons.
  • Loading branch information
OverloadedOrama committed Dec 21, 2019
1 parent 8058cf2 commit 238bb3b
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

importer="texture"
type="StreamTexture"
path="res://.import/Next_Frame_hover.png-29e3bdc3bfb09dbf24f0d4ef57cdadd0.stex"
path="res://.import/Next_Frame_Hover.png-ba92cf8a5dbcda245610c78c96d6bf93.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Assets/Graphics/Dark Themes/Timeline/Next_Frame_hover.png"
dest_files=[ "res://.import/Next_Frame_hover.png-29e3bdc3bfb09dbf24f0d4ef57cdadd0.stex" ]
source_file="res://Assets/Graphics/Dark Themes/Timeline/Next_Frame_Hover.png"
dest_files=[ "res://.import/Next_Frame_Hover.png-ba92cf8a5dbcda245610c78c96d6bf93.stex" ]

[params]

Expand Down
Binary file removed Assets/Graphics/Dark Themes/Timeline/onion_skinning.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

importer="texture"
type="StreamTexture"
path="res://.import/onion_skinning.png-d0842f2eb16b7f7b21f3177f2d045336.stex"
path="res://.import/Play Backwards_Hover.png-a09d4ebe9901867db26b4f435a7e4260.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Assets/Graphics/Dark Themes/Timeline/onion_skinning.png"
dest_files=[ "res://.import/onion_skinning.png-d0842f2eb16b7f7b21f3177f2d045336.stex" ]
source_file="res://Assets/Graphics/Light Themes/Timeline/Play Backwards_Hover.png"
dest_files=[ "res://.import/Play Backwards_Hover.png-a09d4ebe9901867db26b4f435a7e4260.stex" ]

[params]

Expand Down
88 changes: 62 additions & 26 deletions Main.tscn

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Prefabs/LayerContainer.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ __meta__ = {
}

[node name="VisibilityButton" type="TextureButton" parent="." groups=[
"LayerButtons",
"UIButtons",
]]
margin_left = 6.0
margin_top = 5.0
Expand Down
13 changes: 8 additions & 5 deletions Scripts/PreferencesDialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,17 @@ func change_theme(ID : int) -> void:
Global.vertical_ruler.add_stylebox_override("pressed", ruler_style)
Global.vertical_ruler.add_stylebox_override("hover", ruler_style)
Global.vertical_ruler.add_stylebox_override("focus", ruler_style)
for button in get_tree().get_nodes_in_group("LayerButtons"):
for button in get_tree().get_nodes_in_group("UIButtons"):
var last_backslash = button.texture_normal.resource_path.get_base_dir().find_last("/")
var button_category = button.texture_normal.resource_path.get_base_dir().right(last_backslash + 1)
var normal_file_name = button.texture_normal.resource_path.get_file()
button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/%s" % [Global.theme_type, normal_file_name])
var hover_file_name = button.texture_hover.resource_path.get_file()
button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/%s" % [Global.theme_type, hover_file_name])
button.texture_normal = load("res://Assets/Graphics/%s Themes/%s/%s" % [Global.theme_type, button_category, normal_file_name])
if button.texture_hover:
var hover_file_name = button.texture_hover.resource_path.get_file()
button.texture_hover = load("res://Assets/Graphics/%s Themes/%s/%s" % [Global.theme_type, button_category, hover_file_name])
if button.texture_disabled:
var disabled_file_name = button.texture_disabled.resource_path.get_file()
button.texture_disabled = load("res://Assets/Graphics/%s Themes/Layers/%s" % [Global.theme_type, disabled_file_name])
button.texture_disabled = load("res://Assets/Graphics/%s Themes/%s/%s" % [Global.theme_type, button_category, disabled_file_name])

func _on_GridWidthValue_value_changed(value : float) -> void:
Global.grid_width = value
Expand Down

0 comments on commit 238bb3b

Please sign in to comment.