1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Add a clear_color property to the themes

This commit is contained in:
Manolis Papadeas 2022-02-21 18:44:46 +02:00
parent add9ba926e
commit 200d1c73a1
8 changed files with 15 additions and 8 deletions

View file

@ -1613,6 +1613,7 @@ MenuButton/styles/focus = SubResource( 22 )
MenuButton/styles/hover = SubResource( 22 )
MenuButton/styles/normal = SubResource( 22 )
MenuButton/styles/pressed = SubResource( 22 )
Misc/colors/clear_color = Color( 0.231373, 0.258824, 0.337255, 1 )
OptionButton/colors/font_color = Color( 0.8, 0.8075, 0.8275, 1 )
OptionButton/colors/font_color_disabled = Color( 1, 1, 1, 0.3 )
OptionButton/colors/font_color_hover = Color( 0.88, 0.8845, 0.8965, 1 )

View file

@ -1663,6 +1663,7 @@ MenuButton/styles/focus = SubResource( 23 )
MenuButton/styles/hover = SubResource( 23 )
MenuButton/styles/normal = SubResource( 23 )
MenuButton/styles/pressed = SubResource( 23 )
Misc/colors/clear_color = Color( 0.866667, 0.701961, 0.439216, 1 )
OptionButton/colors/font_color = Color( 0.237305, 0.193295, 0.141827, 1 )
OptionButton/colors/font_color_disabled = Color( 0, 0, 0, 0.3 )
OptionButton/colors/font_color_hover = Color( 0.142383, 0.115977, 0.085096, 1 )

View file

@ -1709,6 +1709,7 @@ MenuButton/styles/focus = SubResource( 23 )
MenuButton/styles/hover = SubResource( 23 )
MenuButton/styles/normal = SubResource( 23 )
MenuButton/styles/pressed = SubResource( 23 )
Misc/colors/clear_color = Color( 0.141176, 0.141176, 0.141176, 1 )
OptionButton/colors/font_color = Color( 0.77832, 0.77832, 0.77832, 1 )
OptionButton/colors/font_color_disabled = Color( 1, 1, 1, 0.3 )
OptionButton/colors/font_color_hover = Color( 0.866992, 0.866992, 0.866992, 1 )

View file

@ -1706,6 +1706,7 @@ MenuButton/styles/focus = SubResource( 23 )
MenuButton/styles/hover = SubResource( 23 )
MenuButton/styles/normal = SubResource( 23 )
MenuButton/styles/pressed = SubResource( 23 )
Misc/colors/clear_color = Color( 0.243137, 0.243137, 0.243137, 1 )
OptionButton/colors/font_color = Color( 0.848039, 0.848039, 0.848039, 1 )
OptionButton/colors/font_color_disabled = Color( 1, 1, 1, 0.3 )
OptionButton/colors/font_color_hover = Color( 0.908823, 0.908823, 0.908823, 1 )

View file

@ -1706,6 +1706,7 @@ MenuButton/styles/focus = SubResource( 23 )
MenuButton/styles/hover = SubResource( 23 )
MenuButton/styles/normal = SubResource( 23 )
MenuButton/styles/pressed = SubResource( 23 )
Misc/colors/clear_color = Color( 1, 1, 1, 1 )
OptionButton/colors/font_color = Color( 0.25, 0.25, 0.25, 1 )
OptionButton/colors/font_color_disabled = Color( 0, 0, 0, 0.3 )
OptionButton/colors/font_color_hover = Color( 0.15, 0.15, 0.15, 1 )

View file

@ -1622,6 +1622,7 @@ MenuButton/styles/focus = SubResource( 22 )
MenuButton/styles/hover = SubResource( 22 )
MenuButton/styles/normal = SubResource( 22 )
MenuButton/styles/pressed = SubResource( 22 )
Misc/colors/clear_color = Color( 0.101961, 0.054902, 0.168627, 1 )
OptionButton/colors/font_color = Color( 0.79902, 0.780392, 0.820588, 1 )
OptionButton/colors/font_color_disabled = Color( 1, 1, 1, 0.3 )
OptionButton/colors/font_color_hover = Color( 0.879412, 0.868235, 0.892353, 1 )

View file

@ -27,7 +27,6 @@ var has_focus := false
var play_only_tags := true
var show_x_symmetry_axis := false
var show_y_symmetry_axis := false
var default_clear_color := Color.gray
# Preferences
var pressure_sensitivity_mode = PressureSensitivity.NONE

View file

@ -78,19 +78,21 @@ func change_theme(id: int) -> void:
Global.control.theme = theme
var clear_color: Color = theme.get_color("clear_color", "Misc")
if !clear_color:
var panel_stylebox: StyleBox = theme.get_stylebox("panel", "PanelContainer")
if panel_stylebox is StyleBoxFlat:
Global.default_clear_color = panel_stylebox.bg_color
clear_color = panel_stylebox.bg_color
else:
Global.default_clear_color = icon_color
VisualServer.set_default_clear_color(Global.default_clear_color)
clear_color = Color.gray
VisualServer.set_default_clear_color(clear_color)
# Temporary code
var layer_button_pcont: PanelContainer = Global.animation_timeline.find_node(
"LayerButtonPanelContainer"
)
var lbpc_stylebox: StyleBoxFlat = layer_button_pcont.get_stylebox("panel", "PanelContainer")
lbpc_stylebox.bg_color = Global.default_clear_color
lbpc_stylebox.bg_color = clear_color
# Will no longer be needed when Godot 3.5 is out
var top_menu_style: StyleBox = theme.get_stylebox("TopMenu", "Panel")