2026-01-18 10:10:53 +00:00
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
|
|
|
|
using Flow.Launcher.Infrastructure.UserSettings;
|
|
|
|
|
using Flow.Launcher.Avalonia.Helper;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Flow.Launcher.Avalonia.ViewModel.SettingPages;
|
|
|
|
|
|
|
|
|
|
public partial class HotkeySettingsViewModel : ObservableObject
|
|
|
|
|
{
|
|
|
|
|
private readonly Settings _settings;
|
|
|
|
|
|
|
|
|
|
public HotkeySettingsViewModel()
|
|
|
|
|
{
|
|
|
|
|
_settings = Ioc.Default.GetRequiredService<Settings>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string ToggleHotkey
|
|
|
|
|
{
|
|
|
|
|
get => _settings.Hotkey;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (_settings.Hotkey != value)
|
|
|
|
|
{
|
|
|
|
|
_settings.Hotkey = value;
|
|
|
|
|
HotKeyMapper.SetToggleHotkey(value);
|
|
|
|
|
OnPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-04 17:41:28 +00:00
|
|
|
|
|
|
|
|
public string PreviewHotkey
|
|
|
|
|
{
|
|
|
|
|
get => _settings.PreviewHotkey;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (_settings.PreviewHotkey != value)
|
|
|
|
|
{
|
|
|
|
|
_settings.PreviewHotkey = value;
|
|
|
|
|
OnPropertyChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-01-18 10:10:53 +00:00
|
|
|
}
|