diff --git a/src/Greenshot.Base/Core/Enums/ClickActions.cs b/src/Greenshot.Base/Core/Enums/ClickActions.cs index 7c7fb5ee8..ef836442f 100644 --- a/src/Greenshot.Base/Core/Enums/ClickActions.cs +++ b/src/Greenshot.Base/Core/Enums/ClickActions.cs @@ -30,6 +30,11 @@ namespace Greenshot.Base.Core.Enums OPEN_LAST_IN_EXPLORER, OPEN_LAST_IN_EDITOR, OPEN_SETTINGS, - SHOW_CONTEXT_MENU + SHOW_CONTEXT_MENU, + CAPTURE_REGION, + CAPTURE_SCREEN, + CAPTURE_CLIPBOARD, + CAPTURE_WINDOW, + OPEN_EMPTY_EDITOR } } \ No newline at end of file diff --git a/src/Greenshot.Editor/Configuration/EditorConfiguration.cs b/src/Greenshot.Editor/Configuration/EditorConfiguration.cs index 91a5bc335..c36794a5d 100644 --- a/src/Greenshot.Editor/Configuration/EditorConfiguration.cs +++ b/src/Greenshot.Editor/Configuration/EditorConfiguration.cs @@ -79,6 +79,10 @@ namespace Greenshot.Editor.Configuration [IniProperty("TornEdgeEffectSettings", Description = "Settings for the torn edge effect.")] public TornEdgeEffect TornEdgeEffectSettings { get; set; } + [IniProperty("DefaultEditorSize", Description = "The size for the editor when it's opened without a capture", DefaultValue = "500,500")] + public Size DefaultEditorSize { get; set; } + + public override void AfterLoad() { base.AfterLoad(); diff --git a/src/Greenshot.Editor/Forms/ImageEditorForm.cs b/src/Greenshot.Editor/Forms/ImageEditorForm.cs index 9fc410de4..ffbea1a8b 100644 --- a/src/Greenshot.Editor/Forms/ImageEditorForm.cs +++ b/src/Greenshot.Editor/Forms/ImageEditorForm.cs @@ -23,6 +23,7 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; +using System.Drawing.Imaging; using System.IO; using System.Threading; using System.Windows.Forms; @@ -124,7 +125,19 @@ namespace Greenshot.Editor.Forms UpdateUi(); } - public ImageEditorForm(ISurface iSurface, bool outputMade) + public ImageEditorForm() + { + var image = ImageHelper.CreateEmpty(EditorConfiguration.DefaultEditorSize.Width, EditorConfiguration.DefaultEditorSize.Height, PixelFormat.Format32bppArgb, Color.White, 96f, 96f); + ISurface surface = new Surface(image); + Initialize(surface, false); + } + + public ImageEditorForm(ISurface surface, bool outputMade) + { + Initialize(surface, outputMade); + } + + private void Initialize(ISurface surface, bool outputMade) { EditorList.Add(this); @@ -162,7 +175,7 @@ namespace Greenshot.Editor.Forms }; // init surface - Surface = iSurface; + Surface = surface; // Initial "saved" flag for asking if the image needs to be save _surface.Modified = !outputMade; diff --git a/src/Greenshot/Forms/MainForm.cs b/src/Greenshot/Forms/MainForm.cs index b775149cb..9fcaadc97 100644 --- a/src/Greenshot/Forms/MainForm.cs +++ b/src/Greenshot/Forms/MainForm.cs @@ -1735,6 +1735,23 @@ namespace Greenshot.Forms MethodInfo oMethodInfo = typeof(NotifyIcon).GetMethod("ShowContextMenu", BindingFlags.Instance | BindingFlags.NonPublic); oMethodInfo.Invoke(notifyIcon, null); break; + case ClickActions.CAPTURE_CLIPBOARD: + CaptureHelper.CaptureClipboard(); + break; + case ClickActions.CAPTURE_REGION: + CaptureHelper.CaptureRegion(false); + break; + case ClickActions.CAPTURE_SCREEN: + CaptureHelper.CaptureFullscreen(false, ScreenCaptureMode.FullScreen); + break; + case ClickActions.CAPTURE_WINDOW: + CaptureHelper.CaptureWindowInteractive(false); + break; + case ClickActions.OPEN_EMPTY_EDITOR: + var imageEditor = new ImageEditorForm(); + imageEditor.Show(); + imageEditor.Activate(); + break; } }