C#: Hide Build button if there's no solution to build
Same as we do with the bottom panel. Mainly to avoid bothering if the project is not using C#.
This commit is contained in:
parent
fd51d022c1
commit
173f7d800b
@ -31,6 +31,7 @@ namespace GodotTools
|
|||||||
private CheckBox aboutDialogCheckBox;
|
private CheckBox aboutDialogCheckBox;
|
||||||
|
|
||||||
private Button bottomPanelBtn;
|
private Button bottomPanelBtn;
|
||||||
|
private Button toolBarBuildButton;
|
||||||
|
|
||||||
public GodotIdeManager GodotIdeManager { get; private set; }
|
public GodotIdeManager GodotIdeManager { get; private set; }
|
||||||
|
|
||||||
@ -127,6 +128,7 @@ namespace GodotTools
|
|||||||
{
|
{
|
||||||
menuPopup.RemoveItem(menuPopup.GetItemIndex((int)MenuOptions.CreateSln));
|
menuPopup.RemoveItem(menuPopup.GetItemIndex((int)MenuOptions.CreateSln));
|
||||||
bottomPanelBtn.Show();
|
bottomPanelBtn.Show();
|
||||||
|
toolBarBuildButton.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _ShowAboutDialog()
|
private void _ShowAboutDialog()
|
||||||
@ -468,6 +470,15 @@ namespace GodotTools
|
|||||||
aboutVBox.AddChild(aboutDialogCheckBox);
|
aboutVBox.AddChild(aboutDialogCheckBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toolBarBuildButton = new Button
|
||||||
|
{
|
||||||
|
Text = "Build",
|
||||||
|
HintTooltip = "Build solution",
|
||||||
|
FocusMode = Control.FocusModeEnum.None
|
||||||
|
};
|
||||||
|
toolBarBuildButton.PressedSignal += _BuildSolutionPressed;
|
||||||
|
AddControlToContainer(CustomControlContainer.Toolbar, toolBarBuildButton);
|
||||||
|
|
||||||
if (File.Exists(GodotSharpDirs.ProjectSlnPath) && File.Exists(GodotSharpDirs.ProjectCsProjPath))
|
if (File.Exists(GodotSharpDirs.ProjectSlnPath) && File.Exists(GodotSharpDirs.ProjectCsProjPath))
|
||||||
{
|
{
|
||||||
ApplyNecessaryChangesToSolution();
|
ApplyNecessaryChangesToSolution();
|
||||||
@ -475,20 +486,12 @@ namespace GodotTools
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
bottomPanelBtn.Hide();
|
bottomPanelBtn.Hide();
|
||||||
|
toolBarBuildButton.Hide();
|
||||||
menuPopup.AddItem("Create C# solution".TTR(), (int)MenuOptions.CreateSln);
|
menuPopup.AddItem("Create C# solution".TTR(), (int)MenuOptions.CreateSln);
|
||||||
}
|
}
|
||||||
|
|
||||||
menuPopup.IdPressed += _MenuOptionPressed;
|
menuPopup.IdPressed += _MenuOptionPressed;
|
||||||
|
|
||||||
var buildButton = new Button
|
|
||||||
{
|
|
||||||
Text = "Build",
|
|
||||||
HintTooltip = "Build solution",
|
|
||||||
FocusMode = Control.FocusModeEnum.None
|
|
||||||
};
|
|
||||||
buildButton.PressedSignal += _BuildSolutionPressed;
|
|
||||||
AddControlToContainer(CustomControlContainer.Toolbar, buildButton);
|
|
||||||
|
|
||||||
// External editor settings
|
// External editor settings
|
||||||
EditorDef("mono/editor/external_editor", ExternalEditorId.None);
|
EditorDef("mono/editor/external_editor", ExternalEditorId.None);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user