From d2ec546fed4d392de0d02e7611d55c45ab7f89db Mon Sep 17 00:00:00 2001 From: jlewin Date: Wed, 19 Jun 2019 14:01:38 -0700 Subject: [PATCH] Fix warnings --- MatterControlLib/PartPreviewWindow/PopupMenuButton.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/MatterControlLib/PartPreviewWindow/PopupMenuButton.cs b/MatterControlLib/PartPreviewWindow/PopupMenuButton.cs index 3823993c7..f94da2431 100644 --- a/MatterControlLib/PartPreviewWindow/PopupMenuButton.cs +++ b/MatterControlLib/PartPreviewWindow/PopupMenuButton.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2017, Lars Brubaker, John Lewin +Copyright (c) 2019, Lars Brubaker, John Lewin All rights reserved. Redistribution and use in source and binary forms, with or without @@ -39,7 +39,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { public class PopupMenuButton : PopupButton { - private ThemeConfig theme; + private readonly ThemeConfig theme; private bool mouseInBounds; private bool _drawArrow = false; private VertexStorage dropArrow = DropArrow.DownArrow; @@ -55,7 +55,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } public PopupMenuButton(ImageBuffer imageBuffer, ThemeConfig theme) - : this (new IconButton(imageBuffer, theme), theme) + : this(new IconButton(imageBuffer, theme), theme) { } @@ -75,7 +75,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } public PopupMenuButton(string text, ThemeConfig theme) - : this (new TextButton(text, theme) + : this(new TextButton(text, theme) { Selectable = false, Padding = theme.TextButtonPadding.Clone(right: 5) @@ -121,7 +121,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow base.OnBoundsChanged(e); } - public override void OnDraw(Graphics2D graphics2D) { base.OnDraw(graphics2D); @@ -170,7 +169,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow return this.MouseDownColor; } else if (!menuVisible - && this.mouseInBounds + && mouseInBounds && this.Enabled) { return this.HoverColor;