From 9bf7c3fa6e9fbeb845d19aac5e6c0f6bac42108d Mon Sep 17 00:00:00 2001 From: RedNicStone Date: Thu, 5 Nov 2026 11:36:42 +0000 Subject: [PATCH] Added small theme demo. --- scenes/theme_gallery.tscn | 11 ++++++ scripts/theme_gallery.gd | 75 ++++++++++++++++++++++++++++++++++++ scripts/theme_gallery.gd.uid | 1 + 3 files changed, 87 insertions(+) create mode 100644 scenes/theme_gallery.tscn create mode 100644 scripts/theme_gallery.gd create mode 100644 scripts/theme_gallery.gd.uid diff --git a/scenes/theme_gallery.tscn b/scenes/theme_gallery.tscn new file mode 100644 index 0000000..5127fc7 --- /dev/null +++ b/scenes/theme_gallery.tscn @@ -0,0 +1,11 @@ +[gd_scene format=3 uid="uid://b3gfs3dear3an"] + +[ext_resource type="Script" uid="uid://cublhdarwsfbk" path="res://scripts/theme_gallery.gd" id="1"] + +[node name="ThemeGallery" type="MarginContainer" unique_id=1432651951] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1") diff --git a/scripts/theme_gallery.gd b/scripts/theme_gallery.gd new file mode 100644 index 0000000..c68aebd --- /dev/null +++ b/scripts/theme_gallery.gd @@ -0,0 +1,75 @@ +extends MarginContainer + +func _ready() -> void: + for side in ["left", "top", "right", "bottom"]: + add_theme_constant_override("margin_" + side, 24) + var scroll := ScrollContainer.new() + scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED + add_child(scroll) + var layout := VBoxContainer.new() + layout.size_flags_horizontal = Control.SIZE_EXPAND_FILL + layout.add_theme_constant_override("separation", 18) + scroll.add_child(layout) + var heading := Label.new() + heading.text = "SURFACESIDE / THEME GALLERY" + heading.add_theme_font_size_override("font_size", 28) + layout.add_child(heading) + var subtitle := Label.new() + subtitle.text = "Square corners · orange focus · plum accents · choose a theme below" + subtitle.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART + layout.add_child(subtitle) + var picker := OptionButton.new() + picker.add_item("Soft / minimal borders") + picker.add_item("Original / high contrast") + picker.item_selected.connect(func(index: int) -> void: + theme = load("res://themes/theme.tres" if index == 0 else "res://themes/theme_highcontrast.tres") + for scope in get_tree().get_nodes_in_group("keyboard_focus_containers"): + if is_ancestor_of(scope): + scope._update_style() + ) + layout.add_child(picker) + var panel := PanelContainer.new() + layout.add_child(panel) + var controls := VBoxContainer.new() + controls.add_theme_constant_override("separation", 16) + panel.add_child(controls) + var buttons := HFlowContainer.new() + buttons.add_theme_constant_override("h_separation", 12) + controls.add_child(buttons) + for state in ["Normal", "Toggle / pressed", "Disabled"]: + var button := Button.new() + button.text = state + button.toggle_mode = state == "Toggle / pressed" + button.button_pressed = button.toggle_mode + button.disabled = state == "Disabled" + buttons.add_child(button) + var option := OptionButton.new() + option.add_item("Primary display") + option.add_item("Secondary display") + buttons.add_child(option) + var check := CheckBox.new() + check.text = "Telemetry enabled" + check.button_pressed = true + controls.add_child(check) + var input := LineEdit.new() + input.placeholder_text = "Command input — Tab to inspect focus" + controls.add_child(input) + var text := TextEdit.new() + text.custom_minimum_size.y = 110 + text.text = "Operator notes\nSelect text to inspect the selection color." + controls.add_child(text) + var slider := HSlider.new() + slider.value = 65 + controls.add_child(slider) + var progress := ProgressBar.new() + progress.value = 65 + controls.add_child(progress) + slider.value_changed.connect(func(value: float) -> void: progress.value = value) + var tabs := TabContainer.new() + tabs.custom_minimum_size.y = 100 + controls.add_child(tabs) + for title in ["Status", "Diagnostics"]: + var label := Label.new() + label.name = title + label.text = " " + title + " / All systems ready" + tabs.add_child(label) diff --git a/scripts/theme_gallery.gd.uid b/scripts/theme_gallery.gd.uid new file mode 100644 index 0000000..4ec9bc3 --- /dev/null +++ b/scripts/theme_gallery.gd.uid @@ -0,0 +1 @@ +uid://cublhdarwsfbk