2016-04-18 11:31:31 -07:00
|
|
|
|
/*
|
2014-03-17 14:41:26 -07:00
|
|
|
|
Copyright (c) 2014, Kevin Pope
|
|
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
2015-04-08 15:20:10 -07:00
|
|
|
|
modification, are permitted provided that the following conditions are met:
|
2014-03-17 14:41:26 -07:00
|
|
|
|
|
|
|
|
|
|
1. Redistributions of source code must retain the above copyright notice, this
|
2015-04-08 15:20:10 -07:00
|
|
|
|
list of conditions and the following disclaimer.
|
2014-03-17 14:41:26 -07:00
|
|
|
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
|
|
this list of conditions and the following disclaimer in the documentation
|
2015-04-08 15:20:10 -07:00
|
|
|
|
and/or other materials provided with the distribution.
|
2014-03-17 14:41:26 -07:00
|
|
|
|
|
|
|
|
|
|
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
|
2015-04-08 15:20:10 -07:00
|
|
|
|
of the authors and should not be interpreted as representing official policies,
|
2014-03-17 14:41:26 -07:00
|
|
|
|
either expressed or implied, of the FreeBSD Project.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2017-11-28 16:41:29 -08:00
|
|
|
|
using System;
|
2016-04-18 11:31:31 -07:00
|
|
|
|
using MatterHackers.Agg;
|
2017-08-20 02:34:39 -07:00
|
|
|
|
using MatterHackers.Agg.Platform;
|
2016-04-18 11:31:31 -07:00
|
|
|
|
using MatterHackers.Agg.UI;
|
2017-08-04 15:42:23 -07:00
|
|
|
|
using MatterHackers.MatterControl.ConfigurationPage;
|
2017-11-11 17:28:03 -08:00
|
|
|
|
using MatterHackers.MatterControl.CustomWidgets;
|
2016-04-18 11:31:31 -07:00
|
|
|
|
using MatterHackers.MatterControl.PartPreviewWindow;
|
2017-06-16 22:03:42 -07:00
|
|
|
|
using MatterHackers.MatterControl.PrintLibrary;
|
2017-11-11 17:28:03 -08:00
|
|
|
|
using MatterHackers.VectorMath;
|
2016-04-18 11:31:31 -07:00
|
|
|
|
|
2014-03-17 14:41:26 -07:00
|
|
|
|
namespace MatterHackers.MatterControl
|
2014-04-19 10:35:53 -07:00
|
|
|
|
{
|
2017-06-10 18:40:57 -07:00
|
|
|
|
public class WidescreenPanel : FlowLayoutWidget
|
2015-04-08 15:20:10 -07:00
|
|
|
|
{
|
|
|
|
|
|
public WidescreenPanel()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-06-10 18:40:57 -07:00
|
|
|
|
public override void Initialize()
|
2015-04-08 15:20:10 -07:00
|
|
|
|
{
|
2017-06-10 18:40:57 -07:00
|
|
|
|
base.Initialize();
|
2015-04-08 15:20:10 -07:00
|
|
|
|
|
2017-06-12 14:19:04 -07:00
|
|
|
|
this.AnchorAll();
|
|
|
|
|
|
this.Name = "WidescreenPanel";
|
2017-12-17 00:00:41 -08:00
|
|
|
|
this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
|
2015-04-08 15:20:10 -07:00
|
|
|
|
|
2017-11-11 17:28:03 -08:00
|
|
|
|
var theme = ApplicationController.Instance.Theme;
|
|
|
|
|
|
|
2017-06-12 14:19:04 -07:00
|
|
|
|
var library3DViewSplitter = new Splitter()
|
|
|
|
|
|
{
|
2017-11-10 16:31:47 -08:00
|
|
|
|
SplitterDistance = UserSettings.Instance.LibraryViewWidth,
|
2017-11-11 17:28:03 -08:00
|
|
|
|
SplitterWidth = theme.SplitterWidth,
|
|
|
|
|
|
SplitterBackground = theme.SplitterBackground
|
2017-06-12 14:19:04 -07:00
|
|
|
|
};
|
2017-06-10 18:40:57 -07:00
|
|
|
|
library3DViewSplitter.AnchorAll();
|
2017-06-13 13:43:51 -07:00
|
|
|
|
|
2017-11-10 16:31:47 -08:00
|
|
|
|
library3DViewSplitter.DistanceChanged += (s, e) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
UserSettings.Instance.LibraryViewWidth = library3DViewSplitter.SplitterDistance;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2017-06-13 13:43:51 -07:00
|
|
|
|
this.AddChild(library3DViewSplitter);
|
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
|
|
|
|
|
2017-08-04 15:42:23 -07:00
|
|
|
|
var leftNav = new FlowLayoutWidget(FlowDirection.TopToBottom);
|
|
|
|
|
|
leftNav.AnchorAll();
|
|
|
|
|
|
|
2018-01-08 14:28:52 -08:00
|
|
|
|
var toolbar = new Toolbar()
|
2017-11-11 17:28:03 -08:00
|
|
|
|
{
|
|
|
|
|
|
HAnchor = HAnchor.Stretch,
|
|
|
|
|
|
VAnchor = VAnchor.Fit,
|
2018-01-08 14:28:52 -08:00
|
|
|
|
MinimumSize = new Vector2(16, 16),
|
|
|
|
|
|
BackgroundColor = theme.ActiveTabBarBackground,
|
|
|
|
|
|
BorderColor = theme.ActiveTabColor,
|
|
|
|
|
|
Border = 0 //new BorderDouble(bottom: 2),
|
2017-11-11 17:28:03 -08:00
|
|
|
|
};
|
2017-12-26 08:15:28 -08:00
|
|
|
|
toolbar.ActionArea.AddChild(new BrandMenuButton(theme)
|
2017-08-04 15:42:23 -07:00
|
|
|
|
{
|
2018-01-08 14:28:52 -08:00
|
|
|
|
MinimumSize = new Vector2(0, 34),
|
2017-08-07 15:47:27 -07:00
|
|
|
|
HAnchor = HAnchor.Stretch,
|
2018-01-08 14:28:52 -08:00
|
|
|
|
VAnchor = VAnchor.Fit,
|
|
|
|
|
|
Border = new BorderDouble(right: 1),
|
|
|
|
|
|
BorderColor = theme.MinimalShade
|
2017-08-04 15:42:23 -07:00
|
|
|
|
});
|
2017-11-11 17:28:03 -08:00
|
|
|
|
leftNav.AddChild(toolbar);
|
2017-08-04 15:42:23 -07:00
|
|
|
|
|
2017-09-29 21:30:51 -07:00
|
|
|
|
var partPreviewContent = new PartPreviewContent()
|
|
|
|
|
|
{
|
|
|
|
|
|
VAnchor = VAnchor.Bottom | VAnchor.Top,
|
|
|
|
|
|
HAnchor = HAnchor.Left | HAnchor.Right
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2018-01-16 22:55:28 -08:00
|
|
|
|
leftNav.AddChild(new PrintLibraryWidget(partPreviewContent, theme)
|
|
|
|
|
|
{
|
|
|
|
|
|
BackgroundColor = theme.ActiveTabColor
|
|
|
|
|
|
});
|
2017-08-04 15:42:23 -07:00
|
|
|
|
|
2017-06-10 18:40:57 -07:00
|
|
|
|
// put in the left column
|
2017-08-04 15:42:23 -07:00
|
|
|
|
library3DViewSplitter.Panel1.AddChild(leftNav);
|
2017-06-09 14:42:16 -07:00
|
|
|
|
|
2017-06-10 18:40:57 -07:00
|
|
|
|
// put in the right column
|
2017-09-29 21:30:51 -07:00
|
|
|
|
library3DViewSplitter.Panel2.AddChild(partPreviewContent);
|
2015-04-08 15:20:10 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-11-11 17:28:03 -08:00
|
|
|
|
public class BrandMenuButton : PopupButton
|
2017-08-04 15:42:23 -07:00
|
|
|
|
{
|
2017-11-11 17:28:03 -08:00
|
|
|
|
public BrandMenuButton(ThemeConfig theme)
|
2017-08-04 15:42:23 -07:00
|
|
|
|
{
|
2017-11-11 17:28:03 -08:00
|
|
|
|
this.Name = "MatterControl BrandMenuButton";
|
2017-11-15 16:13:59 -08:00
|
|
|
|
this.VAnchor = VAnchor.Fit;
|
2017-11-11 17:28:03 -08:00
|
|
|
|
this.HAnchor = HAnchor.Stretch;
|
|
|
|
|
|
this.Margin = 0;
|
2018-04-12 08:42:10 -07:00
|
|
|
|
this.PopupContent = new ApplicationSettingsWidget(ApplicationController.Instance.MenuTheme)
|
2017-08-04 15:42:23 -07:00
|
|
|
|
{
|
2017-11-11 17:28:03 -08:00
|
|
|
|
HAnchor = HAnchor.Absolute,
|
2017-11-15 16:13:59 -08:00
|
|
|
|
VAnchor = VAnchor.Fit,
|
2017-11-11 17:28:03 -08:00
|
|
|
|
Width = 500,
|
2017-08-04 15:42:23 -07:00
|
|
|
|
};
|
2017-09-25 22:27:46 -07:00
|
|
|
|
|
2017-11-11 17:28:03 -08:00
|
|
|
|
var row = new FlowLayoutWidget()
|
2017-10-15 01:01:56 -07:00
|
|
|
|
{
|
2017-11-11 17:28:03 -08:00
|
|
|
|
HAnchor = HAnchor.Stretch,
|
|
|
|
|
|
VAnchor = VAnchor.Stretch,
|
2017-10-15 01:01:56 -07:00
|
|
|
|
};
|
2017-11-11 17:28:03 -08:00
|
|
|
|
this.AddChild(row);
|
|
|
|
|
|
|
2018-04-12 08:42:10 -07:00
|
|
|
|
row.AddChild(new IconButton(AggContext.StaticData.LoadIcon("mh-app-logo.png", theme.InvertIcons), theme)
|
2017-10-15 01:01:56 -07:00
|
|
|
|
{
|
|
|
|
|
|
VAnchor = VAnchor.Center,
|
2017-11-11 17:28:03 -08:00
|
|
|
|
Margin = new BorderDouble(right: 4),
|
|
|
|
|
|
Selectable = false
|
2017-10-15 01:01:56 -07:00
|
|
|
|
});
|
|
|
|
|
|
|
2017-11-11 17:28:03 -08:00
|
|
|
|
row.AddChild(new TextWidget(ApplicationController.Instance.ShortProductName, textColor: ActiveTheme.Instance.PrimaryTextColor)
|
2017-08-04 15:42:23 -07:00
|
|
|
|
{
|
2017-08-07 15:47:27 -07:00
|
|
|
|
VAnchor = VAnchor.Center
|
2017-08-04 15:42:23 -07:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-07-02 14:36:04 -07:00
|
|
|
|
public class UpdateNotificationMark : GuiWidget
|
2015-04-08 15:20:10 -07:00
|
|
|
|
{
|
2015-06-15 09:55:38 -07:00
|
|
|
|
public UpdateNotificationMark()
|
2015-04-08 15:20:10 -07:00
|
|
|
|
: base(12, 12)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnDraw(Graphics2D graphics2D)
|
|
|
|
|
|
{
|
2017-10-31 11:43:25 -07:00
|
|
|
|
graphics2D.Circle(Width / 2, Height / 2, Width / 2, Color.White);
|
|
|
|
|
|
graphics2D.Circle(Width / 2, Height / 2, Width / 2 - 1, Color.Red);
|
|
|
|
|
|
graphics2D.FillRectangle(Width / 2 - 1, Height / 2 - 3, Width / 2 + 1, Height / 2 + 3, Color.White);
|
2015-04-08 15:20:10 -07:00
|
|
|
|
base.OnDraw(graphics2D);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-08-20 02:34:39 -07:00
|
|
|
|
}
|