mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-15 19:36:38 +12:00
Merge pull request #2881 from Jaex/editor-mode-start-maximized
Added option to start image editor window maximized
This commit is contained in:
commit
998df5bc4d
|
@ -102,16 +102,16 @@ public Color CurrentColor
|
|||
private Bitmap bmpBackgroundImage;
|
||||
private Cursor defaultCursor;
|
||||
|
||||
public RegionCaptureForm(RegionCaptureMode mode)
|
||||
public RegionCaptureForm(RegionCaptureMode mode, RegionCaptureOptions options)
|
||||
{
|
||||
Mode = mode;
|
||||
Config = options;
|
||||
|
||||
ScreenRectangle0Based = CaptureHelpers.GetScreenBounds0Based();
|
||||
ImageRectangle = ScreenRectangle0Based;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
Config = new RegionCaptureOptions();
|
||||
DrawableObjects = new List<DrawableObject>();
|
||||
timerStart = new Stopwatch();
|
||||
timerFPS = new Stopwatch();
|
||||
|
@ -162,9 +162,18 @@ private void InitializeComponent()
|
|||
Text = "ShareX - " + "Annotate"; // TODO: Translate
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
FormBorderStyle = FormBorderStyle.Sizable;
|
||||
Size = new Size(800, 600);
|
||||
MinimumSize = new Size(800, 600);
|
||||
WindowState = FormWindowState.Maximized;
|
||||
Size = new Size(900, 700);
|
||||
MinimumSize = new Size(900, 600);
|
||||
|
||||
if (Config.EditorModeStartMaximized)
|
||||
{
|
||||
WindowState = FormWindowState.Maximized;
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowState = FormWindowState.Normal;
|
||||
}
|
||||
|
||||
ShowInTaskbar = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,5 +74,8 @@ public class RegionCaptureOptions
|
|||
public AnnotationOptions AnnotationOptions = new AnnotationOptions();
|
||||
public ShapeType LastRegionTool = ShapeType.RegionRectangle;
|
||||
public ShapeType LastAnnotationTool = ShapeType.DrawingRectangle;
|
||||
|
||||
// Editor mode
|
||||
public bool EditorModeStartMaximized = true;
|
||||
}
|
||||
}
|
|
@ -35,11 +35,11 @@ public static class RegionCaptureTasks
|
|||
{
|
||||
public static Image GetRegionImage(RegionCaptureOptions options)
|
||||
{
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.Default))
|
||||
{
|
||||
form.Config = GetRegionCaptureOptions(options);
|
||||
form.Config.ShowHotkeys = false;
|
||||
RegionCaptureOptions newOptions = GetRegionCaptureOptions(options);
|
||||
newOptions.ShowHotkeys = false;
|
||||
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.Default, newOptions))
|
||||
{
|
||||
form.Prepare();
|
||||
form.ShowDialog();
|
||||
|
||||
|
@ -49,11 +49,11 @@ public static Image GetRegionImage(RegionCaptureOptions options)
|
|||
|
||||
public static bool GetRectangleRegion(out Rectangle rect, RegionCaptureOptions options)
|
||||
{
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.Default))
|
||||
{
|
||||
form.Config = GetRegionCaptureOptions(options);
|
||||
form.Config.ShowHotkeys = false;
|
||||
RegionCaptureOptions newOptions = GetRegionCaptureOptions(options);
|
||||
newOptions.ShowHotkeys = false;
|
||||
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.Default, newOptions))
|
||||
{
|
||||
form.Prepare();
|
||||
form.ShowDialog();
|
||||
|
||||
|
@ -94,13 +94,13 @@ public static bool GetRectangleRegion(out Rectangle rect, RegionCaptureOptions o
|
|||
|
||||
public static PointInfo GetPointInfo(RegionCaptureOptions options)
|
||||
{
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.ScreenColorPicker))
|
||||
{
|
||||
form.Config = GetRegionCaptureOptions(options);
|
||||
form.Config.DetectWindows = false;
|
||||
form.Config.ShowHotkeys = false;
|
||||
form.Config.UseDimming = false;
|
||||
RegionCaptureOptions newOptions = GetRegionCaptureOptions(options);
|
||||
newOptions.DetectWindows = false;
|
||||
newOptions.ShowHotkeys = false;
|
||||
newOptions.UseDimming = false;
|
||||
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.ScreenColorPicker, newOptions))
|
||||
{
|
||||
form.Prepare();
|
||||
form.ShowDialog();
|
||||
|
||||
|
@ -118,13 +118,13 @@ public static PointInfo GetPointInfo(RegionCaptureOptions options)
|
|||
|
||||
public static SimpleWindowInfo GetWindowInfo(RegionCaptureOptions options)
|
||||
{
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.OneClick))
|
||||
{
|
||||
form.Config = GetRegionCaptureOptions(options);
|
||||
form.Config.UseDimming = false;
|
||||
form.Config.ShowMagnifier = false;
|
||||
form.Config.ShowHotkeys = false;
|
||||
RegionCaptureOptions newOptions = GetRegionCaptureOptions(options);
|
||||
newOptions.UseDimming = false;
|
||||
newOptions.ShowMagnifier = false;
|
||||
newOptions.ShowHotkeys = false;
|
||||
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.OneClick, newOptions))
|
||||
{
|
||||
form.Prepare();
|
||||
form.ShowDialog();
|
||||
|
||||
|
@ -139,12 +139,12 @@ public static SimpleWindowInfo GetWindowInfo(RegionCaptureOptions options)
|
|||
|
||||
public static void ShowScreenRuler(RegionCaptureOptions options)
|
||||
{
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.Ruler))
|
||||
{
|
||||
form.Config = GetRegionCaptureOptions(options);
|
||||
form.Config.QuickCrop = false;
|
||||
form.Config.ShowHotkeys = false;
|
||||
RegionCaptureOptions newOptions = GetRegionCaptureOptions(options);
|
||||
newOptions.QuickCrop = false;
|
||||
newOptions.ShowHotkeys = false;
|
||||
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(RegionCaptureMode.Ruler, newOptions))
|
||||
{
|
||||
form.Prepare();
|
||||
form.ShowDialog();
|
||||
}
|
||||
|
@ -160,11 +160,9 @@ public static void ShowScreenRuler(RegionCaptureOptions options)
|
|||
{
|
||||
RegionCaptureMode mode = taskMode ? RegionCaptureMode.TaskEditor : RegionCaptureMode.Editor;
|
||||
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(mode))
|
||||
using (RegionCaptureForm form = new RegionCaptureForm(mode, options))
|
||||
{
|
||||
form.Config = options;
|
||||
form.ImageFilePath = filePath;
|
||||
|
||||
form.Prepare(img);
|
||||
form.ShowDialog();
|
||||
|
||||
|
|
|
@ -715,6 +715,17 @@ internal void CreateToolbar()
|
|||
tsddbOptions.Image = Resources.gear;
|
||||
tsMain.Items.Add(tsddbOptions);
|
||||
|
||||
if (form.IsEditorMode)
|
||||
{
|
||||
ToolStripMenuItem tsmiEditorModeStartMaximized = new ToolStripMenuItem("Start editor maximized");
|
||||
tsmiEditorModeStartMaximized.Checked = Config.EditorModeStartMaximized;
|
||||
tsmiEditorModeStartMaximized.CheckOnClick = true;
|
||||
tsmiEditorModeStartMaximized.Click += (sender, e) => Config.EditorModeStartMaximized = tsmiEditorModeStartMaximized.Checked;
|
||||
tsddbOptions.DropDownItems.Add(tsmiEditorModeStartMaximized);
|
||||
|
||||
tsddbOptions.DropDownItems.Add(new ToolStripSeparator());
|
||||
}
|
||||
|
||||
if (!form.IsEditorMode)
|
||||
{
|
||||
tsmiQuickCrop = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Multi_region_mode);
|
||||
|
|
|
@ -74,11 +74,10 @@ protected ImageInfo ExecuteRegionCapture(TaskSettings taskSettings)
|
|||
mode = RegionCaptureMode.Annotation;
|
||||
}
|
||||
|
||||
RegionCaptureForm form = new RegionCaptureForm(mode);
|
||||
RegionCaptureForm form = new RegionCaptureForm(mode, taskSettings.CaptureSettingsReference.SurfaceOptions);
|
||||
|
||||
try
|
||||
{
|
||||
form.Config = taskSettings.CaptureSettingsReference.SurfaceOptions;
|
||||
Screenshot screenshot = TaskHelpers.GetScreenshot(taskSettings);
|
||||
screenshot.CaptureCursor = false;
|
||||
Image img = screenshot.CaptureFullscreen();
|
||||
|
|
Loading…
Reference in a new issue