mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
- Add i18n injection to Application.Resources for DynamicResource bindings - Create Avalonia settings views for plugins: - Explorer (ExplorerSettings + QuickAccessLinkSettings dialog) - BrowserBookmark (SettingsControl + CustomBrowserSettingWindow) - Calculator (CalculatorSettings) - ProcessKiller (SettingsControl) - PluginsManager (PluginsManagerSettings) - WebSearch (SettingsControl) - Shell (ShellSetting + converter) - Program (ProgramSetting) - Add IsAvalonia detection pattern for dual-framework dialog support - Update 11 plugin .csproj files with CopyToAvaloniaOutput targets - Add System.Threading.Tasks using for async RelayCommand support
58 lines
No EOL
1.4 KiB
C#
58 lines
No EOL
1.4 KiB
C#
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Markup.Xaml;
|
|
using Avalonia.Platform.Storage;
|
|
using Flow.Launcher.Plugin.BrowserBookmark.Models;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Flow.Launcher.Plugin.BrowserBookmark.Views.Avalonia;
|
|
|
|
public partial class CustomBrowserSettingWindow : Window
|
|
{
|
|
public CustomBrowserSettingWindow(CustomBrowser browser)
|
|
{
|
|
InitializeComponent();
|
|
DataContext = browser;
|
|
}
|
|
|
|
public CustomBrowserSettingWindow()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
private void OnCancelClick(object sender, RoutedEventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private void OnDoneClick(object sender, RoutedEventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private async void OnBrowseClick(object sender, RoutedEventArgs e)
|
|
{
|
|
var topLevel = TopLevel.GetTopLevel(this);
|
|
if (topLevel == null) return;
|
|
|
|
var folders = await topLevel.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
|
{
|
|
Title = "Select Bookmark Data Directory",
|
|
AllowMultiple = false
|
|
});
|
|
|
|
if (folders.Count > 0)
|
|
{
|
|
if (DataContext is CustomBrowser browser)
|
|
{
|
|
browser.DataDirectoryPath = folders[0].Path.LocalPath;
|
|
}
|
|
}
|
|
}
|
|
} |