Clean up codes

This commit is contained in:
Jack251970 2025-03-13 15:05:41 +08:00
parent 18ab03bd2c
commit d9d92c61ce
4 changed files with 4 additions and 17 deletions

View file

@ -297,6 +297,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
[JsonIgnore]
public bool WMPInstalled { get; set; } = true;
public bool SelectAllQueryOnReopen { get; set; } = true;
// This needs to be loaded last by staying at the bottom
public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();

View file

@ -20,7 +20,6 @@
Closing="OnClosing"
Deactivated="OnDeactivated"
Icon="Images/app.png"
SourceInitialized="OnSourceInitialized"
Initialized="OnInitialized"
Left="{Binding Settings.WindowLeft, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Loaded="OnLoaded"
@ -31,6 +30,7 @@
ResizeMode="CanResize"
ShowInTaskbar="False"
SizeToContent="Height"
SourceInitialized="OnSourceInitialized"
Topmost="True"
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
WindowStartupLocation="Manual"
@ -240,13 +240,13 @@
FontSize="{Binding QueryBoxFontSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
InputMethod.PreferredImeConversionMode="{Binding StartWithEnglishMode, Converter={StaticResource BoolToIMEConversionModeConverter}}"
InputMethod.PreferredImeState="{Binding StartWithEnglishMode, Converter={StaticResource BoolToIMEStateConverter}}"
Loaded="SelectAllQueryText"
PreviewDragOver="OnPreviewDragOver"
PreviewKeyUp="QueryTextBox_KeyUp"
Style="{DynamicResource QueryBoxStyle}"
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Visibility="Visible"
WindowChrome.IsHitTestVisibleInChrome="True"
Loaded="SelectAllQueryText">
WindowChrome.IsHitTestVisibleInChrome="True">
<TextBox.CommandBindings>
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />
</TextBox.CommandBindings>

View file

@ -24,7 +24,6 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
_updater = updater;
_portable = portable;
UpdateEnumDropdownLocalizations();
SelectAllQueryOnReopen = settings.SelectAllQueryOnReopen; // Pfa33
}
public class SearchWindowScreenData : DropdownDataGeneric<SearchWindowScreens> { }
@ -65,12 +64,6 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
}
}
public bool SelectAllQueryOnReopen
{
get => Settings.SelectAllQueryOnReopen;
set => Settings.SelectAllQueryOnReopen = value;
}
public bool UseLogonTaskForStartup
{
get => Settings.UseLogonTaskForStartup;

View file

@ -47,13 +47,6 @@ public partial class SettingWindow
hwndTarget.RenderMode = RenderMode.SoftwareOnly; // Must use software only render mode here
InitializePosition();
// Initialize the new checkbox based on the settings
var selectAllQueryOnReopenCheckbox = (System.Windows.Controls.CheckBox)FindName("SelectAllQueryOnReopenCheckbox");
if (selectAllQueryOnReopenCheckbox != null)
{
selectAllQueryOnReopenCheckbox.IsChecked = _settings.SelectAllQueryOnReopen;
}
}
private void OnClosed(object sender, EventArgs e)