mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
- Add PluginStoreSettingsPage with header, language filters, and search - Add PluginStoreSettingsViewModel with async loading and filtering - Add PluginStoreItemViewModel for individual plugin cards with install/update/uninstall - Connect AvaloniaPublicAPI to real PluginsManifest instead of empty stubs - Use FluentAvalonia ItemsRepeater with UniformGridLayout for virtualization - Fix icon visibility using ObjectConverters instead of StringConverters
47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using Avalonia.Controls;
|
|
using FluentAvalonia.UI.Controls;
|
|
using Flow.Launcher.Avalonia.ViewModel.SettingPages;
|
|
using System;
|
|
|
|
namespace Flow.Launcher.Avalonia.Views.SettingPages;
|
|
|
|
public partial class SettingsWindow : Window
|
|
{
|
|
public SettingsWindow()
|
|
{
|
|
InitializeComponent();
|
|
|
|
NavView.SelectionChanged += NavView_SelectionChanged;
|
|
|
|
// Load default page
|
|
LoadPage("General");
|
|
}
|
|
|
|
private void NavView_SelectionChanged(object? sender, NavigationViewSelectionChangedEventArgs e)
|
|
{
|
|
if (e.SelectedItem is NavigationViewItem item && item.Tag is string tag)
|
|
{
|
|
LoadPage(tag);
|
|
}
|
|
}
|
|
|
|
private void LoadPage(string tag)
|
|
{
|
|
Control? page = tag switch
|
|
{
|
|
"General" => new GeneralSettingsPage(),
|
|
"Plugins" => new PluginsSettingsPage(),
|
|
"PluginStore" => new PluginStoreSettingsPage(),
|
|
"Theme" => new ThemeSettingsPage(),
|
|
"Hotkey" => new HotkeySettingsPage(),
|
|
"Proxy" => new ProxySettingsPage(),
|
|
"About" => new AboutSettingsPage(),
|
|
_ => new TextBlock { Text = $"Page {tag} not implemented yet", HorizontalAlignment = global::Avalonia.Layout.HorizontalAlignment.Center, VerticalAlignment = global::Avalonia.Layout.VerticalAlignment.Center }
|
|
};
|
|
|
|
if (page != null)
|
|
{
|
|
ContentFrame.Content = page;
|
|
}
|
|
}
|
|
}
|