Add reusable SearchButton helper
This commit is contained in:
parent
b5abcfdbd1
commit
1b5f1daed1
3 changed files with 12 additions and 6 deletions
|
|
@ -37,6 +37,7 @@ namespace MatterHackers.MatterControl
|
|||
using Agg.Image;
|
||||
using CustomWidgets;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.Localizations;
|
||||
using MatterHackers.MatterControl.PartPreviewWindow;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
|
|
@ -122,6 +123,14 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public int OverlayAlpha { get; set; } = 50;
|
||||
|
||||
public GuiWidget CreateSearchButton()
|
||||
{
|
||||
return new IconButton(AggContext.StaticData.LoadIcon("icon_search_24x24.png", 16, 16, IconColor.Theme), this)
|
||||
{
|
||||
ToolTipText = "Search".Localize(),
|
||||
};
|
||||
}
|
||||
|
||||
public Color InteractionLayerOverlayColor { get; private set; }
|
||||
|
||||
private EventHandler unregisterEvents;
|
||||
|
|
|
|||
|
|
@ -138,12 +138,8 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
|
||||
navBar.AddChild(searchPanel);
|
||||
|
||||
var searchButton = new IconButton(AggContext.StaticData.LoadIcon("icon_search_24x24.png", 16, 16, IconColor.Theme), theme)
|
||||
{
|
||||
ToolTipText = "Search".Localize(),
|
||||
Name = "Search Library Button",
|
||||
};
|
||||
searchButton.VisibleChanged += (s, e) => Console.WriteLine();
|
||||
var searchButton = ApplicationController.Instance.Theme.CreateSearchButton();
|
||||
searchButton.Name = "Search Library Button";
|
||||
searchButton.Click += (s, e) =>
|
||||
{
|
||||
if (searchPanel.Visible)
|
||||
|
|
|
|||
|
|
@ -335,6 +335,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
var editorWidget = editor.Create(scene.SelectedItem, view3DWidget, theme);
|
||||
editorWidget.HAnchor = HAnchor.Stretch;
|
||||
editorWidget.VAnchor = VAnchor.Fit;
|
||||
editorWidget.Padding = 0;
|
||||
|
||||
editorPanel.AddChild(editorWidget);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue