Programs are configured in Settings → Custom tiles and stored in ui.config.json. A tile with a fixed folder starts on click; without one it offers a submenu of home, the list folders and browse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
914 B
C#
31 lines
914 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Platform.Storage;
|
|
using ClaudeDo.Ui.ViewModels.Modals;
|
|
using ClaudeDo.Ui.ViewModels.Modals.Settings;
|
|
|
|
namespace ClaudeDo.Ui.Views.Modals;
|
|
|
|
public partial class SettingsModalView : Window
|
|
{
|
|
public SettingsModalView()
|
|
{
|
|
InitializeComponent();
|
|
|
|
}
|
|
|
|
protected override void OnDataContextChanged(EventArgs e)
|
|
{
|
|
base.OnDataContextChanged(e);
|
|
if (DataContext is SettingsModalViewModel vm)
|
|
vm.CloseAction = Close;
|
|
}
|
|
|
|
private async void OnPickCustomTileFolder(object? sender, RoutedEventArgs e)
|
|
{
|
|
if ((sender as Control)?.DataContext is not CustomTileRowViewModel row) return;
|
|
var folders = await StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions { AllowMultiple = false });
|
|
if (folders.Count > 0) row.Folder = folders[0].Path.LocalPath;
|
|
}
|
|
}
|