mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
Previous changes created problems with the context-menu, as it was still referencing an icon that we dispose at icon size change. This change introduces a PropertyChanged event object to the CoreConfiguration so those interested can register to changes (currently only the IconSize), and apply the correct menu image.
This commit is contained in:
parent
61c2921b2a
commit
e0c9fc1f7b
5 changed files with 96 additions and 66 deletions
|
@ -388,7 +388,8 @@ namespace Greenshot {
|
|||
}
|
||||
SoundHelper.Initialize();
|
||||
|
||||
MainForm.ResetImageScalingSize();
|
||||
coreConfiguration.PropertyChanged += OnIconSizeChanged;
|
||||
OnIconSizeChanged(this, new PropertyChangedEventArgs("IconSize"));
|
||||
|
||||
// Set the Greenshot icon visibility depending on the configuration. (Added for feature #3521446)
|
||||
// Setting it to true this late prevents Problems with the context menu
|
||||
|
@ -552,12 +553,14 @@ namespace Greenshot {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset ImageScalingSize
|
||||
/// Fix icon reference
|
||||
/// </summary>
|
||||
/// <returns>Used for fixing scaling issues</returns>
|
||||
public static void ResetImageScalingSize() {
|
||||
MainForm thisForm = MainForm.Instance;
|
||||
thisForm.contextMenu.ImageScalingSize = coreConfiguration.IconSize;
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnIconSizeChanged(object sender, PropertyChangedEventArgs e) {
|
||||
if (e.PropertyName == "IconSize") {
|
||||
contextMenu.ImageScalingSize = coreConfiguration.IconSize;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue