From 8fccaa0e66c5ac78352697056ff5f7071674350e Mon Sep 17 00:00:00 2001 From: lepshiy Date: Fri, 16 Jan 2026 11:49:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B8=D0=BD=D0=B0=D0=BC=D0=B8=D1=87?= =?UTF-8?q?=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=86=D0=B2=D0=B5=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D1=8B=20=D1=82?= =?UTF-8?q?=D1=91=D0=BC=D0=BD=D0=BE=D0=B5/=D1=81=D0=B2=D0=B5=D1=82=D0=BB?= =?UTF-8?q?=D0=BE=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/tabs-switch/tab-switch.gd | 18 +++++++++++++++-- scenes/tabs-switch/tab-switch.tscn | 19 ++++-------------- scenes/настройки/настройки.gd | 31 ++++++++++++++++++++++++------ scenes/работа/работа.gd | 12 ++++++++++++ table/editl.gd | 17 ++++++++++++++++ table/editl.gd.uid | 1 + table/editl.tscn | 5 ++++- table/lable.gd | 16 +++++++++++++++ table/lable.gd.uid | 1 + table/lable.tscn | 5 ++++- table/node.gd | 16 +++++++++++++++ table/node.gd.uid | 1 + table/node.tscn | 5 ++++- table/set-toggle.tscn | 8 +++++++- table/set_toggle.gd | 16 +++++++++++++++ table/set_toggle.gd.uid | 1 + table/settings-toggle.tscn | 9 ++++----- table/settings_toggle.gd | 16 +++++++++++++++ table/settings_toggle.gd.uid | 1 + table/ячейка-2.tscn | 5 ++++- table/ячейка-цвет.tscn | 5 ++++- table/ячейка_2.gd | 24 +++++++++++++++++++++++ table/ячейка_2.gd.uid | 1 + table/ячейка_цвет.gd | 16 +++++++++++++++ table/ячейка_цвет.gd.uid | 1 + 25 files changed, 216 insertions(+), 34 deletions(-) create mode 100644 table/editl.gd create mode 100644 table/editl.gd.uid create mode 100644 table/lable.gd create mode 100644 table/lable.gd.uid create mode 100644 table/node.gd create mode 100644 table/node.gd.uid create mode 100644 table/set_toggle.gd create mode 100644 table/set_toggle.gd.uid create mode 100644 table/settings_toggle.gd create mode 100644 table/settings_toggle.gd.uid create mode 100644 table/ячейка_2.gd create mode 100644 table/ячейка_2.gd.uid create mode 100644 table/ячейка_цвет.gd create mode 100644 table/ячейка_цвет.gd.uid diff --git a/scenes/tabs-switch/tab-switch.gd b/scenes/tabs-switch/tab-switch.gd index 6e510749..fe4660f8 100644 --- a/scenes/tabs-switch/tab-switch.gd +++ b/scenes/tabs-switch/tab-switch.gd @@ -7,7 +7,7 @@ const TAB_TOSIGNAL_NAME = { 3: 'режим_эмс', 4: 'режим_эмс2', 5: 'режим_настройки' } - + func on_ems2_hide_pressed(state): set_tab_hidden(4, state) func _on_tab_changed(tab) -> void: signaller.emit_signal(TAB_TOSIGNAL_NAME[tab]) @@ -22,4 +22,18 @@ func _enter_tree() -> void: func on_setting_changed(): var ext_cu = ProjectSettings.get_setting('application/config/Внешнее управление', false) - get_parent().get_node('remote_control').visible = ext_cu + get_parent().get_node('remote_control').visible = ext_cu + apply_colors() + + +func apply_colors(): + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = StyleBoxFlat.new() + if is_light: + style.bg_color = Color.GRAY + add_theme_stylebox_override("tabbar_background", style) + add_theme_stylebox_override("panel", style) + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("tabbar_background", style) + add_theme_stylebox_override("panel", style) diff --git a/scenes/tabs-switch/tab-switch.tscn b/scenes/tabs-switch/tab-switch.tscn index 618318ed..c6d5adc6 100644 --- a/scenes/tabs-switch/tab-switch.tscn +++ b/scenes/tabs-switch/tab-switch.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=19 format=3 uid="uid://3slb0i3pvowc"] +[gd_scene load_steps=15 format=3 uid="uid://3slb0i3pvowc"] [ext_resource type="Script" uid="uid://bvo6tcreqyuex" path="res://scenes/tabs-switch/tab-switch.gd" id="1_fg0vd"] [ext_resource type="PackedScene" uid="uid://b276iygic5itk" path="res://scenes/работа/работа.tscn" id="2_u7p16"] @@ -10,15 +10,7 @@ [ext_resource type="Script" uid="uid://b5ykwyk5vpi6" path="res://scenes/tabs-switch/lbl_ready.gd" id="8_tidwt"] [ext_resource type="Script" uid="uid://roajn6c6wvc1" path="res://scenes/tabs-switch/тренаж_режим.gd" id="9_41d34"] -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tidwt"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_41d34"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_cw2ss"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_nmdfd"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_vap7n"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vap7n"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o1r22"] @@ -33,17 +25,14 @@ bg_color = Color(0, 100, 0, 1) [node name="panel" type="Panel"] offset_right = 1600.0 offset_bottom = 1200.0 -theme_override_styles/panel = SubResource("StyleBoxEmpty_tidwt") [node name="tab_switch" type="TabContainer" parent="."] layout_mode = 0 offset_right = 1600.0 offset_bottom = 1200.0 tooltip_text = "Переключает режимы работы программы" -theme_override_styles/tab_focus = SubResource("StyleBoxEmpty_41d34") -theme_override_styles/tab_disabled = SubResource("StyleBoxEmpty_cw2ss") -theme_override_styles/tabbar_background = SubResource("StyleBoxEmpty_nmdfd") -theme_override_styles/panel = SubResource("StyleBoxEmpty_vap7n") +theme_override_styles/tabbar_background = SubResource("StyleBoxFlat_vap7n") +theme_override_styles/panel = SubResource("StyleBoxFlat_vap7n") current_tab = 0 script = ExtResource("1_fg0vd") diff --git a/scenes/настройки/настройки.gd b/scenes/настройки/настройки.gd index 90003c83..a92abf6c 100644 --- a/scenes/настройки/настройки.gd +++ b/scenes/настройки/настройки.gd @@ -65,7 +65,8 @@ const SETTING_TABLE = [ ['Список своих протоколов', TableEdit, TableEdit, 'Список протоколов целей, по которым запрещено работать' ], ['Цвет кнопки \"Подавление\"', TableEdit, TableColorPick, 'Цвет кнопки. Введено по требованию ПЗ' ], ['Цвет фона схемы', TableEdit, TableColorPick, 'Схема прибора Э2. Изменение цвет фона'], - ['Цвет схемы', TableEdit, TableColorPick, 'Схема прибора Э2. Изменение цвет схемы '] ] + ['Цвет схемы', TableEdit, TableColorPick, 'Схема прибора Э2. Изменение цвет схемы '], + ['Цвет темы программы', TableEdit, TableToggle, 'ВЫКЛ - темная тема, ВКЛ - светлая тема']] ## TODO: Придумать как избавиться от индексов @@ -81,6 +82,7 @@ const GOS_BTN = 52 ## Разрешить работу по своим ц const COLOR_BTN_ACT = 54 ## Цвет кнопки "Подавление" const COLOR_WHITE = 55 ## Цвет фона схемы const COLOR_BLACK = 56 ## Цвет схемы +const COLOR_THEME = 57 ## Цвет темы var name_to_line_index: = {} ## Для преобразования названия параметра в номер строки @@ -205,6 +207,7 @@ func setting_tab(): if edit_node: if edit_node is LineEdit: $scroll_set/table.set_node_control(1, i, true) + edit_node.connect("text_submitted", Callable(self, "_on_line_edit_enter_pressed").bind(i)) $scroll_set/table.set_node_editable(1, COMMIT, false) $scroll_set/table.set_columns_min_size([600, 950]) $scroll_set/table.set_columns_alignments(ALIGNMENT) @@ -266,13 +269,22 @@ func button_settings(): var arr_col_b = JSON.parse_string(json_col_b) color_black.color = Color(arr_col_b[0], arr_col_b[1], arr_col_b[2], arr_col_b[3]) if arr_col_b else Color.WHITE_SMOKE color_black.text = JSON.stringify(arr_col_b) + var theme_node = $scroll_set/table.get_node2(1, COLOR_THEME).get_children()[0] + theme_node.connect("pressed", on_theme_toggle_pressed.bind(theme_node)) + theme_node.set_pressed(false) + on_theme_toggle_pressed(theme_node) -func _update_theme_colors(): - var color_white = $scroll_set/table.get_node2(1, COLOR_WHITE) - var color_black = $scroll_set/table.get_node2(1, COLOR_BLACK) - on_color_closed_w(color_white) - on_color_closed_b(color_black) +func on_theme_toggle_pressed(btn: CheckButton) -> void: + var is_light = btn.button_pressed + ProjectSettings.set_setting("application/config/Цвет темы программы", is_light) + + +#func _update_theme_colors(): + #var color_white = $scroll_set/table.get_node2(1, COLOR_WHITE) + #var color_black = $scroll_set/table.get_node2(1, COLOR_BLACK) + #on_color_closed_w(color_white) + #on_color_closed_b(color_black) func on_color_closed_w(color_white: ColorPickerButton): @@ -338,3 +350,10 @@ func _on_btn_save_settings_pressed(): if file.store_string(json_string): log.info('Настройки сохранены в файл \"%s\"' % abs_path) file.close() + + +func _on_line_edit_enter_pressed(new_text: String, row_index: int) -> void: + var parameter = SETTING_TABLE[row_index][0] + ProjectSettings.set_setting("application/config/%s" % parameter, new_text) + _on_btn_save_settings_pressed() + get_viewport().gui_release_focus() diff --git a/scenes/работа/работа.gd b/scenes/работа/работа.gd index 195378f2..8c20f147 100644 --- a/scenes/работа/работа.gd +++ b/scenes/работа/работа.gd @@ -153,6 +153,18 @@ func on_settings_changed(): var json_col = ProjectSettings.get_setting('application/config/%s' % 'Цвет кнопки \"Подавление\"', '[1.0, 1.0, 1.0, 1.0]') var arr_col = JSON.parse_string(json_col) col_btn_act = Color(arr_col[0], arr_col[1], arr_col[2], arr_col[3]) if arr_col else Color.WHITE + apply_colors() + + +func apply_colors(): + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = StyleBoxFlat.new() + if is_light: + style.bg_color = Color.DARK_GRAY + add_theme_stylebox_override("panel", style) + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("panel", style) ## Обработчик сигнала изменения списка целей. diff --git a/table/editl.gd b/table/editl.gd new file mode 100644 index 00000000..5c5a73f4 --- /dev/null +++ b/table/editl.gd @@ -0,0 +1,17 @@ +extends LineEdit + +func _ready(): + _update_background() + +func _update_background() -> void: + 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) diff --git a/table/editl.gd.uid b/table/editl.gd.uid new file mode 100644 index 00000000..a2f655c3 --- /dev/null +++ b/table/editl.gd.uid @@ -0,0 +1 @@ +uid://bky7xlpaj21sj diff --git a/table/editl.tscn b/table/editl.tscn index e1d02dc1..44fd2976 100644 --- a/table/editl.tscn +++ b/table/editl.tscn @@ -1,7 +1,10 @@ -[gd_scene format=3 uid="uid://bvbvtgwps54yr"] +[gd_scene load_steps=2 format=3 uid="uid://bvbvtgwps54yr"] + +[ext_resource type="Script" uid="uid://bky7xlpaj21sj" path="res://table/editl.gd" id="1_xd53c"] [node name="Editl" type="LineEdit"] offset_right = 59.875 offset_bottom = 33.0 caret_blink = true caret_blink_interval = 0.5 +script = ExtResource("1_xd53c") diff --git a/table/lable.gd b/table/lable.gd new file mode 100644 index 00000000..a44af78e --- /dev/null +++ b/table/lable.gd @@ -0,0 +1,16 @@ +extends Label + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = get_theme_stylebox("normal").duplicate() + if is_light: + style.bg_color = Color.GRAY + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("normal", style) diff --git a/table/lable.gd.uid b/table/lable.gd.uid new file mode 100644 index 00000000..2b9e2c3f --- /dev/null +++ b/table/lable.gd.uid @@ -0,0 +1 @@ +uid://bjw0gwcqxx30d diff --git a/table/lable.tscn b/table/lable.tscn index 63372de7..25c38ded 100644 --- a/table/lable.tscn +++ b/table/lable.tscn @@ -1,4 +1,6 @@ -[gd_scene load_steps=2 format=3 uid="uid://dwphmxstaxn4v"] +[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) @@ -14,3 +16,4 @@ 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") diff --git a/table/node.gd b/table/node.gd new file mode 100644 index 00000000..39546d6d --- /dev/null +++ b/table/node.gd @@ -0,0 +1,16 @@ +extends LineEdit + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + 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) diff --git a/table/node.gd.uid b/table/node.gd.uid new file mode 100644 index 00000000..7df355ca --- /dev/null +++ b/table/node.gd.uid @@ -0,0 +1 @@ +uid://c71233c2tqc2u diff --git a/table/node.tscn b/table/node.tscn index 120347d2..5178856f 100644 --- a/table/node.tscn +++ b/table/node.tscn @@ -1,4 +1,6 @@ -[gd_scene format=3 uid="uid://c1i4rwaajq7d5"] +[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"] [node name="Label" type="LineEdit"] offset_right = 121.0 @@ -8,3 +10,4 @@ editable = false context_menu_enabled = false caret_blink = true caret_blink_interval = 0.1 +script = ExtResource("1_oh3pj") diff --git a/table/set-toggle.tscn b/table/set-toggle.tscn index 39a32422..df0add17 100644 --- a/table/set-toggle.tscn +++ b/table/set-toggle.tscn @@ -1,4 +1,6 @@ -[gd_scene load_steps=4 format=3 uid="uid://dgidt8lifm7xe"] +[gd_scene load_steps=6 format=3 uid="uid://dgidt8lifm7xe"] + +[ext_resource type="Script" uid="uid://btvrqnnjjum20" path="res://table/set_toggle.gd" id="1_kvru5"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_f4oye"] @@ -7,11 +9,14 @@ [sub_resource type="Theme" id="Theme_odxqp"] CheckButton/styles/focus = SubResource("StyleBoxEmpty_t3fqw") +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_kvru5"] + [node name="LineEdit" type="LineEdit"] offset_right = 85.0 offset_bottom = 27.0 theme_override_styles/focus = SubResource("StyleBoxEmpty_f4oye") editable = false +script = ExtResource("1_kvru5") [node name="CheckButton" type="CheckButton" parent="."] layout_mode = 0 @@ -20,3 +25,4 @@ offset_top = 1.0 offset_right = 65.0 offset_bottom = 25.0 theme = SubResource("Theme_odxqp") +theme_override_styles/focus = SubResource("StyleBoxEmpty_kvru5") diff --git a/table/set_toggle.gd b/table/set_toggle.gd new file mode 100644 index 00000000..39546d6d --- /dev/null +++ b/table/set_toggle.gd @@ -0,0 +1,16 @@ +extends LineEdit + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + 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) diff --git a/table/set_toggle.gd.uid b/table/set_toggle.gd.uid new file mode 100644 index 00000000..35ebd964 --- /dev/null +++ b/table/set_toggle.gd.uid @@ -0,0 +1 @@ +uid://btvrqnnjjum20 diff --git a/table/settings-toggle.tscn b/table/settings-toggle.tscn index b0edb12c..4e6dc4ab 100644 --- a/table/settings-toggle.tscn +++ b/table/settings-toggle.tscn @@ -1,26 +1,25 @@ [gd_scene load_steps=5 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_7hsq1"] - [sub_resource type="ShaderMaterial" id="ShaderMaterial_xxfw6"] shader = ExtResource("1_anyuq") -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_y8485"] +[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_7hsq1") 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 = ExtResource("1_8lkgc") [node name="CheckButton" type="CheckButton" parent="."] material = SubResource("ShaderMaterial_xxfw6") @@ -29,4 +28,4 @@ offset_left = 453.0 offset_top = 1.5 offset_right = 497.0 offset_bottom = 25.5 -theme_override_styles/focus = SubResource("StyleBoxEmpty_y8485") +theme_override_styles/focus = SubResource("StyleBoxEmpty_8lkgc") diff --git a/table/settings_toggle.gd b/table/settings_toggle.gd new file mode 100644 index 00000000..39546d6d --- /dev/null +++ b/table/settings_toggle.gd @@ -0,0 +1,16 @@ +extends LineEdit + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + 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) diff --git a/table/settings_toggle.gd.uid b/table/settings_toggle.gd.uid new file mode 100644 index 00000000..729538f3 --- /dev/null +++ b/table/settings_toggle.gd.uid @@ -0,0 +1 @@ +uid://bh7mb1aeu1uk6 diff --git a/table/ячейка-2.tscn b/table/ячейка-2.tscn index 2cbfae74..7a6e04bd 100644 --- a/table/ячейка-2.tscn +++ b/table/ячейка-2.tscn @@ -1,4 +1,6 @@ -[gd_scene load_steps=2 format=3 uid="uid://dspa16ufrpanp"] +[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"] @@ -16,3 +18,4 @@ selecting_enabled = false deselect_on_focus_loss_enabled = false caret_blink = true caret_blink_interval = 0.1 +script = ExtResource("1_0fmuf") diff --git a/table/ячейка-цвет.tscn b/table/ячейка-цвет.tscn index e239b982..6f61ad57 100644 --- a/table/ячейка-цвет.tscn +++ b/table/ячейка-цвет.tscn @@ -1,4 +1,6 @@ -[gd_scene format=3 uid="uid://cug5xjbfdm7x7"] +[gd_scene load_steps=2 format=3 uid="uid://cug5xjbfdm7x7"] + +[ext_resource type="Script" uid="uid://b36c83manfems" path="res://table/ячейка_цвет.gd" id="1_ce8lu"] [node name="ячейка-цвет" type="ColorPickerButton"] anchors_preset = 15 @@ -6,3 +8,4 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +script = ExtResource("1_ce8lu") diff --git a/table/ячейка_2.gd b/table/ячейка_2.gd new file mode 100644 index 00000000..ffa9151f --- /dev/null +++ b/table/ячейка_2.gd @@ -0,0 +1,24 @@ +extends LineEdit + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + 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() + if is_light: + style.bg_color = Color.GRAY + style_1.bg_color = Color.GRAY + add_theme_color_override("font_color", Color.BLACK) + add_theme_color_override("font_uneditable_color", Color.BLACK) + else: + style.bg_color = Color(0.12, 0.12, 0.12) + style_1.bg_color = Color(0.12, 0.12, 0.12) + 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", style) + add_theme_stylebox_override("read_only", style_1) diff --git a/table/ячейка_2.gd.uid b/table/ячейка_2.gd.uid new file mode 100644 index 00000000..4917e9d0 --- /dev/null +++ b/table/ячейка_2.gd.uid @@ -0,0 +1 @@ +uid://dqexdg24cp6rq diff --git a/table/ячейка_цвет.gd b/table/ячейка_цвет.gd new file mode 100644 index 00000000..ba8ffa61 --- /dev/null +++ b/table/ячейка_цвет.gd @@ -0,0 +1,16 @@ +extends ColorPickerButton + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = get_theme_stylebox("normal").duplicate() + if is_light: + style.bg_color = Color.GRAY + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("normal", style) diff --git a/table/ячейка_цвет.gd.uid b/table/ячейка_цвет.gd.uid new file mode 100644 index 00000000..31e07acc --- /dev/null +++ b/table/ячейка_цвет.gd.uid @@ -0,0 +1 @@ +uid://b36c83manfems