Show active stage in left nav bar

This commit is contained in:
jlewin 2019-03-20 14:12:33 -07:00
parent 9a898459e4
commit 8f6ffb0ec4
2 changed files with 34 additions and 5 deletions

View file

@ -42,6 +42,7 @@ namespace MatterHackers.MatterControl
private DialogPage activePage;
private GuiWidget rightPanel;
private bool footerHeightAcquired = false;
private WizardStageRow activeStageButton;
public StagedSetupWizard(IEnumerable<ISetupWizard> stages)
{
@ -76,10 +77,19 @@ namespace MatterHackers.MatterControl
stageWidget.Click += (s, e) =>
{
if (activeStageButton != null)
{
activeStageButton.Active = false;
}
stage.Reset();
stage.MoveNext();
activeStage = stage;
activeStageButton = stageWidget;
activeStageButton.Active = true;
this.ChangeToPage(stage.Current);
};

View file

@ -43,9 +43,10 @@ namespace MatterHackers.MatterControl
private ImageBuffer hoverIcon;
private double iconXOffset;
private double iconYOffset;
private bool _active;
public WizardStageRow(string text, string helpText, ISetupWizard stage, ThemeConfig theme)
: base (text, helpText, theme)
: base(text, helpText, theme)
{
this.stage = stage;
this.Cursor = Cursors.Hand;
@ -54,6 +55,21 @@ namespace MatterHackers.MatterControl
hoverIcon = AggContext.StaticData.LoadIcon("expand.png", 16, 16, theme.InvertIcons);
}
public bool Active
{
get => _active;
set
{
_active = value;
}
}
public override Color BackgroundColor
{
get => (_active) ? theme.AccentMimimalOverlay : base.BackgroundColor;
set => base.BackgroundColor = value;
}
public override void OnBoundsChanged(EventArgs e)
{
if (detailIcon != null)
@ -70,10 +86,13 @@ namespace MatterHackers.MatterControl
{
base.OnDraw(graphics2D);
graphics2D.Render(
mouseInBounds ? hoverIcon : detailIcon,
iconXOffset,
iconYOffset);
if (!this.Active)
{
graphics2D.Render(
mouseInBounds ? hoverIcon : detailIcon,
iconXOffset,
iconYOffset);
}
}
}
}