Skip to content

Commit

Permalink
[Feature] When Tab to previous menu or press enter, select all text i…
Browse files Browse the repository at this point in the history
…n search (#228), version 1.0.25.0
  • Loading branch information
Hofknecht committed Nov 1, 2021
1 parent 3ec6633 commit bc28997
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
6 changes: 2 additions & 4 deletions DataClasses/RowData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ private void OpenItem(MouseEventArgs e, ref bool toCloseByOpenItem)
}
}

private bool SetLnk(
ref bool isLnkDirectory,
ref string resolvedLnkPath)
private bool SetLnk(ref bool isLnkDirectory, ref string resolvedLnkPath)
{
bool handled = false;
resolvedLnkPath = FileLnk.GetResolvedFileName(TargetFilePath);
Expand Down Expand Up @@ -306,7 +304,7 @@ private bool SetUrl()
handled = true;
}
}
else if (System.IO.File.Exists(iconFile))
else if (File.Exists(iconFile))
{
FilePathIcon = iconFile;
icon = IconReader.GetFileIconWithCache(FilePathIcon, true, true, out bool loading);
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.24.4")]
[assembly: AssemblyFileVersion("1.0.24.4")]
[assembly: AssemblyVersion("1.0.25.0")]
[assembly: AssemblyFileVersion("1.0.25.0")]
11 changes: 5 additions & 6 deletions UserInterface/Menu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ void Fading_Show()
if (Level == 0)
{
Activate();
textBoxSearch.SelectAll();
textBoxSearch.Focus();
NativeMethods.User32ShowInactiveTopmost(this);
NativeMethods.ForceForegroundWindow(Handle);
}
else
{
NativeMethods.User32ShowInactiveTopmost(this);
textBoxSearch.SelectAll();
textBoxSearch.Focus();
}
}
Expand Down Expand Up @@ -116,11 +118,8 @@ void Fading_Show()
BackColor = backColor,
};

customScrollbar.GotFocus += CustomScrollbar_GotFocus;
void CustomScrollbar_GotFocus(object sender, EventArgs e)
{
textBoxSearch.Focus();
}
dgv.GotFocus += (sender, e) => FocusTextBox();
customScrollbar.GotFocus += (sender, e) => FocusTextBox();

customScrollbar.Margin = new Padding(0);
customScrollbar.Scroll += CustomScrollbar_Scroll;
Expand Down Expand Up @@ -170,7 +169,6 @@ void ControlsMouseLeave(object sender, EventArgs e)
AllowDrop = true;
DragEnter += DragDropHelper.DragEnter;
DragDrop += DragDropHelper.DragDrop;
textBoxSearch.GotFocus += (sender, e) => textBoxSearch.SelectAll();
}

internal new event EventHandlerEmpty MouseWheel;
Expand Down Expand Up @@ -222,6 +220,7 @@ protected override CreateParams CreateParams

internal void FocusTextBox()
{
textBoxSearch.SelectAll();
textBoxSearch.Focus();
}

Expand Down
10 changes: 5 additions & 5 deletions Utilities/File/FileIni.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public class FileIni
public FileIni(string path)
{
values = File.ReadLines(path)
.Where(line => !string.IsNullOrWhiteSpace(line) &&
!line.StartsWith("#", System.StringComparison.InvariantCulture))
.Select(line => line.Split(new char[] { '=' }, 2, 0))
.ToDictionary(parts => parts[0].Trim(), parts =>
parts.Length > 1 ? parts[1].Trim() : null);
.Where(line => !string.IsNullOrWhiteSpace(line) &&
!line.StartsWith("#", System.StringComparison.InvariantCulture))
.Select(line => line.Split(new char[] { '=' }, 2, 0))
.ToDictionary(parts => parts[0].Trim(), parts =>
parts.Length > 1 ? parts[1].Trim() : null);
}

public string Value(string name, string value = null)
Expand Down

0 comments on commit bc28997

Please sign in to comment.