mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
- Add HotkeyRecorderDialog with global keyboard hook for capturing hotkeys - Implement manual modifier state tracking to handle swallowed key events - Add HotkeyControl button that opens the recorder dialog - Add CheckAvailability and RemoveToggleHotkey to HotKeyMapper - Expose GetKeyFromVk helper in GlobalHotkey infrastructure - Add Settings pages (General, Plugin, Theme, Proxy, About) - Add PreviewPanel for result previews in main window - Fix hook reuse issue by clearing callback on close instead of disposing
81 lines
1.8 KiB
C#
81 lines
1.8 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
|
using Flow.Launcher.Infrastructure.UserSettings;
|
|
using System;
|
|
|
|
namespace Flow.Launcher.Avalonia.ViewModel.SettingPages;
|
|
|
|
public partial class ProxySettingsViewModel : ObservableObject
|
|
{
|
|
private readonly Settings _settings;
|
|
|
|
public ProxySettingsViewModel()
|
|
{
|
|
_settings = Ioc.Default.GetRequiredService<Settings>();
|
|
}
|
|
|
|
public bool ProxyEnabled
|
|
{
|
|
get => _settings.Proxy.Enabled;
|
|
set
|
|
{
|
|
if (_settings.Proxy.Enabled != value)
|
|
{
|
|
_settings.Proxy.Enabled = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
public string ProxyServer
|
|
{
|
|
get => _settings.Proxy.Server;
|
|
set
|
|
{
|
|
if (_settings.Proxy.Server != value)
|
|
{
|
|
_settings.Proxy.Server = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
public int ProxyPort
|
|
{
|
|
get => _settings.Proxy.Port;
|
|
set
|
|
{
|
|
if (_settings.Proxy.Port != value)
|
|
{
|
|
_settings.Proxy.Port = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
public string ProxyUserName
|
|
{
|
|
get => _settings.Proxy.UserName;
|
|
set
|
|
{
|
|
if (_settings.Proxy.UserName != value)
|
|
{
|
|
_settings.Proxy.UserName = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
public string ProxyPassword
|
|
{
|
|
get => _settings.Proxy.Password;
|
|
set
|
|
{
|
|
if (_settings.Proxy.Password != value)
|
|
{
|
|
_settings.Proxy.Password = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
}
|