Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
martinchrzan committed Mar 1, 2021
2 parents 38c1b02 + 20311a6 commit fbcf77c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
6 changes: 3 additions & 3 deletions ColorPicker.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<package>
<metadata>
<id>ColorPicker</id>
<version>1.1.0</version>
<version>1.1.1</version>
<authors>Martin Chrzan</authors>
<owners>Martin Chrzan</owners>
<licenseUrl>https://github.com/martinchrzan/ColorPicker/blob/master/LICENSE</licenseUrl>
<projectUrl>http://github.com/martinchrzan/ColorPicker</projectUrl>
<!--<iconUrl></iconUrl>-->
<releaseNotes>
Added Colors History Palette activated by right mouse click when color picker is open
Pressing Esc closes Zoom window or Colors History Palette if opened
Color Picker adapts to the current Windows theme
Fixed colors in Settings window when using light theme
</releaseNotes>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Color Picker</description>
Expand Down
25 changes: 15 additions & 10 deletions ColorPicker/Controls/CircularMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,23 @@ public override void BeginInit()

private void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
var newItem = e.NewItems[0] as CircularMenuItem;
if(newItem != null)
{
(e.NewItems[0] as CircularMenuItem).MouseEnter += CircularMenuItem_MouseEnter;
(e.NewItems[0] as CircularMenuItem).PreviewMouseDown += CircularMenuItem_MouseDown;
(e.NewItems[0] as CircularMenuItem).MouseLeave += CircularMenuItem_MouseLeave;
}
else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
{
(e.NewItems[0] as CircularMenuItem).MouseEnter -= CircularMenuItem_MouseEnter;
(e.NewItems[0] as CircularMenuItem).MouseLeave -= CircularMenuItem_MouseLeave;
(e.NewItems[0] as CircularMenuItem).PreviewMouseDown -= CircularMenuItem_MouseDown;
if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
{
newItem.MouseEnter += CircularMenuItem_MouseEnter;
newItem.PreviewMouseDown += CircularMenuItem_MouseDown;
newItem.MouseLeave += CircularMenuItem_MouseLeave;
}
else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
{
newItem.MouseEnter -= CircularMenuItem_MouseEnter;
newItem.MouseLeave -= CircularMenuItem_MouseLeave;
newItem.PreviewMouseDown -= CircularMenuItem_MouseDown;
}
}

if(Items?.Count > 0)
{
CentralItem.ContentText = string.Empty;
Expand Down
4 changes: 2 additions & 2 deletions ColorPicker/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.1.1.0")]
[assembly: AssemblyFileVersion("1.1.1.0")]
[assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]

0 comments on commit fbcf77c

Please sign in to comment.