Skip to content

Commit

Permalink
Rearrange button layout
Browse files Browse the repository at this point in the history
  • Loading branch information
noidexe committed Jun 8, 2022
1 parent 98566e7 commit 527f330
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 65 deletions.
120 changes: 67 additions & 53 deletions scenes/Main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,22 @@ margin_bottom = 580.0
custom_constants/separation = 10

[node name="MenuBar" type="VBoxContainer" parent="MarginContainer/HBox"]
margin_right = 201.0
margin_right = 250.0
margin_bottom = 560.0
rect_min_size = Vector2( 0, 50 )
rect_min_size = Vector2( 250, 50 )
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.5
custom_constants/separation = 10

[node name="Refresh" type="Button" parent="MarginContainer/HBox/MenuBar"]
margin_right = 201.0
margin_bottom = 68.0
hint_tooltip = "Refresh the database to show new available versions"
size_flags_horizontal = 3
[node name="Version&Refresh" type="HBoxContainer" parent="MarginContainer/HBox/MenuBar"]
margin_right = 250.0
margin_bottom = 87.0
size_flags_vertical = 3
text = "Refresh"

[node name="VersionSelect" type="OptionButton" parent="MarginContainer/HBox/MenuBar"]
margin_top = 78.0
margin_right = 201.0
margin_bottom = 146.0
[node name="VersionSelect" type="OptionButton" parent="MarginContainer/HBox/MenuBar/Version&Refresh"]
margin_right = 193.0
margin_bottom = 87.0
hint_tooltip = "Select a Godot version to download"
size_flags_horizontal = 3
size_flags_vertical = 3
Expand All @@ -73,11 +69,26 @@ script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
refresh_button_path = NodePath("../Refresh")
download_button_path = NodePath("../../Download")
alpha_button_path = NodePath("../../Alpha")
beta_button_path = NodePath("../../Beta")
rc_button_path = NodePath("../../RC")

[node name="Refresh" type="Button" parent="MarginContainer/HBox/MenuBar/Version&Refresh"]
margin_left = 196.0
margin_right = 250.0
margin_bottom = 87.0
hint_tooltip = "Refresh the database to show new available versions"
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.01
text = "Refresh"

[node name="Download" type="Button" parent="MarginContainer/HBox/MenuBar"]
margin_top = 156.0
margin_right = 201.0
margin_bottom = 224.0
margin_top = 97.0
margin_right = 250.0
margin_bottom = 185.0
hint_tooltip = "Download the selected version"
size_flags_horizontal = 3
size_flags_vertical = 3
Expand All @@ -87,9 +98,9 @@ __meta__ = {
}

