1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-26 19:48:01 +02:00

Right-click menu for statusbar error icon

This commit is contained in:
Brian Fiete 2025-02-02 18:13:14 -08:00
parent dfdbe7440f
commit ff96101806

View file

@ -590,7 +590,35 @@ namespace IDE.ui
if (Rect(GS!(6), 0, GS!(20), mHeight).Contains(x, y)) if (Rect(GS!(6), 0, GS!(20), mHeight).Contains(x, y))
{ {
gApp.mErrorsPanel.ShowErrorNext(); bool hasError = (gApp.mErrorsPanel.mErrorCount > 0);
bool hasWarning = (gApp.mErrorsPanel.mWarningCount > 0);
if (btn == 0)
{
gApp.mErrorsPanel.ShowErrorNext();
}
else if ((btn == 1) && ((hasError || hasWarning)))
{
float useX = x;
float useY = y;
Menu menu = new Menu();
var menuItem = menu.AddItem("Goto Next Error");
menuItem.mOnMenuItemSelected.Add(new (evt) =>
{
gApp.mErrorsPanel.ShowErrorNext();
});
menuItem = menu.AddItem("Clean Beef");
menuItem.mOnMenuItemSelected.Add(new (evt) =>
{
gApp.Cmd_CleanBeef();
});
MenuWidget menuWidget = DarkTheme.sDarkTheme.CreateMenuWidget(menu);
menuWidget.Init(this, useX, useY);
}
return; return;
} }
} }