Added small theme demo.
This commit is contained in:
1 parent
2f854b7457
commit
9bf7c3fa6e
3 files changed
+87
No files matched your search
@@ -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)
|
||||
Reference in new issue
Block a user