76 lines
2.7 KiB
Plaintext
76 lines
2.7 KiB
Plaintext
[gd_scene load_steps=6 format=3 uid="uid://5rw652cmnybi"]
|
|
|
|
[ext_resource type="Shader" uid="uid://bw5mmbgeycwua" path="res://shaders/color-invers.gdshader" id="1_anyuq"]
|
|
|
|
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_il5wc"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_vuu0m"]
|
|
script/source = "extends LineEdit
|
|
|
|
static var styles = [[null, null], [null, null]]
|
|
static var init_done: = false
|
|
|
|
|
|
func _init() -> void:
|
|
if not init_done:
|
|
init_done = true
|
|
var style_0_light = get_theme_stylebox('normal')
|
|
var style_1_light = get_theme_stylebox('read_only')
|
|
|
|
style_0_light.bg_color = Color(0.12, 0.12, 0.12)
|
|
style_1_light.bg_color = Color(0.12, 0.12, 0.12)
|
|
styles[1][0] = style_0_light
|
|
styles[1][1] = style_1_light
|
|
|
|
var style_0_dark = style_0_light.duplicate(true)
|
|
var style_1_dark = style_1_light.duplicate(true)
|
|
|
|
style_0_light.bg_color = Color.GRAY
|
|
style_1_light.bg_color = Color.GRAY
|
|
styles[0][0] = style_0_dark
|
|
styles[0][1] = style_1_dark
|
|
ProjectSettings.connect('settings_changed', apply_colors)
|
|
apply_colors()
|
|
|
|
|
|
func apply_colors():
|
|
if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false):
|
|
add_theme_color_override('font_color', Color.BLACK)
|
|
add_theme_color_override('font_uneditable_color', Color.BLACK)
|
|
add_theme_stylebox_override('normal', styles[1][0])
|
|
add_theme_stylebox_override('read_only', styles[1][1])
|
|
else:
|
|
add_theme_color_override('font_color', Color(1.0, 0.596, 0.4))
|
|
add_theme_color_override('font_uneditable_color', Color(1.0, 0.596, 0.4))
|
|
add_theme_stylebox_override('normal', styles[0][0])
|
|
add_theme_stylebox_override('read_only', styles[0][1])
|
|
"
|
|
|
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_8lkgc"]
|
|
shader = ExtResource("1_anyuq")
|
|
|
|
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8lkgc"]
|
|
|
|
[node name="LineEdit" type="LineEdit"]
|
|
offset_right = 950.0
|
|
offset_bottom = 27.0
|
|
theme_override_colors/font_uneditable_color = Color(1, 0.596078, 0.4, 1)
|
|
theme_override_colors/font_color = Color(1, 0.596078, 0.4, 1)
|
|
theme_override_styles/focus = SubResource("StyleBoxEmpty_il5wc")
|
|
editable = false
|
|
context_menu_enabled = false
|
|
shortcut_keys_enabled = false
|
|
middle_mouse_paste_enabled = false
|
|
selecting_enabled = false
|
|
deselect_on_focus_loss_enabled = false
|
|
script = SubResource("GDScript_vuu0m")
|
|
|
|
[node name="CheckButton" type="CheckButton" parent="."]
|
|
material = SubResource("ShaderMaterial_8lkgc")
|
|
layout_mode = 0
|
|
offset_left = 453.0
|
|
offset_top = 1.5
|
|
offset_right = 497.0
|
|
offset_bottom = 25.5
|
|
theme_override_styles/focus = SubResource("StyleBoxEmpty_8lkgc")
|