mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
- Update ISettingProvider to support CreateSettingPanelAvalonia - Create native Avalonia settings UI for Program Plugin (ProgramSetting.axaml) - Implement ProgramSettingViewModel using CommunityToolkit.Mvvm - Update PluginsSettingsViewModel to detect and load native Avalonia settings - Replace ListBox with ItemsControl in PluginsSettingsPage to fix auto-scroll issues when expanding settings - Align Avalonia package versions (11.2.3) across projects to fix type load errors
66 lines
3.9 KiB
XML
66 lines
3.9 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
|
xmlns:vm="using:Flow.Launcher.Avalonia.ViewModel.SettingPages"
|
|
xmlns:i18n="using:Flow.Launcher.Avalonia.Resource"
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600"
|
|
x:Class="Flow.Launcher.Avalonia.Views.SettingPages.PluginsSettingsPage"
|
|
x:DataType="vm:PluginsSettingsViewModel">
|
|
|
|
<Grid RowDefinitions="Auto,Auto,*">
|
|
<TextBlock Grid.Row="0" Text="{i18n:Localize plugin}" FontSize="28" FontWeight="SemiBold" Margin="0,0,0,10" />
|
|
|
|
<TextBox Grid.Row="1"
|
|
Text="{Binding SearchText, Mode=TwoWay}"
|
|
Watermark="{i18n:Localize search}"
|
|
Margin="0,0,0,20" />
|
|
|
|
<ScrollViewer Grid.Row="2">
|
|
<ItemsControl ItemsSource="{Binding FilteredPlugins}"
|
|
Background="Transparent">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:PluginItemViewModel">
|
|
<StackPanel Spacing="5" Margin="0,0,10,0">
|
|
<Grid ColumnDefinitions="Auto,*,Auto" Margin="0,5">
|
|
<Image Grid.Column="0" Source="{Binding IconPath}" Width="32" Height="32" Margin="0,0,15,0" VerticalAlignment="Center" />
|
|
|
|
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
|
<TextBlock Text="{Binding Name}" FontWeight="Bold" />
|
|
<TextBlock Text="{Binding Version}" Foreground="Gray" FontSize="12" VerticalAlignment="Bottom" />
|
|
</StackPanel>
|
|
<TextBlock Text="{Binding Description}" Foreground="Gray" FontSize="12" TextWrapping="Wrap" />
|
|
<TextBlock Text="{Binding Author}" Foreground="LightGray" FontSize="11" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="10" VerticalAlignment="Center">
|
|
<Button Command="{Binding OpenSettingsCommand}"
|
|
IsVisible="{Binding HasSettings}"
|
|
ToolTip.Tip="Settings">
|
|
<ui:SymbolIcon Symbol="Settings" />
|
|
</Button>
|
|
|
|
<ToggleSwitch IsChecked="{Binding !IsDisabled}"
|
|
OnContent="" OffContent="" />
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<!-- Native Avalonia Settings Panel -->
|
|
<Border IsVisible="{Binding IsExpanded}"
|
|
Background="{DynamicResource SolidBackgroundFillColorBase}"
|
|
BorderBrush="{DynamicResource ControlElevationBorderBrush}"
|
|
BorderThickness="1"
|
|
CornerRadius="4"
|
|
Padding="10"
|
|
Margin="48,0,0,10">
|
|
<ContentControl Content="{Binding AvaloniaSettingControl}" />
|
|
</Border>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
</UserControl>
|