custom popup

This commit is contained in:
Matt Parker
2025-08-25 18:18:24 +10:00
parent 26ac3e5724
commit 47b8e3e0e3
7 changed files with 82 additions and 7 deletions

View File

@@ -0,0 +1,23 @@
using Godot;
using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
namespace SharpIDE.Godot.Features.Run;
public partial class RunMenuItem : HBoxContainer
{
public SharpIdeProjectModel Project { get; set; } = null!;
private Label _label = null!;
private Button _runButton = null!;
public override void _Ready()
{
_label = GetNode<Label>("Label");
_runButton = GetNode<Button>("RunButton");
_runButton.Pressed += OnRunButtonPressed;
_label.Text = Project.Name;
}
private async void OnRunButtonPressed()
{
await Singletons.RunService.RunProject(Project).ConfigureAwait(false);
}
}

View File

@@ -0,0 +1 @@
uid://btsnapfx0dlbb

View File

@@ -0,0 +1,21 @@
[gd_scene load_steps=3 format=3 uid="uid://d2ewm2lajutpv"]
[ext_resource type="Script" uid="uid://btsnapfx0dlbb" path="res://Features/Run/RunMenuItem.cs" id="1_syj0f"]
[ext_resource type="Texture2D" uid="uid://bnprs1lvjyaji" path="res://Features/Run/Play.png" id="1_xfxpu"]
[node name="RunMenuItem" type="HBoxContainer"]
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("1_syj0f")
[node name="Label" type="Label" parent="."]
layout_mode = 2
text = "Project Name"
[node name="Spacer" type="Control" parent="."]
layout_mode = 2
size_flags_horizontal = 3
[node name="RunButton" type="Button" parent="."]
layout_mode = 2
icon = ExtResource("1_xfxpu")