mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 13:28:33 +00:00
Plugin Settings - When searching, search in plugin and features
Plugin Settings - Never scroll inside feature list, just show everything if a plugin has many features
This commit is contained in:
parent
37b8c2c3e9
commit
10a10b9149
@ -95,5 +95,16 @@ public class PluginFeatureInfo : IPrerequisitesSubject
|
|||||||
return Instance?.Id ?? "Uninitialized feature";
|
return Instance?.Id ?? "Uninitialized feature";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a boolean indicating whether this feature info matches the provided search string
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="search">The search string to match</param>
|
||||||
|
/// <returns>A boolean indicating whether this plugin info matches the provided search string</returns>
|
||||||
|
public bool MatchesSearch(string search)
|
||||||
|
{
|
||||||
|
return Name.Contains(search, StringComparison.InvariantCultureIgnoreCase) ||
|
||||||
|
(Description != null && Description.Contains(search, StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
}
|
||||||
|
|
||||||
internal PluginFeatureEntity Entity { get; }
|
internal PluginFeatureEntity Entity { get; }
|
||||||
}
|
}
|
||||||
@ -155,19 +155,30 @@ public class PluginInfo : IPrerequisitesSubject
|
|||||||
{
|
{
|
||||||
return PlatformPrerequisites.All(p => p.IsMet());
|
return PlatformPrerequisites.All(p => p.IsMet());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return $"{Name} v{Version} - {Guid}";
|
return $"{Name} v{Version} - {Guid}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool MatchesMinimumVersion()
|
private bool MatchesMinimumVersion()
|
||||||
{
|
{
|
||||||
if (Constants.CurrentVersion == "local")
|
if (Constants.CurrentVersion == "local")
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
Version currentVersion = new(Constants.CurrentVersion);
|
Version currentVersion = new(Constants.CurrentVersion);
|
||||||
return currentVersion >= MinimumVersion;
|
return currentVersion >= MinimumVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a boolean indicating whether this plugin info matches the provided search string
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="search">The search string to match</param>
|
||||||
|
/// <returns>A boolean indicating whether this plugin info matches the provided search string</returns>
|
||||||
|
public bool MatchesSearch(string search)
|
||||||
|
{
|
||||||
|
return Name.Contains(search, StringComparison.InvariantCultureIgnoreCase) ||
|
||||||
|
(Description != null && Description.Contains(search, StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<Border Grid.Column="1" BorderBrush="{DynamicResource ButtonBorderBrush}" BorderThickness="1 0 0 0" Margin="10 0 0 0" Padding="10 0 0 0">
|
<Border Grid.Column="1" BorderBrush="{DynamicResource ButtonBorderBrush}" BorderThickness="1 0 0 0" Margin="10 0 0 0" Padding="10 0 0 0">
|
||||||
<Grid RowDefinitions="Auto,*">
|
<Grid RowDefinitions="Auto,*">
|
||||||
<TextBlock Classes="h5">Plugin features</TextBlock>
|
<TextBlock Classes="h5">Plugin features</TextBlock>
|
||||||
<ListBox Grid.Row="1" MaxHeight="135" ItemsSource="{CompiledBinding PluginFeatures}" />
|
<ListBox Grid.Row="1" ItemsSource="{CompiledBinding PluginFeatures}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate x:DataType="plugins:PluginSettingsViewModel">
|
<DataTemplate x:DataType="plugins:PluginSettingsViewModel">
|
||||||
<ContentControl Content="{CompiledBinding}" Height="200" />
|
<ContentControl Content="{CompiledBinding}" MinHeight="200" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
|
|||||||
@ -112,8 +112,7 @@ public partial class PluginsTabViewModel : RoutableScreen
|
|||||||
if (string.IsNullOrWhiteSpace(text))
|
if (string.IsNullOrWhiteSpace(text))
|
||||||
return _ => true;
|
return _ => true;
|
||||||
|
|
||||||
return data => data.Info.Name.Contains(text, StringComparison.InvariantCultureIgnoreCase) ||
|
return data => data.Info.MatchesSearch(text) || data.Features.Any(f => f.MatchesSearch(text));
|
||||||
(data.Info.Description != null && data.Info.Description.Contains(text, StringComparison.InvariantCultureIgnoreCase));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task GetMorePlugins()
|
public async Task GetMorePlugins()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user