2016-04-18 11:31:31 -07:00
|
|
|
|
/*
|
2018-07-12 09:22:28 -07:00
|
|
|
|
Copyright (c) 2018, Kevin Pope, John Lewin
|
2014-03-17 14:41:26 -07:00
|
|
|
|
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-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-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
|
|
|
|
{
|
2018-07-12 09:22:28 -07:00
|
|
|
|
private ThemeConfig theme;
|
|
|
|
|
|
|
|
|
|
|
|
public WidescreenPanel(ThemeConfig theme)
|
2015-04-08 15:20:10 -07:00
|
|
|
|
{
|
2018-07-12 09:22:28 -07:00
|
|
|
|
this.theme = theme;
|
2015-04-08 15:20:10 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
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";
|
2018-10-13 17:58:54 -07:00
|
|
|
|
this.BackgroundColor = theme.ActiveTabColor;
|
2017-11-11 17:28:03 -08:00
|
|
|
|
|
2018-05-10 15:06:39 -07:00
|
|
|
|
// Push TouchScreenMode into GuiWidget
|
|
|
|
|
|
GuiWidget.TouchScreenMode = UserSettings.Instance.IsTouchScreen;
|
|
|
|
|
|
|
2018-06-24 08:54:44 -07:00
|
|
|
|
// put in the right column
|
2018-07-12 09:22:28 -07:00
|
|
|
|
var partPreviewContent = new PartPreviewContent(theme)
|
2017-09-29 21:30:51 -07:00
|
|
|
|
{
|
|
|
|
|
|
VAnchor = VAnchor.Bottom | VAnchor.Top,
|
|
|
|
|
|
HAnchor = HAnchor.Left | HAnchor.Right
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2018-10-07 11:36:52 -07:00
|
|
|
|
this.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;
|
2018-10-07 11:36:52 -07:00
|
|
|
|
this.HAnchor = HAnchor.Fit;
|
2017-11-11 17:28:03 -08:00
|
|
|
|
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,
|
2018-10-13 17:58:54 -07:00
|
|
|
|
MinimumSize = new Vector2(400, 0)
|
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
|
|
|
|
{
|
2018-10-07 11:36:52 -07:00
|
|
|
|
HAnchor = HAnchor.Fit,
|
2018-04-24 18:39:43 -07:00
|
|
|
|
VAnchor = VAnchor.Fit,
|
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,
|
2018-05-17 12:41:00 -07:00
|
|
|
|
Margin = theme.ButtonSpacing,
|
2017-11-11 17:28:03 -08:00
|
|
|
|
Selectable = false
|
2017-10-15 01:01:56 -07:00
|
|
|
|
});
|
|
|
|
|
|
|
2018-07-12 09:22:28 -07:00
|
|
|
|
row.AddChild(new TextWidget(ApplicationController.Instance.ShortProductName, textColor: theme.Colors.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
|
|
|
|
});
|
2018-10-07 11:36:52 -07:00
|
|
|
|
|
|
|
|
|
|
foreach (var child in this.Children)
|
|
|
|
|
|
{
|
|
|
|
|
|
child.Selectable = false;
|
|
|
|
|
|
}
|
2017-08-04 15:42:23 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-08-20 02:34:39 -07:00
|
|
|
|
}
|