Merge pull request #2338 from jlewin/design_tools
Fix ViewControls border, spacing and color
This commit is contained in:
commit
91cbc1ba60
2 changed files with 17 additions and 4 deletions
|
|
@ -68,6 +68,8 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public TextImageButtonFactory ButtonFactory { get; private set; }
|
||||
public TextImageButtonFactory SmallMarginButtonFactory { get; private set; }
|
||||
public TextImageButtonFactory RadioButtons { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Used to make buttons in menu rows where the background color is consistently white
|
||||
|
|
@ -96,7 +98,7 @@ namespace MatterHackers.MatterControl
|
|||
public TextImageButtonFactory MicroButtonMenu { get; private set; }
|
||||
|
||||
public BorderDouble ButtonSpacing { get; set; } = new BorderDouble(3, 0, 0, 0);
|
||||
public TextImageButtonFactory NoMargin { get; private set; }
|
||||
public TextImageButtonFactory NoMarginWhite { get; private set; }
|
||||
|
||||
private EventHandler unregisterEvents;
|
||||
|
||||
|
|
@ -141,13 +143,24 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
this.ButtonFactory = new TextImageButtonFactory(commonOptions);
|
||||
|
||||
this.NoMargin = new TextImageButtonFactory(commonOptions.Clone(options => options.Margin = 0));
|
||||
this.NoMarginWhite = new TextImageButtonFactory(commonOptions.Clone(options =>
|
||||
{
|
||||
options.Margin = 0;
|
||||
options.AllowThemeToAdjustImage = false;
|
||||
}));
|
||||
|
||||
this.SmallMarginButtonFactory = new TextImageButtonFactory(commonOptions.Clone(options =>
|
||||
{
|
||||
options.Margin = new BorderDouble(8, 0);
|
||||
}));
|
||||
|
||||
this.RadioButtons = new TextImageButtonFactory(commonOptions.Clone(options =>
|
||||
{
|
||||
options.BorderWidth = 1;
|
||||
options.CheckedBorderColor = RGBA_Bytes.White;
|
||||
options.AllowThemeToAdjustImage = false;
|
||||
}));
|
||||
|
||||
var commonGray = commonOptions.Clone(options =>
|
||||
{
|
||||
options.Normal.TextColor = RGBA_Bytes.Black;
|
||||
|
|
|
|||
|
|
@ -142,10 +142,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
var commonMargin = ApplicationController.Instance.Theme.ButtonSpacing;
|
||||
|
||||
var buttonFactory = theme.ButtonFactory;
|
||||
var buttonFactory = theme.RadioButtons;
|
||||
|
||||
iconPath = Path.Combine("ViewTransformControls", "reset.png");
|
||||
resetViewButton = theme.NoMargin.Generate("", StaticData.Instance.LoadIcon(iconPath,32,32).InvertLightness());
|
||||
resetViewButton = theme.NoMarginWhite.Generate("", StaticData.Instance.LoadIcon(iconPath,32,32).InvertLightness());
|
||||
resetViewButton.ToolTipText = "Reset View".Localize();
|
||||
resetViewButton.Margin = commonMargin;
|
||||
resetViewButton.Click += (s, e) => ResetView?.Invoke(this, null);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue