diff --git a/table/lable.gd b/table/lable.gd deleted file mode 100644 index ccf4a45e..00000000 --- a/table/lable.gd +++ /dev/null @@ -1,24 +0,0 @@ -extends Label - -static var styles: = [null, null] -static var init_done: = false - - -func _init() -> void: - if init_done: - init_done = true - var style_light: = get_theme_stylebox('normal') - style_light.bg_color = Color.GRAY - styles[1] = style_light - var style_dark: = style_light.duplicate(true) - style_dark.bg_color = Color(0.12, 0.12, 0.12) - styles[0] = style_dark - ProjectSettings.connect('settings_changed', apply_colors) - apply_colors() - - -func apply_colors(): - if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false): - add_theme_stylebox_override('normal', styles[1]) - else: - add_theme_stylebox_override('normal', styles[0]) diff --git a/table/lable.gd.uid b/table/lable.gd.uid deleted file mode 100644 index 2b9e2c3f..00000000 --- a/table/lable.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bjw0gwcqxx30d diff --git a/table/lable.tscn b/table/lable.tscn index 25c38ded..17064cc1 100644 --- a/table/lable.tscn +++ b/table/lable.tscn @@ -1,7 +1,5 @@ [gd_scene load_steps=3 format=3 uid="uid://dwphmxstaxn4v"] -[ext_resource type="Script" uid="uid://bjw0gwcqxx30d" path="res://table/lable.gd" id="1_xk0u2"] - [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yign5"] bg_color = Color(0.117647, 0.117647, 0.117647, 0.85098) border_width_bottom = 2 @@ -11,9 +9,36 @@ corner_radius_top_right = 3 corner_radius_bottom_right = 3 corner_radius_bottom_left = 5 +[sub_resource type="GDScript" id="GDScript_dhnrx"] +script/source = "extends Label + +static var styles: = [null, null] +static var init_done: = false + + +func _init() -> void: + if init_done: + init_done = true + var style_light: = get_theme_stylebox('normal') + style_light.bg_color = Color.GRAY + styles[1] = style_light + var style_dark: = style_light.duplicate(true) + style_dark.bg_color = Color(0.12, 0.12, 0.12) + styles[0] = style_dark + ProjectSettings.connect('settings_changed', apply_colors) + apply_colors() + + +func apply_colors(): + if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false): + add_theme_stylebox_override('normal', styles[1]) + else: + add_theme_stylebox_override('normal', styles[0]) +" + [node name="Lable" type="Label"] offset_right = 104.0 offset_bottom = 27.0 theme_override_colors/font_color = Color(1, 0.596078, 0.4, 1) theme_override_styles/normal = SubResource("StyleBoxFlat_yign5") -script = ExtResource("1_xk0u2") +script = SubResource("GDScript_dhnrx") diff --git a/table/node.gd b/table/node.gd deleted file mode 100644 index 2e2d23b9..00000000 --- a/table/node.gd +++ /dev/null @@ -1,28 +0,0 @@ -extends LineEdit - - -static var styles: = [null, null] -static var init_done: = false - -func _init() -> void: - if not init_done: - init_done = true - var style_light: = get_theme_stylebox('read_only') - style_light.bg_color = Color.GRAY - styles[1] = style_light - var style_dark: = style_light.duplicate(true) - style_dark.bg_color = Color(0.12, 0.12, 0.12) - styles[0] = style_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_readonly', Color.BLACK) - add_theme_color_override('font_color_placeholder', Color(0, 0, 0, 0.5)) - add_theme_stylebox_override('read_only', styles[1]) - else: - 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', styles[0]) diff --git a/table/node.gd.uid b/table/node.gd.uid deleted file mode 100644 index 7df355ca..00000000 --- a/table/node.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c71233c2tqc2u diff --git a/table/node.tscn b/table/node.tscn index 5178856f..1cbba263 100644 --- a/table/node.tscn +++ b/table/node.tscn @@ -1,6 +1,34 @@ [gd_scene load_steps=2 format=3 uid="uid://c1i4rwaajq7d5"] -[ext_resource type="Script" uid="uid://c71233c2tqc2u" path="res://table/node.gd" id="1_oh3pj"] +[sub_resource type="GDScript" id="GDScript_eegm3"] +script/source = "extends LineEdit + +static var styles: = [null, null] +static var init_done: = false + +func _init() -> void: + if not init_done: + init_done = true + var style_light: = get_theme_stylebox('read_only') + style_light.bg_color = Color.GRAY + styles[1] = style_light + var style_dark: = style_light.duplicate(true) + style_dark.bg_color = Color(0.12, 0.12, 0.12) + styles[0] = style_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_readonly', Color.BLACK) + add_theme_color_override('font_color_placeholder', Color(0, 0, 0, 0.5)) + add_theme_stylebox_override('read_only', styles[1]) + else: + 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', styles[0]) +" [node name="Label" type="LineEdit"] offset_right = 121.0 @@ -10,4 +38,4 @@ editable = false context_menu_enabled = false caret_blink = true caret_blink_interval = 0.1 -script = ExtResource("1_oh3pj") +script = SubResource("GDScript_eegm3") diff --git a/table/set-toggle.gd b/table/set-toggle.gd deleted file mode 100644 index 7484d2c6..00000000 --- a/table/set-toggle.gd +++ /dev/null @@ -1,33 +0,0 @@ -extends LineEdit - -static var styles: = [null, null] -static var init_done: = false - -var checkbutton_material: Material - - -func _init() -> void: - if not init_done: - init_done = true - var style_light: = get_theme_stylebox('read_only') - style_light.bg_color = Color.GRAY - styles[1] = style_light - var style_dark: = style_light.duplicate(true) - style_dark.bg_color = Color(0.12, 0.12, 0.12) - styles[0] = style_dark - ProjectSettings.connect('settings_changed', on_setting_changed) - call_deferred('on_setting_changed') - - -func on_setting_changed(): - checkbutton_material = $CheckButton.material - apply_colors() - - -func apply_colors(): - if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false): - add_theme_stylebox_override('read_only', styles[1]) - $CheckButton.material = null - else: - add_theme_stylebox_override('read_only', styles[0]) - $CheckButton.material = checkbutton_material diff --git a/table/set-toggle.gd.uid b/table/set-toggle.gd.uid deleted file mode 100644 index 35ebd964..00000000 --- a/table/set-toggle.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://btvrqnnjjum20 diff --git a/table/set-toggle.tscn b/table/set-toggle.tscn index ab5acf4f..0d3d8329 100644 --- a/table/set-toggle.tscn +++ b/table/set-toggle.tscn @@ -1,10 +1,45 @@ [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="GDScript" id="GDScript_kvru5"] +script/source = "extends LineEdit + +static var styles: = [null, null] +static var init_done: = false + +var checkbutton_material: Material + + +func _init() -> void: + if not init_done: + init_done = true + var style_light: = get_theme_stylebox('read_only') + style_light.bg_color = Color.GRAY + styles[1] = style_light + var style_dark: = style_light.duplicate(true) + style_dark.bg_color = Color(0.12, 0.12, 0.12) + styles[0] = style_dark + ProjectSettings.connect('settings_changed', on_setting_changed) + call_deferred('on_setting_changed') + + +func on_setting_changed(): + checkbutton_material = $CheckButton.material + apply_colors() + + +func apply_colors(): + if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false): + add_theme_stylebox_override('read_only', styles[1]) + $CheckButton.material = null + else: + add_theme_stylebox_override('read_only', styles[0]) + $CheckButton.material = checkbutton_material +" + [sub_resource type="ShaderMaterial" id="ShaderMaterial_wrw87"] shader = ExtResource("2_wrw87") @@ -20,7 +55,7 @@ offset_right = 85.0 offset_bottom = 27.0 theme_override_styles/focus = SubResource("StyleBoxEmpty_f4oye") editable = false -script = ExtResource("1_kvru5") +script = SubResource("GDScript_kvru5") [node name="CheckButton" type="CheckButton" parent="."] material = SubResource("ShaderMaterial_wrw87") diff --git a/table/settings-toggle.gd b/table/settings-toggle.gd deleted file mode 100644 index 03a02293..00000000 --- a/table/settings-toggle.gd +++ /dev/null @@ -1,33 +0,0 @@ -extends LineEdit - -static var styles: = [null, null] -static var init_done: = false - -var checkbutton_material: Material - - -func _init() -> void: - ProjectSettings.connect('settings_changed', on_setting_changed) - if not init_done: - init_done = true - var style_light: = get_theme_stylebox('read_only') - style_light.bg_color = Color.GRAY - styles[1] = style_light - var style_dark: = style_light.duplicate(true) - style_dark.bg_color = Color(0.12, 0.12, 0.12) - styles[0] = style_dark - - -func on_setting_changed(): - checkbutton_material = $CheckButton.material - apply_colors() - - -func apply_colors(): - var is_light: bool = ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false) - if is_light: - add_theme_stylebox_override('read_only', styles[1]) - $CheckButton.material = null - else: - add_theme_stylebox_override('read_only', styles[0]) - $CheckButton.material = checkbutton_material diff --git a/table/settings-toggle.gd.uid b/table/settings-toggle.gd.uid deleted file mode 100644 index 729538f3..00000000 --- a/table/settings-toggle.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bh7mb1aeu1uk6 diff --git a/table/settings-toggle.tscn b/table/settings-toggle.tscn index 3dac0144..eafa4929 100644 --- a/table/settings-toggle.tscn +++ b/table/settings-toggle.tscn @@ -1,10 +1,51 @@ [gd_scene load_steps=6 format=3 uid="uid://5rw652cmnybi"] -[ext_resource type="Script" uid="uid://bh7mb1aeu1uk6" path="res://table/settings-toggle.gd" id="1_8lkgc"] [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") @@ -22,7 +63,7 @@ shortcut_keys_enabled = false middle_mouse_paste_enabled = false selecting_enabled = false deselect_on_focus_loss_enabled = false -script = ExtResource("1_8lkgc") +script = SubResource("GDScript_vuu0m") [node name="CheckButton" type="CheckButton" parent="."] material = SubResource("ShaderMaterial_8lkgc") diff --git a/table/ячейка-2.gd b/table/ячейка-2.gd deleted file mode 100644 index 42adbafc..00000000 --- a/table/ячейка-2.gd +++ /dev/null @@ -1,39 +0,0 @@ -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]) diff --git a/table/ячейка-2.gd.uid b/table/ячейка-2.gd.uid deleted file mode 100644 index 4917e9d0..00000000 --- a/table/ячейка-2.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dqexdg24cp6rq diff --git a/table/ячейка-2.tscn b/table/ячейка-2.tscn index 0c3566e4..55848ef7 100644 --- a/table/ячейка-2.tscn +++ b/table/ячейка-2.tscn @@ -1,9 +1,49 @@ [gd_scene load_steps=3 format=3 uid="uid://dspa16ufrpanp"] -[ext_resource type="Script" uid="uid://dqexdg24cp6rq" path="res://table/ячейка-2.gd" id="1_0fmuf"] - [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_mla3y"] +[sub_resource type="GDScript" id="GDScript_kmv1d"] +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]) +" + [node name="LineEdit" type="LineEdit"] offset_right = 58.0 offset_bottom = 33.0 @@ -18,4 +58,4 @@ selecting_enabled = false deselect_on_focus_loss_enabled = false caret_blink = true caret_blink_interval = 0.1 -script = ExtResource("1_0fmuf") +script = SubResource("GDScript_kmv1d") diff --git a/table/ячейка-цвет.gd b/table/ячейка-цвет.gd deleted file mode 100644 index 5635b9c1..00000000 --- a/table/ячейка-цвет.gd +++ /dev/null @@ -1,24 +0,0 @@ -extends ColorPickerButton - -static var styles = [null, null] -static var init_done: = false - - -func _init() -> void: - if not init_done: - init_done = true - var style_light: = get_theme_stylebox('normal') - style_light.bg_color = Color.GRAY - styles[1] = style_light - var style_dark: = style_light.duplicate(true) - style_dark.bg_color = Color(0.12, 0.12, 0.12) - styles[0] = style_dark - ProjectSettings.connect('settings_changed', apply_colors) - apply_colors() - - -func apply_colors(): - if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false): - add_theme_stylebox_override('normal', styles[1]) - else: - add_theme_stylebox_override('normal', styles[0]) diff --git a/table/ячейка-цвет.gd.uid b/table/ячейка-цвет.gd.uid deleted file mode 100644 index 31e07acc..00000000 --- a/table/ячейка-цвет.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b36c83manfems diff --git a/table/ячейка-цвет.tscn b/table/ячейка-цвет.tscn index 8171867e..0b143b65 100644 --- a/table/ячейка-цвет.tscn +++ b/table/ячейка-цвет.tscn @@ -1,9 +1,11 @@ [gd_scene load_steps=3 format=3 uid="uid://cug5xjbfdm7x7"] -[ext_resource type="Script" uid="uid://b36c83manfems" path="res://table/ячейка-цвет.gd" id="1_ce8lu"] - [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ce8lu"] +[sub_resource type="GDScript" id="GDScript_dds53"] +script/source = "extends ColorPickerButton +" + [node name="ячейка-цвет" type="ColorPickerButton"] anchors_preset = 15 anchor_right = 1.0 @@ -11,4 +13,4 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 theme_override_styles/focus = SubResource("StyleBoxEmpty_ce8lu") -script = ExtResource("1_ce8lu") +script = SubResource("GDScript_dds53")