[node name="Add" type="Button" parent="MarginContainer/HBox/MenuBar"]
margin_top = 234.0
margin_right = 201.0
margin_bottom = 302.0
margin_top = 195.0
margin_right = 250.0
margin_bottom = 283.0
hint_tooltip = "Add a custom version or another tool from an .exe"
size_flags_horizontal = 3
size_flags_vertical = 3
Expand All @@ -101,38 +112,38 @@ __meta__ = {
add_popup = NodePath("../../../../AddNew")

[node name="Include" type="Label" parent="MarginContainer/HBox/MenuBar"]
margin_top = 312.0
margin_right = 201.0
margin_bottom = 339.0
margin_top = 293.0
margin_right = 250.0
margin_bottom = 320.0
size_flags_horizontal = 3
size_flags_vertical = 1
text = "Include:"

[node name="Alpha" type="CheckBox" parent="MarginContainer/HBox/MenuBar"]
margin_top = 349.0
margin_right = 201.0
margin_bottom = 374.0
margin_top = 330.0
margin_right = 250.0
margin_bottom = 355.0
size_flags_horizontal = 3
text = "Alpha"

[node name="Beta" type="CheckBox" parent="MarginContainer/HBox/MenuBar"]
margin_top = 384.0
margin_right = 201.0
margin_bottom = 409.0
margin_top = 365.0
margin_right = 250.0
margin_bottom = 390.0
size_flags_horizontal = 3
text = "Beta"

[node name="RC" type="CheckBox" parent="MarginContainer/HBox/MenuBar"]
margin_top = 419.0
margin_right = 201.0
margin_bottom = 444.0
margin_top = 400.0
margin_right = 250.0
margin_bottom = 425.0
size_flags_horizontal = 3
text = "RC"

[node name="Donate" type="TextureButton" parent="MarginContainer/HBox/MenuBar"]
margin_top = 454.0
margin_right = 201.0
margin_bottom = 522.0
margin_top = 435.0
margin_right = 250.0
margin_bottom = 523.0
rect_min_size = Vector2( 0, 20 )
size_flags_horizontal = 3
size_flags_vertical = 3
Expand All @@ -146,31 +157,31 @@ __meta__ = {
}

[node name="Version" type="HBoxContainer" parent="MarginContainer/HBox/MenuBar"]
margin_top = 532.0
margin_right = 201.0
margin_bottom = 559.0
margin_top = 533.0
margin_right = 250.0
margin_bottom = 560.0
size_flags_horizontal = 3
script = ExtResource( 10 )

[node name="tag" type="Label" parent="MarginContainer/HBox/MenuBar/Version"]
margin_right = 148.0
margin_right = 197.0
margin_bottom = 27.0
size_flags_horizontal = 3
text = "Version Tag: vX.XX"

[node name="update" type="Button" parent="MarginContainer/HBox/MenuBar/Version"]
margin_left = 151.0
margin_right = 201.0
margin_left = 200.0
margin_right = 250.0
margin_bottom = 27.0
text = "Update"

[node name="req" type="HTTPRequest" parent="MarginContainer/HBox/MenuBar/Version"]

[node name="Installed" type="ItemList" parent="MarginContainer/HBox"]
margin_left = 211.0
margin_right = 613.0
margin_left = 260.0
margin_right = 638.0
margin_bottom = 560.0
rect_min_size = Vector2( 335, 0 )
rect_min_size = Vector2( 320, 0 )
size_flags_horizontal = 3
size_flags_vertical = 3
custom_colors/font_color_selected = Color( 0.27451, 0.54902, 0.74902, 1 )
Expand All @@ -197,7 +208,7 @@ __meta__ = {
}

[node name="Scroll" type="ScrollContainer" parent="MarginContainer/HBox"]
margin_left = 623.0
margin_left = 648.0
margin_right = 1026.0
margin_bottom = 560.0
size_flags_horizontal = 3
Expand All @@ -208,16 +219,17 @@ script = ExtResource( 9 )
[node name="Feed" type="VBoxContainer" parent="MarginContainer/HBox/Scroll"]
margin_left = 10.0
margin_top = 10.0
margin_right = 393.0
margin_right = 368.0
margin_bottom = 37.0
size_flags_horizontal = 3
custom_constants/separation = 20

[node name="Title" type="Label" parent="MarginContainer/HBox/Scroll/Feed"]
margin_right = 383.0
margin_right = 358.0
margin_bottom = 27.0
text = "NEWS"
text = "godotengine.org news feed"
align = 1
uppercase = true

[node name="Loading" type="RichTextLabel" parent="MarginContainer/HBox/Scroll/Feed"]
visible = false
Expand Down Expand Up @@ -373,15 +385,17 @@ window_title = "Open a File"
mode = 0
access = 2
filters = PoolStringArray( "*.exe ; Godot executable files" )
current_dir = "/Users/lisan/Documents/GitHub/godot-version-manager"
current_path = "/Users/lisan/Documents/GitHub/godot-version-manager/"

[connection signal="pressed" from="MarginContainer/HBox/MenuBar/Refresh" to="MarginContainer/HBox/MenuBar/VersionSelect" method="_on_Refresh_pressed"]
[connection signal="refresh_finished" from="MarginContainer/HBox/MenuBar/VersionSelect" to="MarginContainer/HBox/MenuBar/VersionSelect" method="_on_VersionSelect_refresh_finished"]
[connection signal="version_added" from="MarginContainer/HBox/MenuBar/VersionSelect" to="MarginContainer/HBox/Installed" method="_on_version_added"]
[connection signal="pressed" from="MarginContainer/HBox/MenuBar/Download" to="MarginContainer/HBox/MenuBar/VersionSelect" method="_on_Download_pressed"]
[connection signal="refresh_finished" from="MarginContainer/HBox/MenuBar/Version&Refresh/VersionSelect" to="MarginContainer/HBox/MenuBar/Version&Refresh/VersionSelect" method="_on_VersionSelect_refresh_finished"]
[connection signal="version_added" from="MarginContainer/HBox/MenuBar/Version&Refresh/VersionSelect" to="MarginContainer/HBox/Installed" method="_on_version_added"]
[connection signal="pressed" from="MarginContainer/HBox/MenuBar/Version&Refresh/Refresh" to="MarginContainer/HBox/MenuBar/Version&Refresh/VersionSelect" method="_on_Refresh_pressed"]
[connection signal="pressed" from="MarginContainer/HBox/MenuBar/Download" to="MarginContainer/HBox/MenuBar/Version&Refresh/VersionSelect" method="_on_Download_pressed"]
[connection signal="pressed" from="MarginContainer/HBox/MenuBar/Add" to="MarginContainer/HBox/MenuBar/Add" method="_on_Add_pressed"]
[connection signal="toggled" from="MarginContainer/HBox/MenuBar/Alpha" to="MarginContainer/HBox/MenuBar/VersionSelect" method="_on_Alpha_toggled"]
[connection signal="toggled" from="MarginContainer/HBox/MenuBar/Beta" to="MarginContainer/HBox/MenuBar/VersionSelect" method="_on_Beta_toggled"]
[connection signal="toggled" from="MarginContainer/HBox/MenuBar/RC" to="MarginContainer/HBox/MenuBar/VersionSelect" method="_on_RC_toggled"]
[connection signal="toggled" from="MarginContainer/HBox/MenuBar/Alpha" to="MarginContainer/HBox/MenuBar/Version&Refresh/VersionSelect" method="_on_Alpha_toggled"]
[connection signal="toggled" from="MarginContainer/HBox/MenuBar/Beta" to="MarginContainer/HBox/MenuBar/Version&Refresh/VersionSelect" method="_on_Beta_toggled"]
[connection signal="toggled" from="MarginContainer/HBox/MenuBar/RC" to="MarginContainer/HBox/MenuBar/Version&Refresh/VersionSelect" method="_on_RC_toggled"]
[connection signal="pressed" from="MarginContainer/HBox/MenuBar/Donate" to="MarginContainer/HBox/MenuBar/Donate" method="_on_Donate_pressed"]
[connection signal="pressed" from="MarginContainer/HBox/MenuBar/Version/update" to="MarginContainer/HBox/MenuBar/Version" method="_on_update_pressed"]
[connection signal="request_completed" from="MarginContainer/HBox/MenuBar/Version/req" to="MarginContainer/HBox/MenuBar/Version" method="_on_request_completed"]
Expand Down
16 changes: 9 additions & 7 deletions scenes/NewsItem.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]

