Upload via GUI (186 Dateien)

This commit is contained in:
2026-10-04 14:48:53 +00:00
parent c0b552ef39
commit 8efd5bc497
25 changed files with 2344 additions and 1015 deletions
+19 -1
View File
@@ -14,7 +14,7 @@ public partial class App : Application
private static Hotkey? _hotkey;
private static Hotkey? _peekHotkey;
private static Hotkey? _pagePrev, _pageNext;
private static Hotkey? _pagePrev, _pageNext, _quickSearch;
private static System.Windows.Threading.DispatcherTimer? _desktopTimer;
private static Watcher? _watcher;
private Mutex? _mutex;
@@ -65,6 +65,9 @@ public partial class App : Application
_pageNext = new Hotkey(hwnd, 0xB004);
_pageNext.Pressed += () => FenceManager.NextPage(1);
_pageNext.Register(Hotkey.ModWin | Hotkey.ModAlt, 0x27);
_quickSearch = new Hotkey(hwnd, 0xB005);
_quickSearch.Pressed += QuickSearch.Toggle;
ApplyQuickSearchHotkey();
TrayIcon = new Tray();
TrayIcon.Clicked += () => Win.ShowFromBackground();
@@ -110,6 +113,7 @@ public partial class App : Application
{
var s = AppSettings.Current;
if (Quitting) return;
PageScheduler.Tick();
// Nur lesen, wenn eine Funktion die Positionen braucht
if (s.DesktopTint is null && !s.DrawFences && !s.QuickHide) return;
try { DesktopIcons.RefreshCache(); } catch { /* Explorer gerade neu gestartet o. Ä. */ }
@@ -124,6 +128,7 @@ public partial class App : Application
else if (Commands.Value(args, "--snapshot") is { } snap) Win.RestoreSnapshotByName(snap);
else if (Commands.Has(args, "--toggle-desktop")) DesktopToggle.Toggle();
else if (Commands.Has(args, "--peek")) FenceManager.TogglePeek();
else if (Commands.Has(args, "--search")) QuickSearch.Toggle();
else if (Commands.Value(args, "--page") is { } page) SwitchPageByName(page);
else if (Commands.WantsWindow(args)) Win.ShowFromBackground();
}
@@ -138,6 +143,17 @@ public partial class App : Application
else TrayIcon?.Notify("Seite nicht gefunden", $"Es gibt keine Desktop-Seite „{page}“.");
}
public static bool QuickSearchRegistered { get; private set; }
/// <summary>Tastenkürzel der Schnellstart-Suche neu registrieren. false = von anderem Programm belegt.</summary>
public static bool ApplyQuickSearchHotkey()
{
if (_quickSearch is null) return false;
var s = AppSettings.Current;
if (!s.QuickSearchEnabled) { _quickSearch.Unregister(); return QuickSearchRegistered = true; }
return QuickSearchRegistered = _quickSearch.Register(s.QuickSearchModifiers, s.QuickSearchKey);
}
/// <summary>Tastenkürzel neu registrieren. false = von anderem Programm belegt.</summary>
public static bool ApplyHotkey()
{
@@ -172,6 +188,8 @@ public partial class App : Application
DesktopToggle.RestoreOnExit();
_peekHotkey?.Dispose();
_pagePrev?.Dispose();
_quickSearch?.Dispose();
Usage.Flush();
_pageNext?.Dispose();
Win?.Undo.FlushAll();
FenceManager.CloseAll();