Merge pull request #2574 from jlewin/design_tools
Improve SelectedObjectPanel visibility/positioning, try toolbar buttons
This commit is contained in:
commit
b720375655
6 changed files with 65 additions and 38 deletions
|
|
@ -28,13 +28,10 @@ either expressed or implied, of the FreeBSD Project.
|
|||
*/
|
||||
|
||||
using System;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.Localizations;
|
||||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.SerialPortCommunication.FrostedSerial;
|
||||
|
||||
namespace MatterHackers.MatterControl.ActionBar
|
||||
{
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
selectLayerSlider.Visible = slidersVisible;
|
||||
layerRenderRatioSlider.Visible = slidersVisible;
|
||||
|
||||
view3DWidget.selectedObjectPanel.Visible = !showSliceLayers;
|
||||
view3DWidget.selectedObjectContainer.Visible = !showSliceLayers && sceneContext.Scene.HasSelection;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,22 +95,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
behavior3DTypeButtons.AddChild(solidBehaviorButton);
|
||||
|
||||
var objectActionList = new DropDownList("Actions", maxHeight: 200)
|
||||
{
|
||||
HAnchor = HAnchor.Stretch
|
||||
};
|
||||
|
||||
foreach (var namedAction in ApplicationController.Instance.RegisteredSceneOperations())
|
||||
{
|
||||
var menuItem = objectActionList.AddItem(namedAction.Title.Localize());
|
||||
menuItem.Click += (s, e) =>
|
||||
{
|
||||
namedAction.Action.Invoke(ApplicationController.Instance.ActivePrinter.Bed.Scene);
|
||||
};
|
||||
}
|
||||
|
||||
this.AddChild(objectActionList);
|
||||
|
||||
this.AddChild(editorPanel = new FlowLayoutWidget(FlowDirection.TopToBottom)
|
||||
{
|
||||
Name = "editorPanel",
|
||||
|
|
@ -143,7 +127,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
if (!scene.HasSelection)
|
||||
{
|
||||
this.Visible = false;
|
||||
this.Parent.Visible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -153,7 +137,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
|
||||
this.editorPanel.RemoveAllChildren();
|
||||
|
||||
this.Visible = true;
|
||||
this.Parent.Visible = true;
|
||||
|
||||
HashSet<IObject3DEditor> mappedEditors;
|
||||
objectEditorsByType.TryGetValue(selectedItem.GetType(), out mappedEditors);
|
||||
|
|
|
|||
|
|
@ -431,22 +431,22 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
selectedObjectPanel = new SelectedObjectPanel(this, this.Scene, theme)
|
||||
{
|
||||
BackgroundColor = new RGBA_Bytes(0, 0, 0, theme.OverlayAlpha),
|
||||
Visible = false,
|
||||
VAnchor = VAnchor.Top | VAnchor.Fit,
|
||||
HAnchor = HAnchor.Left | HAnchor.Fit,
|
||||
Margin = new BorderDouble(0, 5, 5, viewControls3D.LocalBounds.Height)
|
||||
};
|
||||
|
||||
var resizeContainer = new ResizeContainer(selectedObjectPanel)
|
||||
selectedObjectContainer = new ResizeContainer(selectedObjectPanel)
|
||||
{
|
||||
Width = 200,
|
||||
VAnchor = VAnchor.Fit | VAnchor.Top,
|
||||
HAnchor = HAnchor.Right,
|
||||
Margin = new BorderDouble(0, 0, 0, viewControls3D.LocalBounds.Height),
|
||||
SpliterBarColor = new RGBA_Bytes(RGBA_Bytes.Red, 30),
|
||||
SplitterWidth = ApplicationController.Instance.Theme.SplitterWidth,
|
||||
Visible = false,
|
||||
};
|
||||
AddChild(resizeContainer);
|
||||
resizeContainer.AddChild(selectedObjectPanel);
|
||||
this.AddChild(selectedObjectContainer);
|
||||
selectedObjectContainer.AddChild(selectedObjectPanel);
|
||||
|
||||
UiThread.RunOnIdle(AutoSpin);
|
||||
|
||||
|
|
@ -1752,7 +1752,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
if (!Scene.HasSelection)
|
||||
{
|
||||
selectedObjectPanel.Visible = false;
|
||||
selectedObjectContainer.Visible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2025,7 +2025,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
public static Regex fileNameNumberMatch = new Regex("\\(\\d+\\)", RegexOptions.Compiled);
|
||||
|
||||
private FlowLayoutWidget editorPanel;
|
||||
internal SelectedObjectPanel selectedObjectPanel;
|
||||
|
||||
private SelectedObjectPanel selectedObjectPanel;
|
||||
|
||||
internal GuiWidget selectedObjectContainer;
|
||||
|
||||
private async Task SaveChanges()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -235,10 +235,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
rotateButton.Checked = true;
|
||||
}
|
||||
|
||||
partSelectSeparator = new GuiWidget(2, 32);
|
||||
partSelectSeparator.BackgroundColor = RGBA_Bytes.White;
|
||||
partSelectSeparator.Margin = 3;
|
||||
AddChild(partSelectSeparator);
|
||||
partSelectSeparator = new VerticalLine(50)
|
||||
{
|
||||
Margin = 3
|
||||
};
|
||||
|
||||
this.AddChild(partSelectSeparator);
|
||||
|
||||
iconPath = Path.Combine("ViewTransformControls", "partSelect.png");
|
||||
partSelectButton = buttonFactory.GenerateRadioButton("", AggContext.StaticData.LoadIcon(iconPath, 32, 32, IconColor.White));
|
||||
|
|
@ -288,6 +290,22 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
buttonGroupB.Add(Layers2DButton);
|
||||
this.AddChild(Layers2DButton);
|
||||
|
||||
this.AddChild(new VerticalLine(50)
|
||||
{
|
||||
Margin = 3
|
||||
});
|
||||
|
||||
foreach (var namedAction in ApplicationController.Instance.RegisteredSceneOperations())
|
||||
{
|
||||
var button = buttonFactory.Generate(namedAction.Title.Localize());
|
||||
button.Margin = theme.ButtonSpacing;
|
||||
button.Click += (s, e) =>
|
||||
{
|
||||
namedAction.Action.Invoke(ApplicationController.Instance.ActivePrinter.Bed.Scene);
|
||||
};
|
||||
this.AddChild(button);
|
||||
}
|
||||
|
||||
this.AddChild(new HorizontalSpacer());
|
||||
|
||||
this.AddChild(this.OverflowMenu = new OverflowMenu(IconColor.White)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
/*
|
||||
Copyright (c) 2017, John Lewin
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue