diff --git a/src/modules/colorPicker/ColorPickerUI/Mouse/MouseInfoProvider.cs b/src/modules/colorPicker/ColorPickerUI/Mouse/MouseInfoProvider.cs index 5dd74771d0..2389c7c268 100644 --- a/src/modules/colorPicker/ColorPickerUI/Mouse/MouseInfoProvider.cs +++ b/src/modules/colorPicker/ColorPickerUI/Mouse/MouseInfoProvider.cs @@ -24,6 +24,7 @@ namespace ColorPicker.Mouse private readonly IUserSettings _userSettings; private System.Windows.Point _previousMousePosition = new System.Windows.Point(-1, 1); private Color _previousColor = Color.Transparent; + private bool _colorFormatChanged; [ImportingConstructor] public MouseInfoProvider(AppStateHandler appStateMonitor, IUserSettings userSettings) @@ -40,6 +41,7 @@ namespace ColorPicker.Mouse _mouseHook = new MouseHook(); _userSettings = userSettings; + _userSettings.CopiedColorRepresentation.PropertyChanged += CopiedColorRepresentation_PropertyChanged; } public event EventHandler MouseColorChanged; @@ -73,9 +75,10 @@ namespace ColorPicker.Mouse } var color = GetPixelColor(mousePosition); - if (_previousColor != color) + if (_previousColor != color || _colorFormatChanged) { _previousColor = color; + _colorFormatChanged = false; MouseColorChanged?.Invoke(this, color); } } @@ -137,6 +140,11 @@ namespace ColorPicker.Mouse OnMouseDown?.Invoke(this, p); } + private void CopiedColorRepresentation_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + _colorFormatChanged = true; + } + private void DisposeHook() { if (_timer.IsEnabled)