Доработка, светлая тема. Решено с нагрузкой
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
extends LineEdit
|
||||
|
||||
func _ready():
|
||||
_update_background()
|
||||
|
||||
func _update_background() -> void:
|
||||
func _enter_tree() -> void:
|
||||
ProjectSettings.connect('settings_changed', 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:
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
extends Label
|
||||
|
||||
func _ready():
|
||||
_update_background()
|
||||
|
||||
func _process(_delta):
|
||||
_update_background()
|
||||
|
||||
func _update_background() -> void:
|
||||
func _enter_tree() -> void:
|
||||
ProjectSettings.connect('settings_changed', apply_colors)
|
||||
|
||||
|
||||
func apply_colors():
|
||||
var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false)
|
||||
var style = get_theme_stylebox("normal").duplicate()
|
||||
if is_light:
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
extends LineEdit
|
||||
|
||||
func _ready():
|
||||
_update_background()
|
||||
|
||||
func _process(_delta):
|
||||
_update_background()
|
||||
|
||||
func _update_background() -> void:
|
||||
func _enter_tree() -> void:
|
||||
ProjectSettings.connect('settings_changed', 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
|
||||
add_theme_color_override("font_color_readonly", Color.BLACK)
|
||||
add_theme_color_override("font_color_placeholder", Color(0, 0, 0, 0.5))
|
||||
else:
|
||||
style.bg_color = Color(0.12, 0.12, 0.12)
|
||||
add_theme_color_override("font_color_readonly", Color("#D8731A")) # тёмно-оранжевый
|
||||
add_theme_color_override("font_color_placeholder", Color(1, 1, 1, 0.5))
|
||||
add_theme_stylebox_override("read_only", style)
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
extends LineEdit
|
||||
|
||||
func _ready():
|
||||
_update_background()
|
||||
var checkbutton_material: Material
|
||||
|
||||
func _process(_delta):
|
||||
_update_background()
|
||||
|
||||
func _update_background() -> void:
|
||||
|
||||
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:
|
||||
@@ -14,3 +21,8 @@ func _update_background() -> void:
|
||||
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
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://dgidt8lifm7xe"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://dgidt8lifm7xe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://btvrqnnjjum20" path="res://table/set-toggle.gd" id="1_kvru5"]
|
||||
[ext_resource type="Shader" uid="uid://bw5mmbgeycwua" path="res://shaders/color-invers.gdshader" id="2_wrw87"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_f4oye"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wrw87"]
|
||||
shader = ExtResource("2_wrw87")
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_t3fqw"]
|
||||
|
||||
[sub_resource type="Theme" id="Theme_odxqp"]
|
||||
@@ -19,6 +23,7 @@ editable = false
|
||||
script = ExtResource("1_kvru5")
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="."]
|
||||
material = SubResource("ShaderMaterial_wrw87")
|
||||
layout_mode = 0
|
||||
offset_left = 21.0
|
||||
offset_top = 1.0
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
extends LineEdit
|
||||
|
||||
func _ready():
|
||||
_update_background()
|
||||
var checkbutton_material: Material
|
||||
|
||||
func _process(_delta):
|
||||
_update_background()
|
||||
|
||||
func _update_background() -> void:
|
||||
|
||||
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:
|
||||
@@ -14,3 +21,8 @@ func _update_background() -> void:
|
||||
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
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_il5wc"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xxfw6"]
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_8lkgc"]
|
||||
shader = ExtResource("1_anyuq")
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8lkgc"]
|
||||
@@ -25,7 +25,7 @@ deselect_on_focus_loss_enabled = false
|
||||
script = ExtResource("1_8lkgc")
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="."]
|
||||
material = SubResource("ShaderMaterial_xxfw6")
|
||||
material = SubResource("ShaderMaterial_8lkgc")
|
||||
layout_mode = 0
|
||||
offset_left = 453.0
|
||||
offset_top = 1.5
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
extends LineEdit
|
||||
|
||||
func _ready():
|
||||
_update_background()
|
||||
|
||||
func _process(_delta):
|
||||
_update_background()
|
||||
func _enter_tree() -> void:
|
||||
ProjectSettings.connect('settings_changed', apply_colors)
|
||||
|
||||
func _update_background() -> void:
|
||||
|
||||
func apply_colors():
|
||||
var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false)
|
||||
var style = get_theme_stylebox("normal").duplicate()
|
||||
var style_1 = get_theme_stylebox("read_only").duplicate()
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
extends ColorPickerButton
|
||||
|
||||
func _ready():
|
||||
_update_background()
|
||||
|
||||
func _process(_delta):
|
||||
_update_background()
|
||||
|
||||
func _update_background() -> void:
|
||||
func _enter_tree() -> void:
|
||||
ProjectSettings.connect('settings_changed', apply_colors)
|
||||
|
||||
|
||||
func apply_colors():
|
||||
var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false)
|
||||
var style = get_theme_stylebox("normal").duplicate()
|
||||
if is_light:
|
||||
|
||||
Reference in New Issue
Block a user