Move disabled widget logic to new type
This commit is contained in:
parent
9aa6950b0c
commit
efc05d544e
1 changed files with 18 additions and 10 deletions
|
|
@ -725,23 +725,31 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
}
|
||||
else
|
||||
{
|
||||
var holder = new GuiWidget()
|
||||
{
|
||||
VAnchor = VAnchor.Fit,
|
||||
HAnchor = HAnchor.Stretch
|
||||
};
|
||||
holder.AddChild(settingsRow);
|
||||
return new DisabledOverlay(settingsRow);
|
||||
}
|
||||
}
|
||||
|
||||
var disable = new GuiWidget()
|
||||
private class DisabledOverlay : GuiWidget
|
||||
{
|
||||
private GuiWidget disableOverlay;
|
||||
|
||||
public DisabledOverlay(GuiWidget widgetToWrap)
|
||||
{
|
||||
this.VAnchor = VAnchor.Fit;
|
||||
this.HAnchor = HAnchor.Stretch;
|
||||
|
||||
this.AddChild(widgetToWrap);
|
||||
|
||||
disableOverlay = new GuiWidget()
|
||||
{
|
||||
VAnchor = VAnchor.Stretch,
|
||||
HAnchor = HAnchor.Stretch,
|
||||
BackgroundColor = new RGBA_Bytes(ActiveTheme.Instance.TertiaryBackgroundColor, 200)
|
||||
};
|
||||
holder.AddChild(disable);
|
||||
|
||||
return holder;
|
||||
this.AddChild(disableOverlay);
|
||||
}
|
||||
|
||||
public override bool Enabled { get => !disableOverlay.Visible; set => disableOverlay.Visible = value; }
|
||||
}
|
||||
|
||||
public static GuiWidget CreateQuickMenu(SliceSettingData settingData, SettingsContext settingsContext, GuiWidget content, InternalTextEditWidget internalTextWidget)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue