diff --git a/ApplicationView/ThemeConfig.cs b/ApplicationView/ThemeConfig.cs index 8ebb6d259..899cbcfc2 100644 --- a/ApplicationView/ThemeConfig.cs +++ b/ApplicationView/ThemeConfig.cs @@ -120,6 +120,8 @@ namespace MatterHackers.MatterControl public int OverlayAlpha { get; set; } = 50; + public Color InteractionLayerOverlayColor { get; private set; } + private EventHandler unregisterEvents; static ThemeConfig() @@ -164,6 +166,9 @@ namespace MatterHackers.MatterControl this.ActiveTabColor = ResolveColor(theme.PrimaryBackgroundColor, new Color(Color.Black, this.SlightShade.alpha)); + // Active tab color with slight transparency + this.InteractionLayerOverlayColor = new Color(this.ActiveTabColor, 200); + float alpha0to1 = (ActiveTheme.Instance.IsDarkTheme ? 20 : 60) / 255.0f; this.InactiveTabColor = ResolveColor(theme.PrimaryBackgroundColor, new Color(Color.White, this.SlightShade.alpha)); diff --git a/PartPreviewWindow/GCode3DWidget.cs b/PartPreviewWindow/GCode3DWidget.cs index c61db6386..e81e110bf 100644 --- a/PartPreviewWindow/GCode3DWidget.cs +++ b/PartPreviewWindow/GCode3DWidget.cs @@ -72,7 +72,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { Margin = new BorderDouble(0, 0, 35, 60), Padding = new BorderDouble(10, 10, 10, 8), - BackgroundColor = new Color(0, 0, 0, theme.OverlayAlpha), + BackgroundColor = theme.InteractionLayerOverlayColor, HAnchor = HAnchor.Absolute | HAnchor.Right, VAnchor = VAnchor.Top | VAnchor.Fit, Width = 175 diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index 2f71691bc..0c26b97eb 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -125,7 +125,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow this.viewControls3D = viewControls3D; this.theme = theme; this.Name = "View3DWidget"; - this.BackgroundColor = ApplicationController.Instance.Theme.TabBodyBackground; + this.BackgroundColor = theme.TabBodyBackground; autoRotating = allowAutoRotate; allowAutoRotate = (autoRotate == AutoRotate.Enabled); @@ -154,7 +154,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var buttonBottomPanel = new FlowLayoutWidget(FlowDirection.LeftToRight) { HAnchor = HAnchor.Stretch, - Padding = ApplicationController.Instance.Theme.ToolbarPadding, + Padding = theme.ToolbarPadding, BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor, }; @@ -404,7 +404,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow new PopupButton(buttonView) { PopDirection = Direction.Up, - PopupContent = ApplicationController.Instance.Theme.CreatePopupMenu(bedMenuActions), + PopupContent = theme.CreatePopupMenu(bedMenuActions), AlignToRightEdge = true, Margin = buttonSpacing, Name = "Bed Options Menu", @@ -425,7 +425,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow selectedObjectPanel = new SelectedObjectPanel(this, this.Scene, theme) { - BackgroundColor = new Color(0, 0, 0, theme.OverlayAlpha), + BackgroundColor = theme.InteractionLayerOverlayColor, VAnchor = VAnchor.Top | VAnchor.Fit, HAnchor = HAnchor.Left | HAnchor.Fit, }; @@ -436,8 +436,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow VAnchor = VAnchor.Fit | VAnchor.Top, HAnchor = HAnchor.Right, Margin = new BorderDouble(0, 0, 0, viewControls3D.LocalBounds.Height), - SpliterBarColor = ApplicationController.Instance.Theme.SplitterBackground, - SplitterWidth = ApplicationController.Instance.Theme.SplitterWidth, + SpliterBarColor = theme.SplitterBackground, + SplitterWidth = theme.SplitterWidth, Visible = false, }; this.AddChild(selectedObjectContainer); @@ -1490,7 +1490,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow alignButtons.AddChild(new HorizontalSpacer()); } - var dualExtrusionAlignButton = ApplicationController.Instance.Theme.MenuButtonFactory.Generate("Align for Dual Extrusion".Localize()); + var dualExtrusionAlignButton = theme.MenuButtonFactory.Generate("Align for Dual Extrusion".Localize()); dualExtrusionAlignButton.Margin = new BorderDouble(21, 0); dualExtrusionAlignButton.HAnchor = HAnchor.Left; buttonPanel.AddChild(dualExtrusionAlignButton); @@ -1503,7 +1503,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow internal enum AxisAlignment { Min, Center, Max, SourceCoordinateSystem }; private GuiWidget CreateAlignButton(int axisIndex, AxisAlignment alignment, string lable) { - var smallMarginButtonFactory = ApplicationController.Instance.Theme.MenuButtonFactory; + var smallMarginButtonFactory = theme.MenuButtonFactory; var alignButton = smallMarginButtonFactory.Generate(lable); alignButton.Margin = new BorderDouble(3, 0); diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 25885db01..f28020c6a 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 25885db019ea66d5a7480b6fac031936fcdba1e9 +Subproject commit f28020c6a727fffb6e5d0144290aed56fb337c00