From 3a180d8813c65aaa88208b150f44abccfa628995 Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Sun, 28 Feb 2021 15:34:50 +1300 Subject: [PATCH] Working shortcut library highlighting Highlighting colours and structure changed to work better with the ILV structure. Next step is to add the ability to visually show invalid shortcuts to notify when a shortcut won't work. --- .../UIForms/ImageListViewRenderers.cs | 19 ++++++++++++++++--- .../UIForms/ShortcutLibraryForm.Designer.cs | 1 - .../UIForms/ShortcutLibraryForm.resx | 3 --- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/DisplayMagician/UIForms/ImageListViewRenderers.cs b/DisplayMagician/UIForms/ImageListViewRenderers.cs index 401b72d..1d15806 100644 --- a/DisplayMagician/UIForms/ImageListViewRenderers.cs +++ b/DisplayMagician/UIForms/ImageListViewRenderers.cs @@ -75,10 +75,11 @@ namespace DisplayMagician.UIForms /*if ((ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None)) || (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None) && ((state & ItemState.Hovered) != ItemState.None)))*/ if ((state & ItemState.Selected) != ItemState.None) + { + //using (Brush bSelected = new LinearGradientBrush(bounds, ImageListView.Colors.SelectedColor1, ImageListView.Colors.SelectedColor2, LinearGradientMode.Vertical)) + using (Brush bSelected = new LinearGradientBrush(bounds, Color.WhiteSmoke, Color.LightGray, LinearGradientMode.Vertical)) { - using (Brush bSelected = new LinearGradientBrush(bounds, ImageListView.Colors.SelectedColor1, ImageListView.Colors.SelectedColor2, LinearGradientMode.Vertical)) - { - Utility.FillRoundedRectangle(g, bSelected, bounds, 10); + Utility.FillRoundedRectangle(g, bSelected, bounds, 12); } } @@ -169,6 +170,18 @@ namespace DisplayMagician.UIForms Utility.DrawRoundedRectangle(g, pGray128, bounds.Left, bounds.Top, bounds.Width - 1, bounds.Height - 1, 4); } }*/ + if ((state & ItemState.Selected) != ItemState.None) + { + /*using (Pen pGray128 = new Pen(ImageListView.Colors.UnFocusedBorderColor)) + { + Utility.DrawRoundedRectangle(g, pGray128, bounds.Left, bounds.Top, bounds.Width - 1, bounds.Height - 1, 4); + }*/ + using (Pen pSelectedBorder = new Pen(Color.Brown,4)) + { + //DrawRoundedRectangle(g, pSelectedBorder, bounds, 9); + Utility.DrawRoundedRectangle(g, pSelectedBorder, bounds.Left+3, bounds.Top+3, bounds.Width - 5, bounds.Height - 5, 10); + } + } /*else if (ImageListView.View != View.Details && (state & ItemState.Selected) == ItemState.None) { using (Pen pGray64 = new Pen(ImageListView.Colors.BorderColor)) diff --git a/DisplayMagician/UIForms/ShortcutLibraryForm.Designer.cs b/DisplayMagician/UIForms/ShortcutLibraryForm.Designer.cs index c6ce009..2013f53 100644 --- a/DisplayMagician/UIForms/ShortcutLibraryForm.Designer.cs +++ b/DisplayMagician/UIForms/ShortcutLibraryForm.Designer.cs @@ -59,7 +59,6 @@ this.ilv_saved_shortcuts.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.ilv_saved_shortcuts.Colors = new Manina.Windows.Forms.ImageListViewColor(resources.GetString("ilv_saved_shortcuts.Colors")); this.ilv_saved_shortcuts.Location = new System.Drawing.Point(0, 98); this.ilv_saved_shortcuts.MultiSelect = false; this.ilv_saved_shortcuts.Name = "ilv_saved_shortcuts"; diff --git a/DisplayMagician/UIForms/ShortcutLibraryForm.resx b/DisplayMagician/UIForms/ShortcutLibraryForm.resx index 00dd974..76d4ecb 100644 --- a/DisplayMagician/UIForms/ShortcutLibraryForm.resx +++ b/DisplayMagician/UIForms/ShortcutLibraryForm.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - BorderColor = 406d6d6d; UnFocusedColor1 = ffff8080; UnFocusedColor2 = LightCoral; UnFocusedBorderColor = Maroon; HoverColor1 = 80078d7; HoverColor2 = 400078d7; HoverBorderColor = 400078d7; SelectedColor1 = ffff8080; SelectedColor2 = LightCoral; SelectedBorderColor = Maroon; DisabledColor1 = 6d6d6d; DisabledColor2 = 206d6d6d; DisabledBorderColor = 206d6d6d; DisabledForeColor = ff808080; ColumnHeaderBackColor1 = 20f0f0f0; ColumnHeaderBackColor2 = c4f0f0f0; ColumnHeaderHoverColor1 = 100078d7; ColumnHeaderHoverColor2 = 400078d7; ColumnSelectColor = 106d6d6d; ColumnSeparatorColor = 206d6d6d; PaneBackColor = 106d6d6d; PaneSeparatorColor = 806d6d6d; SelectionRectangleColor1 = 800078d7; SelectionRectangleColor2 = 800078d7 - 17, 17