From 71af2e5d827c78df85537ea8d9e1c8198c583db2 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 16 Apr 2018 13:38:07 -0700 Subject: [PATCH 1/3] Revise conditional compilation block --- SetupWizard/DialogPage.cs | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/SetupWizard/DialogPage.cs b/SetupWizard/DialogPage.cs index f3cba11fd..a0068a571 100644 --- a/SetupWizard/DialogPage.cs +++ b/SetupWizard/DialogPage.cs @@ -122,21 +122,18 @@ namespace MatterHackers.MatterControl mainContainer.AddChild(contentRow); mainContainer.AddChild(footerRow); -#if __ANDROID__ - if (false) +#if !__ANDROID__ + mainContainer.Padding = new BorderDouble(3, 5, 3, 0); + headerRow.Padding = new BorderDouble(0, 3, 0, 3); + + headerLabel.TextWidget.PointSize = 14; + headerLabel.TextColor = theme.Colors.PrimaryTextColor; + contentRow.Padding = new BorderDouble(5); + + // TODO: current layout bugs prevent bottom margin from having an effect and bounds are simply clipped + footerRow.Margin = new BorderDouble(top: theme.DefaultContainerPadding, bottom: 4); + footerRow.Padding = 0; #endif - { - mainContainer.Padding = new BorderDouble(3, 5, 3, 0); - headerRow.Padding = new BorderDouble(0, 3, 0, 3); - - headerLabel.TextWidget.PointSize = 14; - headerLabel.TextColor = theme.Colors.PrimaryTextColor; - contentRow.Padding = new BorderDouble(5); - - // TODO: current layout bugs prevent bottom margin from having an effect and bounds are simply clipped - footerRow.Margin = new BorderDouble(top: theme.DefaultContainerPadding, bottom: 4); - footerRow.Padding = 0; - } this.AddChild(mainContainer); } From c91acb93185dcf139c62857035871dbcd07e6fb8 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 16 Apr 2018 18:55:01 -0700 Subject: [PATCH 2/3] DialogPage should be rather than have FlowLayoutWidget --- SetupWizard/DialogPage.cs | 40 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/SetupWizard/DialogPage.cs b/SetupWizard/DialogPage.cs index a0068a571..deb16c7b4 100644 --- a/SetupWizard/DialogPage.cs +++ b/SetupWizard/DialogPage.cs @@ -36,7 +36,7 @@ using MatterHackers.VectorMath; namespace MatterHackers.MatterControl { - public class DialogPage : GuiWidget + public class DialogPage : FlowLayoutWidget { protected FlowLayoutWidget headerRow; protected FlowLayoutWidget contentRow; @@ -52,14 +52,16 @@ namespace MatterHackers.MatterControl protected double labelFontSize = 12 * GuiWidget.DeviceScale; protected double errorFontSize = 10 * GuiWidget.DeviceScale; - private GuiWidget mainContainer; - protected ThemeConfig theme; public DialogPage(string cancelButtonText = null) + : base (FlowDirection.TopToBottom) { theme = ApplicationController.Instance.Theme; + this.HAnchor = HAnchor.Stretch; + this.VAnchor = VAnchor.Stretch; + this.BackgroundColor = theme.Colors.PrimaryBackgroundColor; linkButtonFactory = theme.LinkButtonFactory; if (cancelButtonText == null) @@ -67,33 +69,20 @@ namespace MatterHackers.MatterControl cancelButtonText = "Cancel".Localize(); } - if (!UserSettings.Instance.IsTouchScreen) - { - this.Padding = new BorderDouble(0); //To be re-enabled once native borders are turned off - } - - this.AnchorAll(); - cancelButton = theme.CreateDialogButton(cancelButtonText); cancelButton.Margin = 0; cancelButton.Name = "Cancel Wizard Button"; - // Create the main container - mainContainer = new FlowLayoutWidget(FlowDirection.TopToBottom) - { - Padding = new BorderDouble(12, 12, 12, 0), - BackgroundColor = theme.Colors.PrimaryBackgroundColor - }; - mainContainer.AnchorAll(); - // Create the header row for the widget headerRow = new FlowLayoutWidget(FlowDirection.LeftToRight) { Name = "HeaderRow", Margin = new BorderDouble(0, 3, 0, 0), Padding = new BorderDouble(0, 12), - HAnchor = HAnchor.Stretch + HAnchor = HAnchor.Stretch, + VAnchor = VAnchor.Fit }; + this.AddChild(headerRow); headerLabel = new WrappedTextWidget("Setup Wizard".Localize(), pointSize: 24, textColor: theme.Colors.PrimaryAccentColor) { @@ -109,33 +98,28 @@ namespace MatterHackers.MatterControl HAnchor = HAnchor.Stretch, VAnchor = VAnchor.Stretch }; + this.AddChild(contentRow); // Create the footer (button) container footerRow = new FlowLayoutWidget(FlowDirection.LeftToRight) { HAnchor = HAnchor.Stretch, + VAnchor = VAnchor.Fit, Margin = new BorderDouble(0, 6), Padding = new BorderDouble(top: 4, bottom: 2) }; - - mainContainer.AddChild(headerRow); - mainContainer.AddChild(contentRow); - mainContainer.AddChild(footerRow); + this.AddChild(footerRow); #if !__ANDROID__ - mainContainer.Padding = new BorderDouble(3, 5, 3, 0); headerRow.Padding = new BorderDouble(0, 3, 0, 3); headerLabel.TextWidget.PointSize = 14; headerLabel.TextColor = theme.Colors.PrimaryTextColor; contentRow.Padding = new BorderDouble(5); - // TODO: current layout bugs prevent bottom margin from having an effect and bounds are simply clipped - footerRow.Margin = new BorderDouble(top: theme.DefaultContainerPadding, bottom: 4); footerRow.Padding = 0; + footerRow.Margin = new BorderDouble(top: theme.DefaultContainerPadding); #endif - - this.AddChild(mainContainer); } public DialogWindow WizardWindow { get; set; } From 63d1595689bf95af014ddbb940e72e4a09665fc4 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 16 Apr 2018 18:55:55 -0700 Subject: [PATCH 3/3] Add folder icon - Issue MatterHackers/MCCentral#3131 Create consistent folder icon --- Library/Export/FolderExport.cs | 2 +- StaticData/Icons/filetypes/folder.png | Bin 0 -> 677 bytes Submodules/agg-sharp | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 StaticData/Icons/filetypes/folder.png diff --git a/Library/Export/FolderExport.cs b/Library/Export/FolderExport.cs index 4a7ae5faf..8cb4a0a5e 100644 --- a/Library/Export/FolderExport.cs +++ b/Library/Export/FolderExport.cs @@ -47,7 +47,7 @@ namespace MatterHackers.MatterControl.Library.Export public string ExtensionFilter => ""; - public ImageBuffer Icon { get; } = AggContext.StaticData.LoadIcon(Path.Combine("FileDialog", "folder.png"), 25, 25); + public ImageBuffer Icon { get; } = AggContext.StaticData.LoadIcon(Path.Combine("filetypes", "folder.png")); public void Initialize(PrinterConfig printer) { diff --git a/StaticData/Icons/filetypes/folder.png b/StaticData/Icons/filetypes/folder.png new file mode 100644 index 0000000000000000000000000000000000000000..b947813d0ecd8df5cccf8935dcfa9fa81e6aa051 GIT binary patch literal 677 zcmeAS@N?(olHy`uVBq!ia0y~yV31^BU{K^>V_;y=Il!=(fq{XsILO_JVcj{ImkbOH zEa{HEjtmSN`?>!lvNA9*a29w(7Bet#OaWm=7iS>@kP#)W5hcO-X(i=}MX3x0iJ5sN zdU>fO3MP66dPasH6*8wXFffUFx;Tb-c)y+Kn=ce7()N?{SntBFiCW5rxk?Eu7N|*F zyucxJtLfm4Q>!kvs;$_l`7t}+$3aI)EnrdRYWpSKYPn9FLE^>jc|Rg%ZzwE$a_8Iw zo;wFMFO?{oR~jAO`P}yW-0pQ3SLAGKsDC1^cssr{t6T6zxBOFHg+JfS3)d8FWcu46 zgP(WlPUL{x1QQwpR6#mX7!7U zU8__kR$MN1)z-F*N}qVXzR4@q{i6OxeNX+e^70iOTg?qPnD!_XQ}0kCkG4s*3%T9m4m%eA5Na;u=~2_3V-)$I z?LXt%n{(_ww9RWsP1>|Iol!ZxHSiqUzYm+&?Q!ux`EhdEuP^Q54{n^uw0iMohOpXl zxr36M_o`O=e2<;SF~|CSP|DMcNebVz84F@~4OOS#El;>pwf64q&a{)R;R1RwpR`q~ znBDga%x~On=o;3S#>uz0?seVu=|1P}*#C0!r9F$&+Ei5K)hBcH@Q$;-|7&FWOs|zb z480{2=Njhc&pGeT+u7{*-!6YU%X~-quh|DRe9rG(uytnj`UA#aH{8A4skduJ#wIg1 fSCen+eoFIrT}+bq=Dozgz`)??>gTe~DWM4f^V}hi literal 0 HcmV?d00001 diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index fd72d1170..4941ff4ac 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit fd72d11704dbac9019a5cc106461fbb8ac3b4b26 +Subproject commit 4941ff4ac5d66df3626967bf037e2149aee69029