added tray menu

This commit is contained in:
2026-08-12 04:59:22 +05:00
parent 08192d317e
commit a0d3098fe4
21 changed files with 1327 additions and 42 deletions
+29 -1
View File
@@ -31,13 +31,41 @@ neither delivers keystrokes to the low-level hook nor accepts the layout change
request, so the hotkey does nothing there. Reading the layout of a foreign window
is not restricted, so the tooltip itself keeps working everywhere.
## The tray
The app works in the background and lives in the notification area. The settings
window is a guest on the screen rather than the app itself: it shows up after the
installation and whenever the icon or its menu is asked for. Both buttons in its
title bar — minimise and close — put the window away into the tray and end nothing;
the way out of the app is the Exit item of the tray menu.
The window is hidden rather than closed. Closing it would take its handle with it,
and everything hung on the window — the theme, the place it was left in, the
computed layout — would have to be built anew on every show.
The menu of the icon is a WPF one rather than a system one: that way it keeps to
the theme and the language chosen in the settings, like the rest of the interface.
Started by Windows itself, the app shows no window at all and goes straight to the
tray — the user asked for it to be there when they sign in, not for a window to
greet them every morning. The two builds tell such a launch apart differently: the
registry entry of an unpacked build carries the `--startup` argument, while a
package has no say in its command line, and Windows is asked about the activation
instead.
Should Windows refuse the icon — there is no notification area in a session without
a desktop — the window takes its usual duties back: it shows up whatever the launch
was, and closing it ends the app. The alternative would be an app the user can
neither see nor quit.
## Startup
Startup is switched on from the app's settings by whichever means the build has.
A package declares it in the manifest as a `windows.startupTask`. A build unpacked
into a folder registers itself the way desktop programs always have — under
`HKCU\Software\Microsoft\Windows\CurrentVersion\Run`, which needs no administrator
rights.
rights. The command written there ends with `--startup`: that is how the app tells
a launch of Windows' own doing from a launch by the user.
Either way Windows lists the app in Settings — Apps — Startup; if the user turns
it off there, the app can no longer turn it back on and says so instead of