add releases view and component

This commit is contained in:
Lera Elvoé 2023-05-25 14:30:21 +03:00
parent 898759fecf
commit 9173250580
Signed by: yagich
SSH Key Fingerprint: SHA256:6xjGb6uA7lAVcULa7byPEN//rQ0wPoG+UzYVMfZnbvc
6 changed files with 100 additions and 4 deletions

View File

@ -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

View 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

View 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"

View File

@ -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
View File

@ -0,0 +1,3 @@
extends VBoxContainer
const ITEM_SCENE := preload("res://UI/Components/ReleaseItem.tscn")

35
UI/Main/ReleasesView.tscn Normal file
View 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"