Skip to content

Commit

Permalink
[Feature] Option to only single click instead double click (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofknecht committed Aug 6, 2020
1 parent fed20a5 commit 3846c09
Showing 1 changed file with 32 additions and 19 deletions.
51 changes: 32 additions & 19 deletions DataClasses/RowData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,41 @@ internal void MouseDown(DataGridView dgv, MouseEventArgs e)
IsContextMenuOpen = false;
contextMenuClosed = DateTime.Now;
}

if (Properties.Settings.Default.OpenItemWithOneClick)
{
OpenItem(e);
}
}

internal void DoubleClick(MouseEventArgs e)
{
if (!Properties.Settings.Default.OpenItemWithOneClick)
{
OpenItem(e);
}

if (ContainsMenu &&
(e == null || e.Button == MouseButtons.Left))
{
Log.ProcessStart("explorer.exe", TargetFilePath, true);
}
}

protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
if (diposeIcon)
{
icon?.Dispose();
}
}

isDisposed = true;
}

private void OpenItem(MouseEventArgs e)
{
if (!ContainsMenu &&
(e == null || e.Button == MouseButtons.Left))
Expand All @@ -227,25 +259,6 @@ internal void DoubleClick(MouseEventArgs e)
MessageBox.Show(ex.Message);
}
}

if (ContainsMenu &&
(e == null || e.Button == MouseButtons.Left))
{
Log.ProcessStart("explorer.exe", TargetFilePath, true);
}
}

protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
if (diposeIcon)
{
icon?.Dispose();
}
}

isDisposed = true;
}

private bool SetLnk(
Expand Down

0 comments on commit 3846c09

Please sign in to comment.