[ext_resource path="res://scenes/NewsItem.gd" type="Script" id=1]
[ext_resource path="res://theme/installed.tres" type="DynamicFont" id=2]

[sub_resource type="StyleBoxFlat" id=1]
content_margin_left = 10.0
Expand Down Expand Up @@ -33,25 +34,26 @@ uppercase = true
[node name="author" type="Label" parent="."]
margin_top = 38.0
margin_right = 1066.0
margin_bottom = 52.0
margin_bottom = 59.0
custom_fonts/font = ExtResource( 2 )
text = "Author"
autowrap = true

[node name="body" type="HBoxContainer" parent="."]
margin_top = 56.0
margin_top = 63.0
margin_right = 1066.0
margin_bottom = 600.0
size_flags_vertical = 3

[node name="thumb_container" type="CenterContainer" parent="body"]
margin_right = 100.0
margin_bottom = 544.0
margin_bottom = 537.0
rect_min_size = Vector2( 100, 100 )

[node name="thumb" type="TextureRect" parent="body/thumb_container"]
margin_top = 222.0
margin_top = 218.0
margin_right = 100.0
margin_bottom = 322.0
margin_bottom = 318.0
grow_horizontal = 2
grow_vertical = 2
rect_min_size = Vector2( 100, 100 )
Expand All @@ -63,7 +65,7 @@ stretch_mode = 7
[node name="contents" type="Label" parent="body"]
margin_left = 104.0
margin_right = 1066.0
margin_bottom = 544.0
margin_bottom = 537.0
rect_min_size = Vector2( 300, 0 )
size_flags_horizontal = 3
size_flags_vertical = 7
Expand Down
25 changes: 20 additions & 5 deletions scenes/VersionSelect.gd
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,17 @@ var alpha_included = false
var beta_included = false
var rc_included = false

onready var refresh_button = $"../Refresh"
onready var download_button = $"../Download"
export var refresh_button_path : NodePath
export var download_button_path : NodePath
export var alpha_button_path : NodePath
export var beta_button_path : NodePath
export var rc_button_path : NodePath

onready var refresh_button = get_node(refresh_button_path)
onready var download_button = get_node(download_button_path)
onready var alpha_button = get_node(alpha_button_path)
onready var beta_button = get_node(beta_button_path)
onready var rc_button = get_node(rc_button_path)

# Emitted when the download_db has been updated
signal refresh_finished()
Expand All @@ -89,6 +98,12 @@ signal version_added()


func _ready():
# VALIDATE BUTTON PATHS ( Will use scene unique names when 3.5 reaches stable)
for button in [refresh_button, download_button, alpha_button, beta_button, rc_button]:
assert(button != null, "Make sure all button_paths are properly assigned in the inspector")



# DETECT PLATFORM
if OS.has_feature("Windows"):
current_platform = "Windows"
Expand All @@ -103,9 +118,9 @@ func _ready():
# RESTORE UI FLAGS
var config = Globals.read_config()
if "ui" in config:
$"../Alpha".pressed = config.ui.alpha
$"../Beta".pressed = config.ui.beta
$"../RC".pressed = config.ui.rc
alpha_button.pressed = config.ui.alpha
beta_button.pressed = config.ui.beta
rc_button.pressed = config.ui.rc


# Deserializes json version of download_db and
Expand Down
Binary file modified theme/main.theme
Binary file not shown.
Binary file modified theme/round_and_shaded.stylebox
Binary file not shown.

0 comments on commit 527f330

Please sign in to comment.