Index: Core/Common/src/Core.Common.Controls/Forms/CustomToolStripRenderer.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Controls/Forms/CustomToolStripRenderer.cs (revision 0)
+++ Core/Common/src/Core.Common.Controls/Forms/CustomToolStripRenderer.cs (revision c347a9390ab4b0fbf97363fa62a9ab1827ec1b69)
@@ -0,0 +1,56 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace Core.Common.Controls.Forms
+{
+ ///
+ /// Custom tool strip renderer.
+ ///
+ public class CustomToolStripRenderer : ToolStripProfessionalRenderer
+ {
+ protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e)
+ {
+ if (e.Item is ToolStripButton btn)
+ {
+ if (btn.Checked)
+ {
+ var bounds = new Rectangle(Point.Empty, e.Item.Size);
+
+ e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(228, 228, 223)), bounds);
+ e.Graphics.DrawRectangle(new Pen(Color.FromArgb(210, 210, 202)), bounds);
+
+ btn.ForeColor = Color.FromArgb(0, 139, 191);
+ }
+ else
+ {
+ btn.ForeColor = Color.Black;
+ }
+
+ return;
+ }
+
+ base.OnRenderButtonBackground(e);
+ }
+ }
+}
\ No newline at end of file
Index: Core/Common/test/Core.Common.Controls.Test/Forms/CustomToolStripRendererTest.cs
===================================================================
diff -u
--- Core/Common/test/Core.Common.Controls.Test/Forms/CustomToolStripRendererTest.cs (revision 0)
+++ Core/Common/test/Core.Common.Controls.Test/Forms/CustomToolStripRendererTest.cs (revision c347a9390ab4b0fbf97363fa62a9ab1827ec1b69)
@@ -0,0 +1,41 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Windows.Forms;
+using Core.Common.Controls.Forms;
+using NUnit.Framework;
+
+namespace Core.Common.Controls.Test.Forms
+{
+ [TestFixture]
+ public class CustomToolStripRendererTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Call
+ var toolStripRenderer = new CustomToolStripRenderer();
+
+ // Assert
+ Assert.IsInstanceOf(toolStripRenderer);
+ }
+ }
+}
\ No newline at end of file
Index: Core/Components/src/Core.Components.DotSpatial.Forms/MapControl.Designer.cs
===================================================================
diff -u -r3b75626e8f322a39e07c03da3ef5f382639eb15c -rc347a9390ab4b0fbf97363fa62a9ab1827ec1b69
--- Core/Components/src/Core.Components.DotSpatial.Forms/MapControl.Designer.cs (.../MapControl.Designer.cs) (revision 3b75626e8f322a39e07c03da3ef5f382639eb15c)
+++ Core/Components/src/Core.Components.DotSpatial.Forms/MapControl.Designer.cs (.../MapControl.Designer.cs) (revision c347a9390ab4b0fbf97363fa62a9ab1827ec1b69)
@@ -20,6 +20,8 @@
// All rights reserved.
using System.ComponentModel;
+using System.Drawing;
+using Core.Common.Controls.Forms;
using Core.Components.DotSpatial.Forms.Properties;
namespace Core.Components.DotSpatial.Forms
@@ -57,6 +59,7 @@
this.toolStrip.Dock = System.Windows.Forms.DockStyle.Fill;
this.toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
+ this.toolStrip.BackColor = Color.FromArgb(241, 241, 238);
this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.panToolStripButton,
this.zoomToRectangleToolStripButton,
@@ -69,6 +72,7 @@
this.toolStrip.Name = "toolStrip";
this.toolStrip.Size = new System.Drawing.Size(28, 397);
this.toolStrip.TabIndex = 0;
+ this.toolStrip.Renderer = new CustomToolStripRenderer();
//
// panToolStripButton
//