MirrorBar Plus 13: Claude and Grok flyout, clipboard history button, mp3 player
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JW57Zw8fvgzpeDkbUYT7sG
This commit is contained in:
@@ -23,8 +23,11 @@ const (
|
||||
trayWeather // added after the others so saved orders from older versions still mean the same thing
|
||||
trayNews
|
||||
traySys
|
||||
trayGM // Google Messages
|
||||
trayGM // Google Messages
|
||||
trayEmoji // the emoji panel button
|
||||
trayClip // the clipboard history button
|
||||
trayAI // Claude or Grok
|
||||
trayMusic // the mp3 player
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -151,6 +154,21 @@ func trayItemsAt(x, clientH int32) []trayItem {
|
||||
continue
|
||||
}
|
||||
w = px(36)
|
||||
case trayClip:
|
||||
if !showClip {
|
||||
continue
|
||||
}
|
||||
w = px(36)
|
||||
case trayAI:
|
||||
if !showAI {
|
||||
continue
|
||||
}
|
||||
w = px(36)
|
||||
case trayMusic:
|
||||
if !showMusic {
|
||||
continue
|
||||
}
|
||||
w = px(36)
|
||||
case trayChevron:
|
||||
w = px(28)
|
||||
}
|
||||
@@ -348,6 +366,12 @@ func drawTray(hdc uintptr, w, h int32) {
|
||||
drawGMIcon(hdc, it.r)
|
||||
case trayEmoji:
|
||||
drawEmojiIcon(hdc, it.r)
|
||||
case trayClip:
|
||||
drawClipIcon(hdc, it.r)
|
||||
case trayAI:
|
||||
drawAIIcon(hdc, it.r)
|
||||
case trayMusic:
|
||||
drawMusicIcon(hdc, it.r)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -639,6 +663,12 @@ func trayClick(kind int) {
|
||||
gmToggle()
|
||||
case trayEmoji:
|
||||
tapChord(vkLWin, vkPeriod) // Win+. opens the emoji panel
|
||||
case trayClip:
|
||||
tapChord(vkLWin, 'V') // Win+V opens the clipboard history
|
||||
case trayAI:
|
||||
aiClick()
|
||||
case trayMusic:
|
||||
flyPlayer.toggle()
|
||||
case trayChevron:
|
||||
// If the hidden icons are already showing, a second click closes them. Sending
|
||||
// Win+B and Enter again would instead press Enter on the highlighted icon.
|
||||
@@ -737,6 +767,8 @@ func addTrayMenu(add func(flags uintptr, id uintptr, text string), sep func(), k
|
||||
add(0, menuGMID, "Show Messages")
|
||||
add(0, menuGMCloseID, "Close Messages (stop checking for texts)")
|
||||
sep()
|
||||
case trayAI, trayMusic, trayClip:
|
||||
webFlyMenu(add, sep, kind)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -786,7 +818,7 @@ func handleTrayCommand(cmd uintptr) bool {
|
||||
time.Sleep(60 * time.Millisecond)
|
||||
refreshStatus(false)
|
||||
default:
|
||||
return false
|
||||
return webFlyCommand(cmd)
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -794,7 +826,7 @@ func handleTrayCommand(cmd uintptr) bool {
|
||||
// ---------- the right row can be rearranged too ----------
|
||||
|
||||
// trayOrder is the left to right order of the items to the right of center.
|
||||
var trayOrder = []int{trayClock, trayWeather, trayNews, traySys, trayGM, trayEmoji, trayBattery, trayVolume, trayWifi, trayChevron}
|
||||
var trayOrder = []int{trayClock, trayWeather, trayNews, traySys, trayGM, trayEmoji, trayClip, trayAI, trayMusic, trayBattery, trayVolume, trayWifi, trayChevron}
|
||||
|
||||
var (
|
||||
dragTray int // the tray item the mouse went down on, 0 for none
|
||||
@@ -813,7 +845,7 @@ func loadTrayOrder() {
|
||||
seen := map[int]bool{}
|
||||
for _, p := range strings.Split(strings.TrimSpace(string(b)), ",") {
|
||||
n, err := strconv.Atoi(strings.TrimSpace(p))
|
||||
if err != nil || n < trayClock || n > trayEmoji || seen[n] {
|
||||
if err != nil || n < trayClock || n > trayMusic || seen[n] {
|
||||
return
|
||||
}
|
||||
seen[n] = true
|
||||
@@ -847,6 +879,15 @@ func loadTrayOrder() {
|
||||
if !seen[trayEmoji] {
|
||||
insertAfter(trayGM, trayEmoji)
|
||||
}
|
||||
if !seen[trayClip] {
|
||||
insertAfter(trayEmoji, trayClip)
|
||||
}
|
||||
if !seen[trayAI] {
|
||||
insertAfter(trayClip, trayAI)
|
||||
}
|
||||
if !seen[trayMusic] {
|
||||
insertAfter(trayAI, trayMusic)
|
||||
}
|
||||
if len(order) == len(trayOrder) {
|
||||
trayOrder = order
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user