mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Merge branch 'master' into dev
This commit is contained in:
@@ -60,10 +60,7 @@ namespace Wox
|
||||
AutoStartup();
|
||||
AutoUpdates();
|
||||
|
||||
if (!_settings.HideOnStartup)
|
||||
{
|
||||
mainVM.MainWindowVisibility = Visibility.Visible;
|
||||
}
|
||||
mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Hidden : Visibility.Visible;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -102,7 +99,7 @@ namespace Wox
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// let exception throw as normal is better for Debug
|
||||
/// let exception throw as normal is better for Debug
|
||||
/// </summary>
|
||||
[Conditional("RELEASE")]
|
||||
private void RegisterDispatcherUnhandledException()
|
||||
@@ -113,7 +110,7 @@ namespace Wox
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// let exception throw as normal is better for Debug
|
||||
/// let exception throw as normal is better for Debug
|
||||
/// </summary>
|
||||
[Conditional("RELEASE")]
|
||||
private static void RegisterAppDomainExceptions()
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
Icon="Images\app.png"
|
||||
AllowsTransparency="True"
|
||||
Loaded="OnLoaded"
|
||||
Initialized="OnInitialized"
|
||||
Closing="OnClosing"
|
||||
Drop="OnDrop"
|
||||
SizeChanged="OnSizeChanged"
|
||||
|
||||
@@ -46,11 +46,16 @@ namespace Wox
|
||||
_viewModel.Save();
|
||||
}
|
||||
|
||||
private void OnInitialized(object sender, EventArgs e)
|
||||
{
|
||||
// show notify icon when wox is hided
|
||||
InitializeNotifyIcon();
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs _)
|
||||
{
|
||||
WindowIntelopHelper.DisableControlBox(this);
|
||||
ThemeManager.Instance.ChangeTheme(_settings.Theme);
|
||||
InitializeNotifyIcon();
|
||||
InitProgressbarAnimation();
|
||||
|
||||
_viewModel.PropertyChanged += (o, e) =>
|
||||
@@ -230,7 +235,11 @@ namespace Wox
|
||||
|
||||
private void OnTextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
QueryTextBox.CaretIndex = QueryTextBox.Text.Length;
|
||||
if (_viewModel.QueryTextCursorMovedToEnd)
|
||||
{
|
||||
QueryTextBox.CaretIndex = QueryTextBox.Text.Length;
|
||||
_viewModel.QueryTextCursorMovedToEnd = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,12 +36,12 @@ namespace Wox
|
||||
|
||||
public void ChangeQuery(string query, bool requery = false)
|
||||
{
|
||||
_mainVM.QueryText = query;
|
||||
_mainVM.ChangeQueryText(query);
|
||||
}
|
||||
|
||||
public void ChangeQueryText(string query, bool selectAll = false)
|
||||
{
|
||||
_mainVM.QueryText = query;
|
||||
_mainVM.ChangeQueryText(query);
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
|
||||
@@ -34,6 +34,10 @@ namespace Wox
|
||||
StringBuilder content = new StringBuilder();
|
||||
content.AppendLine($"Wox version: {Constant.Version}");
|
||||
content.AppendLine($"OS Version: {Environment.OSVersion.VersionString}");
|
||||
content.AppendLine($"IntPtr Length: {IntPtr.Size}");
|
||||
content.AppendLine($"x64: {Environment.Is64BitOperatingSystem}");
|
||||
content.AppendLine($"Python Path: {Constant.PythonPath}");
|
||||
content.AppendLine($"Everything SDK Path: {Constant.EverythingSDKPath}");
|
||||
content.AppendLine($"Date: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
|
||||
content.AppendLine("Exception:");
|
||||
content.AppendLine(exception.Source);
|
||||
|
||||
@@ -205,7 +205,19 @@ namespace Wox.ViewModel
|
||||
Query();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// we need move cursor to end when we manually changed query
|
||||
/// but we don't want to move cursor to end when query is updated from TextBox
|
||||
/// </summary>
|
||||
/// <param name="queryText"></param>
|
||||
public void ChangeQueryText(string queryText)
|
||||
{
|
||||
QueryTextCursorMovedToEnd = true;
|
||||
QueryText = queryText;
|
||||
}
|
||||
public bool QueryTextSelected { get; set; }
|
||||
public bool QueryTextCursorMovedToEnd { get; set; }
|
||||
|
||||
private ResultsViewModel _selectedResults;
|
||||
private ResultsViewModel SelectedResults
|
||||
@@ -218,7 +230,7 @@ namespace Wox.ViewModel
|
||||
{
|
||||
ContextMenu.Visbility = Visibility.Collapsed;
|
||||
History.Visbility = Visibility.Collapsed;
|
||||
QueryText = _queryTextBeforeLeaveResults;
|
||||
ChangeQueryText(_queryTextBeforeLeaveResults);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -325,7 +337,7 @@ namespace Wox.ViewModel
|
||||
Action = _ =>
|
||||
{
|
||||
SelectedResults = Results;
|
||||
QueryText = h.Query;
|
||||
ChangeQueryText(h.Query);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -547,7 +559,7 @@ namespace Wox.ViewModel
|
||||
{
|
||||
if (ShouldIgnoreHotkeys()) return;
|
||||
MainWindowVisibility = Visibility.Visible;
|
||||
QueryText = hotkey.ActionKeyword;
|
||||
ChangeQueryText(hotkey.ActionKeyword);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user