Skip to content

Commit 8ae53a2

Browse files
authored
Merge pull request #3260 from Jack251970/blank_settings_panel
Remove Useless Separate Line for Blank Settings Panel
2 parents 1a54eed + c472239 commit 8ae53a2

File tree

6 files changed

+3
-47
lines changed

6 files changed

+3
-47
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void Save()
112112
public Control CreateSettingPanel()
113113
{
114114
if (Settings == null || Settings.Count == 0)
115-
return new();
115+
return null;
116116

117117
var settingWindow = new UserControl();
118118
var mainPanel = new Grid { Margin = settingPanelMargin, VerticalAlignment = VerticalAlignment.Center };

Flow.Launcher/ViewModel/PluginViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public bool IsExpanded
9090
private Control _bottomPart2;
9191
public Control BottomPart2 => IsExpanded ? _bottomPart2 ??= new InstalledPluginDisplayBottomData() : null;
9292

93-
public bool HasSettingControl => PluginPair.Plugin is ISettingProvider;
93+
public bool HasSettingControl => PluginPair.Plugin is ISettingProvider settingProvider && settingProvider.CreateSettingPanel() != null;
9494
public Control SettingControl
9595
=> IsExpanded
9696
? _settingControl

Plugins/Flow.Launcher.Plugin.Url/Flow.Launcher.Plugin.Url.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
</ItemGroup>
4343

4444
<ItemGroup>
45-
<ProjectReference Include="..\..\Flow.Launcher.Infrastructure\Flow.Launcher.Infrastructure.csproj" />
4645
<ProjectReference Include="..\..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
4746
</ItemGroup>
4847

Plugins/Flow.Launcher.Plugin.Url/Main.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Text.RegularExpressions;
4-
using System.Windows.Controls;
54

65
namespace Flow.Launcher.Plugin.Url
76
{
8-
public class Main : ISettingProvider,IPlugin, IPluginI18n
7+
public class Main : IPlugin, IPluginI18n
98
{
109
//based on https://gist.github.com/dperini/729294
1110
private const string urlPattern = "^" +
@@ -43,7 +42,6 @@ public class Main : ISettingProvider,IPlugin, IPluginI18n
4342
Regex reg = new Regex(urlPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase);
4443
private PluginInitContext context;
4544
private Settings _settings;
46-
4745

4846
public List<Result> Query(Query query)
4947
{
@@ -82,12 +80,6 @@ public List<Result> Query(Query query)
8280
return new List<Result>(0);
8381
}
8482

85-
86-
public Control CreateSettingPanel()
87-
{
88-
return new SettingsControl(context.API,_settings);
89-
}
90-
9183
public bool IsURL(string raw)
9284
{
9385
raw = raw.ToLower();

Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)