Improve code quality

This commit is contained in:
Jack251970 2025-04-24 20:24:02 +08:00
parent 8463304bd4
commit 82d97fd05a

View file

@ -113,7 +113,7 @@ namespace Flow.Launcher.Core.Plugin
// If can parse the default value to bool, use it, otherwise use false // If can parse the default value to bool, use it, otherwise use false
: value is string stringValue && bool.TryParse(stringValue, out var boolValueFromString) : value is string stringValue && bool.TryParse(stringValue, out var boolValueFromString)
&& boolValueFromString; && boolValueFromString;
checkBox.Dispatcher.Invoke(() =>checkBox.IsChecked = isChecked); checkBox.Dispatcher.Invoke(() => checkBox.IsChecked = isChecked);
break; break;
} }
} }
@ -154,8 +154,7 @@ namespace Flow.Launcher.Core.Plugin
public Control CreateSettingPanel() public Control CreateSettingPanel()
{ {
// No need to check if NeedCreateSettingPanel is true because CreateSettingPanel will only be called if it's true if (!NeedCreateSettingPanel()) return null;
// if (!NeedCreateSettingPanel()) return null;
// Create main grid with two columns (Column 1: Auto, Column 2: *) // Create main grid with two columns (Column 1: Auto, Column 2: *)
var mainPanel = new Grid { Margin = SettingPanelMargin, VerticalAlignment = VerticalAlignment.Center }; var mainPanel = new Grid { Margin = SettingPanelMargin, VerticalAlignment = VerticalAlignment.Center };