sln picker styling
This commit is contained in:
@@ -5,22 +5,20 @@ namespace SharpIDE.Godot.Features.SlnPicker;
|
|||||||
public partial class SlnPicker : Control
|
public partial class SlnPicker : Control
|
||||||
{
|
{
|
||||||
private FileDialog _fileDialog = null!;
|
private FileDialog _fileDialog = null!;
|
||||||
|
private Button _openSlnButton = null!;
|
||||||
|
|
||||||
|
private readonly TaskCompletionSource<string?> _tcs = new TaskCompletionSource<string?>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
_fileDialog = GetNode<FileDialog>("%FileDialog");
|
_fileDialog = GetNode<FileDialog>("%FileDialog");
|
||||||
|
_openSlnButton = GetNode<Button>("%OpenSlnButton");
|
||||||
|
_openSlnButton.Pressed += () => _fileDialog.PopupCentered();
|
||||||
|
_fileDialog.FileSelected += path => _tcs.SetResult(path);
|
||||||
|
_fileDialog.Canceled += () => _tcs.SetResult(null);
|
||||||
}
|
}
|
||||||
public async Task<string?> GetSelectedSolutionPath()
|
public async Task<string?> GetSelectedSolutionPath()
|
||||||
{
|
{
|
||||||
var tcs = new TaskCompletionSource<string?>(TaskCreationOptions.RunContinuationsAsynchronously);
|
return await _tcs.Task;
|
||||||
await this.InvokeAsync(() =>
|
|
||||||
{
|
|
||||||
_fileDialog.FileSelected += path => tcs.SetResult(path);
|
|
||||||
_fileDialog.Canceled += () => tcs.SetResult(null);
|
|
||||||
_fileDialog.PopupCentered();
|
|
||||||
});
|
|
||||||
|
|
||||||
var selectedPath = await tcs.Task;
|
|
||||||
return selectedPath;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,65 @@ grow_horizontal = 2
|
|||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
script = ExtResource("1_ciq0g")
|
script = ExtResource("1_ciq0g")
|
||||||
|
|
||||||
|
[node name="VSplitContainer" type="HSplitContainer" parent="."]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
split_offset = 245
|
||||||
|
dragging_enabled = false
|
||||||
|
dragger_visibility = 2
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="VSplitContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_constants/margin_left = 10
|
||||||
|
theme_override_constants/margin_top = 10
|
||||||
|
theme_override_constants/margin_right = 10
|
||||||
|
theme_override_constants/margin_bottom = 10
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="VSplitContainer/MarginContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="VSplitContainer/MarginContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "SharpIDE"
|
||||||
|
|
||||||
|
[node name="Panel" type="Panel" parent="VSplitContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="MarginContainer2" type="MarginContainer" parent="VSplitContainer/Panel"]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
theme_override_constants/margin_left = 10
|
||||||
|
theme_override_constants/margin_top = 10
|
||||||
|
theme_override_constants/margin_right = 10
|
||||||
|
theme_override_constants/margin_bottom = 10
|
||||||
|
|
||||||
|
[node name="VBoxContainer2" type="VBoxContainer" parent="VSplitContainer/Panel/MarginContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="VSplitContainer/Panel/MarginContainer2/VBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="LineEdit" type="LineEdit" parent="VSplitContainer/Panel/MarginContainer2/VBoxContainer2/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
placeholder_text = "Search Projects"
|
||||||
|
|
||||||
|
[node name="OpenSlnButton" type="Button" parent="VSplitContainer/Panel/MarginContainer2/VBoxContainer2/HBoxContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Open Sln File"
|
||||||
|
|
||||||
|
[node name="HSeparator" type="HSeparator" parent="VSplitContainer/Panel/MarginContainer2/VBoxContainer2"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="FileDialog" type="FileDialog" parent="."]
|
[node name="FileDialog" type="FileDialog" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
oversampling_override = 1.0
|
oversampling_override = 1.0
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public partial class IdeWindow : Control
|
|||||||
{
|
{
|
||||||
MSBuildLocator.RegisterDefaults();
|
MSBuildLocator.RegisterDefaults();
|
||||||
GodotServiceDefaults.AddServiceDefaults();
|
GodotServiceDefaults.AddServiceDefaults();
|
||||||
|
//GetWindow().SetMinSize(new Vector2I(1152, 648));
|
||||||
|
|
||||||
PickSolution();
|
PickSolution();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user