1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Transparency updates (#525)

* Update with theme instead of only value change

instantly updates with theme (old version updated on value change only)

* shortened some paths
This commit is contained in:
Variable 2021-08-29 22:19:08 +05:00 committed by GitHub
parent 48ed1cfd48
commit ab18e8bdb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -78,6 +78,10 @@ func change_theme(ID : int) -> void:
Global.control.theme.default_font = font
Global.default_clear_color = main_theme.get_stylebox("panel", "PanelContainer").bg_color
VisualServer.set_default_clear_color(Color(Global.default_clear_color))
if Global.control.get_node_or_null("AlternateTransparentBackground"): #also change color of AlternateTransparentBackground as well "if it exists"
var new_color = Global.default_clear_color
new_color.a = Global.control.get_node("AlternateTransparentBackground").color.a
Global.control.get_node("AlternateTransparentBackground").color = new_color
(Global.animation_timeline.get_stylebox("panel", "Panel") as StyleBoxFlat).bg_color = main_theme.get_stylebox("panel", "Panel").bg_color
var fake_vsplit_grabber : TextureRect = Global.animation_timeline.find_node("FakeVSplitContainerGrabber")

View file

@ -367,8 +367,8 @@ func window_transparency(value :float) -> void:
get_node("../../AlternateTransparentBackground").visible = false
else:
get_node("../../AlternateTransparentBackground").visible = true
var checker :ColorRect = get_parent().get_node("UI/ToolsAndCanvas/CanvasAndTimeline/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/ViewportContainer/Viewport/TransparentChecker")
var color :Color = Global.control.theme.get_stylebox("panel", "PanelContainer").bg_color
var checker :ColorRect = Global.transparent_checker
var color :Color = Global.default_clear_color
color.a = value
get_node("../../AlternateTransparentBackground").color = color
checker.transparency(value)