29 lines
753 B
GDScript
29 lines
753 B
GDScript
extends LineEdit
|
|
|
|
var checkbutton_material: Material
|
|
|
|
|
|
func _enter_tree() -> void:
|
|
ProjectSettings.connect('settings_changed', on_setting_changed)
|
|
|
|
|
|
func on_setting_changed():
|
|
var cb = $CheckButton
|
|
checkbutton_material = cb.material
|
|
apply_colors()
|
|
|
|
|
|
func apply_colors():
|
|
var is_light: bool = ProjectSettings.get_setting('application/config/Цвет темы программы', false)
|
|
var style = get_theme_stylebox('read_only').duplicate()
|
|
if is_light:
|
|
style.bg_color = Color.GRAY
|
|
else:
|
|
style.bg_color = Color(0.12, 0.12, 0.12)
|
|
add_theme_stylebox_override('read_only', style)
|
|
var cb = $CheckButton
|
|
if is_light:
|
|
cb.material = null
|
|
else:
|
|
cb.material = checkbutton_material
|