diff --git a/ApplicationView/AdvancedControlsPanel.cs b/ApplicationView/AdvancedControlsPanel.cs index 8f98c8737..6d734881b 100644 --- a/ApplicationView/AdvancedControlsPanel.cs +++ b/ApplicationView/AdvancedControlsPanel.cs @@ -100,14 +100,6 @@ namespace MatterHackers.MatterControl ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes())); - - newTabControl.AddTab( - new SimpleTextTabWidget( - new TabPage(new PrinterConfigurationScrollWidget(), "Options".Localize().ToUpper()), - "Options Tab", - newTabControl.TextPointSize, - ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes())); - newTabControl.SelectedTabIndex = ApplicationController.Instance.ActiveAdvancedControlsTab; return newTabControl; diff --git a/ApplicationView/MenuRow/ApplicationMenuRow.cs b/ApplicationView/MenuRow/ApplicationMenuRow.cs index d662c3ea1..28b2057e3 100644 --- a/ApplicationView/MenuRow/ApplicationMenuRow.cs +++ b/ApplicationView/MenuRow/ApplicationMenuRow.cs @@ -66,8 +66,6 @@ namespace MatterHackers.MatterControl // put in the file menu this.AddChild(new MenuOptionFile()); - this.AddChild(new MenuOptionSettings()); - // put in the action menu if (ActiveSliceSettings.Instance?.ActionMacros().Any() == true) { @@ -77,6 +75,8 @@ namespace MatterHackers.MatterControl // put in the help menu this.AddChild(new MenuOptionHelp()); + this.AddChild(new MenuOptionSettings()); + //linkButtonFactory.textColor = ActiveTheme.Instance.SecondaryAccentColor; linkButtonFactory.fontSize = 10; diff --git a/ApplicationView/MenuRow/MenuOptionSettings.cs b/ApplicationView/MenuRow/MenuOptionSettings.cs index 8f0021639..2f08d91e6 100644 --- a/ApplicationView/MenuRow/MenuOptionSettings.cs +++ b/ApplicationView/MenuRow/MenuOptionSettings.cs @@ -9,24 +9,27 @@ using MatterHackers.VectorMath; using System; using System.Collections.Generic; using System.IO; +using MatterHackers.MatterControl.PartPreviewWindow; namespace MatterHackers.MatterControl { - public class MenuOptionSettings : MenuBase + + public class MenuOptionSettings : PopupButton { - static public PopOutTextTabWidget sliceSettingsPopOut = null; - - public MenuOptionSettings() : base("View".Localize()) + public MenuOptionSettings() + : base(new TextWidget("Options".Localize().ToUpper(), 0, 0, 10, textColor: ActiveTheme.Instance.PrimaryTextColor)) { - } + Margin = new BorderDouble(0); + Padding = new BorderDouble(4); + VAnchor = VAnchor.ParentCenter; + OpenOffset = new Vector2(-3, -5); - protected override IEnumerable GetMenuActions() - { - return new List + var container = new GuiWidget(640, 600) { - new MenuItemAction("Settings".Localize(), () => sliceSettingsPopOut?.ShowInWindow()), - new MenuItemAction("Terminal".Localize(), () => UiThread.RunOnIdle(TerminalWindow.Show)), + BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor, }; + container.AddChild(new PrinterConfigurationScrollWidget()); + this.PopupContent = container; } } } \ No newline at end of file diff --git a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs index fec41ed1d..5f0a9615c 100644 --- a/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs +++ b/ConfigurationPage/ApplicationSettings/ApplicationSettingsView.cs @@ -256,27 +256,11 @@ namespace MatterHackers.MatterControl.ConfigurationPage buttonRow.HAnchor = HAnchor.ParentLeftRight; buttonRow.Margin = new BorderDouble(top: 4); - TextWidget settingsLabel = new TextWidget("Display Mode".Localize()); + TextWidget settingsLabel = new TextWidget("Touch Screen Mode".Localize()); settingsLabel.AutoExpandBoundsToText = true; settingsLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; settingsLabel.VAnchor = VAnchor.ParentTop; - Button displayControlRestartButton = textImageButtonFactory.Generate("Restart".Localize()); - displayControlRestartButton.VAnchor = Agg.UI.VAnchor.ParentCenter; - displayControlRestartButton.Visible = false; - displayControlRestartButton.Margin = new BorderDouble(right: 6); - displayControlRestartButton.Click += (s, e) => - { - if (PrinterConnection.Instance.PrinterIsPrinting) - { - StyledMessageBox.ShowMessageBox(null, cannotRestartWhilePrintIsActiveMessage, cannotRestartWhileActive); - } - else - { - RestartApplication(); - } - }; - FlowLayoutWidget optionsContainer = new FlowLayoutWidget(FlowDirection.TopToBottom); optionsContainer.Margin = new BorderDouble(bottom: 6); @@ -286,32 +270,29 @@ namespace MatterHackers.MatterControl.ConfigurationPage optionsContainer.AddChild(interfaceOptionsDropList); optionsContainer.Width = 200; - interfaceOptionsDropList.AddItem("Normal".Localize(), "responsive"); - interfaceOptionsDropList.AddItem("Touchscreen".Localize(), "touchscreen"); - List acceptableUpdateFeedTypeValues = new List() { "responsive", "touchscreen" }; string currentDisplayModeType = UserSettings.Instance.get(UserSettingsKey.ApplicationDisplayMode); - if (acceptableUpdateFeedTypeValues.IndexOf(currentDisplayModeType) == -1) + CheckBox touchScreenModeSwitch = ImageButtonFactory.CreateToggleSwitch(currentDisplayModeType == acceptableUpdateFeedTypeValues[1]); + touchScreenModeSwitch.VAnchor = VAnchor.ParentCenter; + touchScreenModeSwitch.CheckedStateChanged += (sender, e) => { - UserSettings.Instance.set(UserSettingsKey.ApplicationDisplayMode, "responsive"); - } - - interfaceOptionsDropList.SelectedValue = UserSettings.Instance.get(UserSettingsKey.ApplicationDisplayMode); - interfaceOptionsDropList.SelectionChanged += (s, e) => - { - string displayMode = ((DropDownList)s).SelectedValue; + string displayMode = acceptableUpdateFeedTypeValues[0]; + if(touchScreenModeSwitch.Checked) + { + displayMode = acceptableUpdateFeedTypeValues[1]; + } if (displayMode != UserSettings.Instance.get(UserSettingsKey.ApplicationDisplayMode)) { UserSettings.Instance.set(UserSettingsKey.ApplicationDisplayMode, displayMode); - displayControlRestartButton.Visible = true; + ApplicationController.Instance.ReloadAll(); } }; buttonRow.AddChild(settingsLabel); buttonRow.AddChild(new HorizontalSpacer()); - buttonRow.AddChild(displayControlRestartButton); - buttonRow.AddChild(optionsContainer); + buttonRow.AddChild(touchScreenModeSwitch); + return buttonRow; } @@ -433,38 +414,26 @@ namespace MatterHackers.MatterControl.ConfigurationPage FlowLayoutWidget optionsContainer = new FlowLayoutWidget(FlowDirection.TopToBottom); optionsContainer.Margin = new BorderDouble(bottom: 6); - Button languageRestartButton = textImageButtonFactory.Generate("Apply".Localize()); - languageRestartButton.VAnchor = Agg.UI.VAnchor.ParentCenter; - languageRestartButton.Visible = false; - languageRestartButton.Margin = new BorderDouble(right: 6); - - languageRestartButton.Click += (sender, e) => - { - if (PrinterConnection.Instance.PrinterIsPrinting) - { - StyledMessageBox.ShowMessageBox(null, cannotRestartWhilePrintIsActiveMessage, cannotRestartWhileActive); - } - else - { - LocalizedString.ResetTranslationMap(); - ApplicationController.Instance.ReloadAll(); - } - }; LanguageSelector languageSelector = new LanguageSelector(); languageSelector.SelectionChanged += (s, e) => { - string languageCode = languageSelector.SelectedValue; - if (languageCode != UserSettings.Instance.get("Language")) + UiThread.RunOnIdle(() => { - UserSettings.Instance.set("Language", languageCode); - languageRestartButton.Visible = true; - - if (languageCode == "L10N") + string languageCode = languageSelector.SelectedValue; + if (languageCode != UserSettings.Instance.get("Language")) { - GenerateLocalizationValidationFile(); + UserSettings.Instance.set("Language", languageCode); + + if (languageCode == "L10N") + { + GenerateLocalizationValidationFile(); + } + + LocalizedString.ResetTranslationMap(); + ApplicationController.Instance.ReloadAll(); } - } + }); }; languageSelector.HAnchor = HAnchor.ParentLeftRight; @@ -474,7 +443,6 @@ namespace MatterHackers.MatterControl.ConfigurationPage buttonRow.AddChild(settingsLabel); buttonRow.AddChild(new HorizontalSpacer()); - buttonRow.AddChild(languageRestartButton); buttonRow.AddChild(optionsContainer); return buttonRow; } diff --git a/ConfigurationPage/PrinterConfigurationPage.cs b/ConfigurationPage/PrinterConfigurationPage.cs index f6dfda022..41feb4956 100644 --- a/ConfigurationPage/PrinterConfigurationPage.cs +++ b/ConfigurationPage/PrinterConfigurationPage.cs @@ -40,7 +40,7 @@ using System.Collections.Generic; namespace MatterHackers.MatterControl { - public class PrinterConfigurationScrollWidget : ScrollableWidget + public class PrinterConfigurationScrollWidget : ScrollableWidget, IIgnoredPopupChild { public PrinterConfigurationScrollWidget() : base(true) diff --git a/PartPreviewWindow/OverflowDropdown.cs b/PartPreviewWindow/OverflowDropdown.cs index 603f157c5..dc341c30b 100644 --- a/PartPreviewWindow/OverflowDropdown.cs +++ b/PartPreviewWindow/OverflowDropdown.cs @@ -126,6 +126,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public IPopupLayoutEngine PopupLayoutEngine { get; set; } public Direction PopDirection { get; set; } = Direction.Down; public bool MakeScrollable { get; set; } = true; + public Vector2 OpenOffset { get; set; } = Vector2.Zero; public GuiWidget PopupContent { get; set; } @@ -153,7 +154,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { if (PopupLayoutEngine == null) { - PopupLayoutEngine = new PopupLayoutEngine(this.PopupContent, this, Vector2.Zero, this.PopDirection, 0, this.AlignToRightEdge); + PopupLayoutEngine = new PopupLayoutEngine(this.PopupContent, this, OpenOffset, this.PopDirection, 0, this.AlignToRightEdge); } menuVisible = true; diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 96c33a33f..b0b5ba590 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -6247,3 +6247,6 @@ Translated:Lower / Deploy English:Raise / Stow Translated:Raise / Stow +English:Touch Screen Mode +Translated:Touch Screen Mode + diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 9fed1dfbc..7e4effb1b 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 9fed1dfbc62ed687a752c665a34e887fc9b2e7a2 +Subproject commit 7e4effb1bbcd9307add0049c5519aeef2d50d082