v26: drop files onto app icons, settings window

This commit is contained in:
2026-11-07 15:42:49 +00:00
parent 807befdd53
commit c94e74451f
4 changed files with 369 additions and 0 deletions
+13
View File
@@ -859,6 +859,7 @@ func showMenu(hwnd uintptr, appIdx int, trayKind int) {
addTrayMenu(add, sep, trayKind)
}
add(0, menuSettingsID, "MirrorBar settings...")
add(0, menuNotifyID, "Open notification center")
sep()
for i, l := range alphaLevels {
@@ -934,6 +935,8 @@ func showMenu(hwnd uintptr, appIdx int, trayKind int) {
unpinApp(exe)
refreshApps(false)
redraw(hwnd)
case cmd == menuSettingsID:
openSettings()
case cmd == menuNotifyID:
openNotifications()
case cmd == menuFileLocID && exe != "":
@@ -950,6 +953,7 @@ func showMenu(hwnd uintptr, appIdx int, trayKind int) {
saveAlpha()
redraw(hwnd)
}
settingsSync()
}
func wndProc(hwnd, m, wparam, lparam uintptr) (result uintptr) {
@@ -1120,6 +1124,9 @@ func wndProc(hwnd, m, wparam, lparam uintptr) (result uintptr) {
showMenu(hwnd, appIndexAt(hwnd, x), trayAt(hwnd, x))
previewBlock(false)
return 0
case wmDropFiles:
dropFiles(hwnd, wparam)
return 0
case wmMouseWheel:
// Scrolling over the volume icon changes the volume. The wheel
// position arrives in screen coordinates, so make it relative to the bar.
@@ -1290,6 +1297,7 @@ func main() {
}
hwndMain = hwnd
previewInit(inst)
enableFileDrop(hwnd)
refreshAutostartPath()
// Hotkey: Ctrl+Alt+Q exits and restores.
@@ -1324,6 +1332,11 @@ func main() {
if int32(r) <= 0 {
break
}
if hwndSettings != 0 {
if handled, _, _ := pIsDialogMessage.Call(hwndSettings, uintptr(unsafe.Pointer(&m))); handled != 0 {
continue
}
}
pTranslateMessage.Call(uintptr(unsafe.Pointer(&m)))
pDispatchMessage.Call(uintptr(unsafe.Pointer(&m)))
}