add releases view and component
This commit is contained in:
parent
898759fecf
commit
9173250580
@ -26,6 +26,7 @@ layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
mouse_filter = 1
|
||||
vertical_alignment = 1
|
||||
clip_text = true
|
||||
|
||||
[node name="EditItemButton" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
29
UI/Components/ReleaseItem.gd
Normal file
29
UI/Components/ReleaseItem.gd
Normal file
@ -0,0 +1,29 @@
|
||||
extends HBoxContainer
|
||||
class_name ReleaseItem
|
||||
|
||||
@onready var version_label: Label = %VersionLabel
|
||||
@onready var install_button: Button = %InstallButton
|
||||
@onready var install_templates_button: Button = %InstallTemplatesButton
|
||||
|
||||
var version: String
|
||||
|
||||
signal install_button_pressed
|
||||
signal install_templates_button_pressed
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
install_button.pressed.connect(func(): install_button_pressed.emit())
|
||||
install_templates_button.pressed.connect(func(): install_templates_button_pressed.emit())
|
||||
|
||||
|
||||
func set_version(v: String) -> void:
|
||||
version = v
|
||||
version_label.text = v
|
||||
|
||||
|
||||
func set_install_button_disabled(d: bool) -> void:
|
||||
install_button.disabled = d
|
||||
|
||||
|
||||
func set_templates_button_disabled(d: bool) -> void:
|
||||
install_templates_button.disabled = d
|
28
UI/Components/ReleaseItem.tscn
Normal file
28
UI/Components/ReleaseItem.tscn
Normal file
@ -0,0 +1,28 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://wpersx0asfqo"]
|
||||
|
||||
[ext_resource type="Script" path="res://UI/Components/ReleaseItem.gd" id="1_r5q2c"]
|
||||
|
||||
[node name="ReleaseItem" type="HBoxContainer"]
|
||||
offset_right = 512.0
|
||||
offset_bottom = 39.0
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource("1_r5q2c")
|
||||
|
||||
[node name="VersionLabel" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="InstallButton" type="Button" parent="HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Install"
|
||||
|
||||
[node name="InstallTemplatesButton" type="Button" parent="HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Export Templates"
|
@ -10,10 +10,10 @@ size = Vector2i(678, 419)
|
||||
script = ExtResource("1_ic3yh")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
offset_left = 12.0
|
||||
offset_top = 12.0
|
||||
offset_right = 666.0
|
||||
offset_bottom = 366.0
|
||||
offset_left = 8.0
|
||||
offset_top = 8.0
|
||||
offset_right = 670.0
|
||||
offset_bottom = 370.0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
3
UI/Main/ReleasesView.gd
Normal file
3
UI/Main/ReleasesView.gd
Normal file
@ -0,0 +1,3 @@
|
||||
extends VBoxContainer
|
||||
|
||||
const ITEM_SCENE := preload("res://UI/Components/ReleaseItem.tscn")
|
35
UI/Main/ReleasesView.tscn
Normal file
35
UI/Main/ReleasesView.tscn
Normal file
@ -0,0 +1,35 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://irfav51b5hf6"]
|
||||
|
||||
[ext_resource type="Script" path="res://UI/Main/ReleasesView.gd" id="1_firao"]
|
||||
|
||||
[node name="ReleasesView" type="VBoxContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_firao")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
text = "Releases"
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ReleaseItemsContainer" type="VBoxContainer" parent="PanelContainer/ScrollContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="FetchButton" type="Button" parent="CenterContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Fetch"
|
Loading…
Reference in New Issue
Block a user