custom popup
This commit is contained in:
23
src/SharpIDE.Godot/Features/Run/RunMenuItem.cs
Normal file
23
src/SharpIDE.Godot/Features/Run/RunMenuItem.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
1
src/SharpIDE.Godot/Features/Run/RunMenuItem.cs.uid
Normal file
1
src/SharpIDE.Godot/Features/Run/RunMenuItem.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://btsnapfx0dlbb
|
||||
21
src/SharpIDE.Godot/Features/Run/RunMenuItem.tscn
Normal file
21
src/SharpIDE.Godot/Features/Run/RunMenuItem.tscn
Normal 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")
|
||||
Reference in New Issue
Block a user