mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-02 21:20:28 +12:00
Added lock position and top most options
This commit is contained in:
parent
69fbcb1070
commit
786582331a
|
@ -37,6 +37,8 @@ public partial class SimpleActionsForm : Form
|
|||
public List<HotkeyType> Actions { get; set; } = new List<HotkeyType>() { HotkeyType.RectangleRegion, HotkeyType.PrintScreen, HotkeyType.LastRegion,
|
||||
HotkeyType.None, HotkeyType.FileUpload, HotkeyType.ClipboardUploadWithContentViewer, HotkeyType.None, HotkeyType.ScreenColorPicker };
|
||||
|
||||
public bool LockPosition { get; set; }
|
||||
|
||||
private IContainer components;
|
||||
private ToolStripEx tsMain;
|
||||
private ToolTip ttMain;
|
||||
|
@ -128,9 +130,16 @@ private void InitializeComponent()
|
|||
|
||||
ToolStripMenuItem tsmiLock = new ToolStripMenuItem("Lock position");
|
||||
tsmiLock.CheckOnClick = true;
|
||||
tsmiLock.Checked = true;
|
||||
tsmiLock.Checked = false;
|
||||
tsmiLock.Click += (sender, e) => LockPosition = tsmiLock.Checked;
|
||||
cmsTitle.Items.Add(tsmiLock);
|
||||
|
||||
ToolStripMenuItem tsmiTopMost = new ToolStripMenuItem("Stay top most");
|
||||
tsmiTopMost.CheckOnClick = true;
|
||||
tsmiTopMost.Checked = true;
|
||||
tsmiTopMost.Click += (sender, e) => TopMost = tsmiTopMost.Checked;
|
||||
cmsTitle.Items.Add(tsmiTopMost);
|
||||
|
||||
UpdateToolbar(Actions);
|
||||
|
||||
ResumeLayout(false);
|
||||
|
@ -245,7 +254,7 @@ private void tslTitle_MouseLeave(object sender, EventArgs e)
|
|||
|
||||
private void tslTitle_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left)
|
||||
if (e.Button == MouseButtons.Left && !LockPosition)
|
||||
{
|
||||
NativeMethods.ReleaseCapture();
|
||||
NativeMethods.DefWindowProc(Handle, (uint)WindowsMessages.SYSCOMMAND, (UIntPtr)NativeConstants.MOUSE_MOVE, IntPtr.Zero);
|
||||
|
|
Loading…
Reference in a new issue