Skip to content

Commit d9d92c6

Browse files
committed
Clean up codes
1 parent 18ab03b commit d9d92c6

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ public bool HideNotifyIcon
297297
[JsonIgnore]
298298
public bool WMPInstalled { get; set; } = true;
299299

300+
public bool SelectAllQueryOnReopen { get; set; } = true;
300301

301302
// This needs to be loaded last by staying at the bottom
302303
public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();

Flow.Launcher/MainWindow.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
Closing="OnClosing"
2121
Deactivated="OnDeactivated"
2222
Icon="Images/app.png"
23-
SourceInitialized="OnSourceInitialized"
2423
Initialized="OnInitialized"
2524
Left="{Binding Settings.WindowLeft, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
2625
Loaded="OnLoaded"
@@ -31,6 +30,7 @@
3130
ResizeMode="CanResize"
3231
ShowInTaskbar="False"
3332
SizeToContent="Height"
33+
SourceInitialized="OnSourceInitialized"
3434
Topmost="True"
3535
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
3636
WindowStartupLocation="Manual"
@@ -240,13 +240,13 @@
240240
FontSize="{Binding QueryBoxFontSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
241241
InputMethod.PreferredImeConversionMode="{Binding StartWithEnglishMode, Converter={StaticResource BoolToIMEConversionModeConverter}}"
242242
InputMethod.PreferredImeState="{Binding StartWithEnglishMode, Converter={StaticResource BoolToIMEStateConverter}}"
243+
Loaded="SelectAllQueryText"
243244
PreviewDragOver="OnPreviewDragOver"
244245
PreviewKeyUp="QueryTextBox_KeyUp"
245246
Style="{DynamicResource QueryBoxStyle}"
246247
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
247248
Visibility="Visible"
248-
WindowChrome.IsHitTestVisibleInChrome="True"
249-
Loaded="SelectAllQueryText">
249+
WindowChrome.IsHitTestVisibleInChrome="True">
250250
<TextBox.CommandBindings>
251251
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />
252252
</TextBox.CommandBindings>

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public SettingsPaneGeneralViewModel(Settings settings, Updater updater, IPortabl
2424
_updater = updater;
2525
_portable = portable;
2626
UpdateEnumDropdownLocalizations();
27-
SelectAllQueryOnReopen = settings.SelectAllQueryOnReopen; // Pfa33
2827
}
2928

3029
public class SearchWindowScreenData : DropdownDataGeneric<SearchWindowScreens> { }
@@ -65,12 +64,6 @@ public bool StartFlowLauncherOnSystemStartup
6564
}
6665
}
6766

68-
public bool SelectAllQueryOnReopen
69-
{
70-
get => Settings.SelectAllQueryOnReopen;
71-
set => Settings.SelectAllQueryOnReopen = value;
72-
}
73-
7467
public bool UseLogonTaskForStartup
7568
{
7669
get => Settings.UseLogonTaskForStartup;

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ private void OnLoaded(object sender, RoutedEventArgs e)
4747
hwndTarget.RenderMode = RenderMode.SoftwareOnly; // Must use software only render mode here
4848

4949
InitializePosition();
50-
51-
// Initialize the new checkbox based on the settings
52-
var selectAllQueryOnReopenCheckbox = (System.Windows.Controls.CheckBox)FindName("SelectAllQueryOnReopenCheckbox");
53-
if (selectAllQueryOnReopenCheckbox != null)
54-
{
55-
selectAllQueryOnReopenCheckbox.IsChecked = _settings.SelectAllQueryOnReopen;
56-
}
5750
}
5851

5952
private void OnClosed(object sender, EventArgs e)

0 commit comments

Comments
 (0)