feat: implement cross-platform hotkey management and update frontend build infrastructure

This commit is contained in:
jahruz67
2026-05-08 15:54:36 -07:00
parent 25ab3accfa
commit 0cd56ca083
24 changed files with 453 additions and 325 deletions
+17 -3
View File
@@ -28,8 +28,12 @@ type App interface {
Quit()
GetConfig() *config.Config
ShowSettings()
Version() string
}
// trayLabel is the short product name shown in the tray (includes version when set at link time).
var trayLabel = "wis-free-v3"
// Menu item references for dynamic updates
var statusMenuItem *systray.MenuItem
@@ -42,11 +46,21 @@ func Start(app App) {
)
}
func appDisplayName(app App) string {
v := app.Version()
if v != "" && v != "dev" {
return "wis-free-v3 v" + v
}
return "wis-free-v3"
}
// onReady is called when the system tray is ready to be configured.
func onReady(app App) {
trayLabel = appDisplayName(app)
// Configure tray icon and tooltip
systray.SetIcon(iconData)
systray.SetTitle("wis-free-v3")
systray.SetTitle(trayLabel)
systray.SetTooltip(buildTooltip(app))
// Build menu structure
@@ -119,14 +133,14 @@ func buildTooltip(app App) string {
if cfg := app.GetConfig(); cfg != nil && cfg.Shortcut != "" {
shortcut = cfg.Shortcut
}
return "wis-free-v3 - " + shortcut + " to record"
return trayLabel + " - " + shortcut + " to record"
}
// UpdateStatus updates the status text displayed in the tray menu.
func UpdateStatus(status string) {
if statusMenuItem != nil {
statusMenuItem.SetTitle("Status: " + status)
systray.SetTooltip("wis-free-v3 - " + status)
systray.SetTooltip(trayLabel + " - " + status)
if strings.Contains(status, "Recording") {
systray.SetIcon(iconRecordingData)