Putting the left and right controls into the same line

This commit is contained in:
Lars Brubaker 2021-03-09 17:15:15 -08:00
parent e527f58d18
commit f6204e0eec
2 changed files with 26 additions and 6 deletions

View file

@ -767,18 +767,38 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
};
}
var moveLeftMenuItem = popupMenu.CreateMenuItem("Move <<".Localize());
moveLeftMenuItem.Click += (s, e) =>
var moveButtons = new FlowLayoutWidget();
var textWidget = new TextWidget("Move Tab", pointSize: theme.DefaultFontSize, textColor: theme.TextColor)
{
Padding = PopupMenu.MenuPadding.Clone(right: 0),
VAnchor = VAnchor.Center,
};
moveButtons.AddChild(textWidget);
var moveLeftButton = new TextButton("<<".Localize(), theme)
{
VAnchor = VAnchor.Center,
};
moveLeftButton.Click += (s, e) =>
{
tabs.MoveTabLeft(printerTab);
popupMenu.Unfocus();
};
moveButtons.AddChild(moveLeftButton);
var moveRightButton = new TextButton(">>".Localize(), theme)
{
VAnchor = VAnchor.Center,
};
var moveRightMenuItem = popupMenu.CreateMenuItem("Move >>".Localize());
moveRightMenuItem.Click += (s, e) =>
moveRightButton.Click += (s, e) =>
{
// move it to the right
tabs.MoveTabRight(printerTab);
popupMenu.Unfocus();
};
moveButtons.AddChild(moveRightButton);
popupMenu.AddChild(moveButtons);
popupMenu.ShowMenu(printerTab, mouseEvent);
}

View file

@ -45,7 +45,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
private ThemeConfig theme;
public BorderDouble MenuPadding => new BorderDouble(40, 8, 20, 8);
public static BorderDouble MenuPadding => new BorderDouble(40, 8, 20, 8);
public static Color DisabledTextColor { get; set; } = Color.Gray;