-
-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix conflicts between window resizing and image zooming
- Prevent resizing zoomed image on window resizing / locked ratio - Add new helper class to clone ToolStripMenuItem
- Loading branch information
Dương Diệu Pháp
committed
Aug 15, 2015
1 parent
9df1187
commit f57c77c
Showing
23 changed files
with
156 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
using System.ComponentModel; | ||
using System.Reflection; | ||
using System.Windows.Forms; | ||
|
||
namespace ImageGlass.Library | ||
{ | ||
public static class Menu | ||
{ | ||
/// <summary> | ||
/// Clone ToolStripMenu item | ||
/// </summary> | ||
/// <param name="mnu">ToolStripMenuItem</param> | ||
/// <returns></returns> | ||
public static ToolStripMenuItem Clone(ToolStripMenuItem mnu) | ||
{ | ||
ToolStripMenuItem m = new ToolStripMenuItem(); | ||
|
||
//clone all events | ||
var eventsField = typeof(Component).GetField("events", BindingFlags.NonPublic | BindingFlags.Instance); | ||
var eventHandlerList = eventsField.GetValue(mnu); | ||
eventsField.SetValue(m, eventHandlerList); | ||
|
||
//clone all properties | ||
m.AccessibleName = mnu.AccessibleName; | ||
m.AccessibleRole = mnu.AccessibleRole; | ||
m.Alignment = mnu.Alignment; | ||
m.AllowDrop = mnu.AllowDrop; | ||
m.Anchor = mnu.Anchor; | ||
m.AutoSize = mnu.AutoSize; | ||
m.AutoToolTip = mnu.AutoToolTip; | ||
m.BackColor = mnu.BackColor; | ||
m.BackgroundImage = mnu.BackgroundImage; | ||
m.BackgroundImageLayout = mnu.BackgroundImageLayout; | ||
m.Checked = mnu.Checked; | ||
m.CheckOnClick = mnu.CheckOnClick; | ||
m.CheckState = mnu.CheckState; | ||
m.DisplayStyle = mnu.DisplayStyle; | ||
m.Dock = mnu.Dock; | ||
m.DoubleClickEnabled = mnu.DoubleClickEnabled; | ||
m.Enabled = mnu.Enabled; | ||
m.Font = mnu.Font; | ||
m.ForeColor = mnu.ForeColor; | ||
m.Image = mnu.Image; | ||
m.ImageAlign = mnu.ImageAlign; | ||
m.ImageScaling = mnu.ImageScaling; | ||
m.ImageTransparentColor = mnu.ImageTransparentColor; | ||
m.Margin = mnu.Margin; | ||
m.MergeAction = mnu.MergeAction; | ||
m.MergeIndex = mnu.MergeIndex; | ||
m.Name = mnu.Name; | ||
m.Overflow = mnu.Overflow; | ||
m.Padding = mnu.Padding; | ||
m.RightToLeft = mnu.RightToLeft; | ||
|
||
m.ShortcutKeys = mnu.ShortcutKeys; | ||
m.ShowShortcutKeys = mnu.ShowShortcutKeys; | ||
m.Tag = mnu.Tag; | ||
m.Text = mnu.Text; | ||
m.TextAlign = mnu.TextAlign; | ||
m.TextDirection = mnu.TextDirection; | ||
m.TextImageRelation = mnu.TextImageRelation; | ||
m.ToolTipText = mnu.ToolTipText; | ||
|
||
m.Available = mnu.Available; | ||
|
||
if (!mnu.AutoSize) | ||
{ | ||
m.Size = mnu.Size; | ||
} | ||
return m; | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
Source/ImageGlass/obj/Debug/ImageGlass.csproj.GenerateResource.Cache
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Source/ImageGlass/obj/Debug/ImageGlass.csprojResolveAssemblyReference.cache
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.