1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-28 12:35:59 +02:00

Added safe mode

This commit is contained in:
Brian Fiete 2020-10-15 10:44:29 -07:00
parent 72242aa31c
commit 72411118c2
4 changed files with 80 additions and 6 deletions

View file

@ -19,6 +19,7 @@ namespace IDE.ui
public int32 mClangCommandQueueSize;
public DarkComboBox mConfigComboBox;
public DarkComboBox mPlatformComboBox;
public DarkButton mSafeModeButton;
public bool mWasCompiling;
public int mEvalCount;
public ImageWidget mCancelSymSrvButton;
@ -36,6 +37,20 @@ namespace IDE.ui
mPlatformComboBox.mFrameKind = .Frameless;
mPlatformComboBox.mPopulateMenuAction.Add(new => PopulatePlatformMenu);
AddWidget(mPlatformComboBox);
if (gApp.mSafeMode)
{
mSafeModeButton = new DarkButton();
mSafeModeButton.Label = "Disable Safe Mode";
mSafeModeButton.mOnMouseClick.Add(new (mouseArgs) =>
{
delete gApp.mDeferredRelaunchCmd;
gApp.mDeferredRelaunchCmd = new String();
gApp.GetRelaunchCmd(false, gApp.mDeferredRelaunchCmd);
gApp.Stop();
});
AddWidget(mSafeModeButton);
}
}
void PopulateConfigMenu(Menu menu)
@ -101,6 +116,11 @@ namespace IDE.ui
if (mCancelSymSrvButton != null)
mCancelSymSrvButton.Resize(GS!(546), 0, GS!(20), GS!(20));
if (mSafeModeButton != null)
{
mSafeModeButton.Resize(mPlatformComboBox.mX - GS!(200), GS!(-2), GS!(180), GS!(24));
}
}
public override void Resize(float x, float y, float width, float height)