MirrorBar Plus 11: clock font, more colors and logo shapes, charging color, emoji button
Clock font picker (16 fonts), 8 more bar colors, 8 more logo/tray/clock colors, 6 new Windows logo shapes, battery charging color picker, and an emoji panel button (Win+.) on the bar with a show/hide tickbox and right-click item. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JW57Zw8fvgzpeDkbUYT7sG
This commit is contained in:
@@ -24,6 +24,7 @@ const (
|
||||
trayNews
|
||||
traySys
|
||||
trayGM // Google Messages
|
||||
trayEmoji // the emoji panel button
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -54,6 +55,7 @@ const (
|
||||
menuSysCopyID = 35
|
||||
menuGMID = 36
|
||||
menuGMCloseID = 37
|
||||
menuEmojiID = 38
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -144,6 +146,11 @@ func trayItemsAt(x, clientH int32) []trayItem {
|
||||
continue
|
||||
}
|
||||
w = px(36)
|
||||
case trayEmoji:
|
||||
if !showEmoji {
|
||||
continue
|
||||
}
|
||||
w = px(36)
|
||||
case trayChevron:
|
||||
w = px(28)
|
||||
}
|
||||
@@ -210,7 +217,7 @@ func drawBattery(hdc uintptr, r rect) {
|
||||
col := white
|
||||
switch {
|
||||
case battCharging || battAC:
|
||||
col = rgb(90, 205, 120)
|
||||
col = chargeColor()
|
||||
case battPct <= 15:
|
||||
col = rgb(235, 80, 80)
|
||||
}
|
||||
@@ -339,6 +346,8 @@ func drawTray(hdc uintptr, w, h int32) {
|
||||
drawSysIcon(hdc, it.r)
|
||||
case trayGM:
|
||||
drawGMIcon(hdc, it.r)
|
||||
case trayEmoji:
|
||||
drawEmojiIcon(hdc, it.r)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -598,6 +607,9 @@ func tapChord(mod, k uintptr) {
|
||||
// trayClick opens the matching Windows panel with its keyboard shortcut.
|
||||
const vkEscape = 0x1B
|
||||
|
||||
// vkPeriod is the . key; Win+. opens the Windows emoji panel.
|
||||
const vkPeriod = 0xBE
|
||||
|
||||
// overflowOpen reports whether the hidden icons flyout is on screen.
|
||||
func overflowOpen() bool {
|
||||
for _, class := range []string{"TopLevelWindowForOverflowXamlIsland", "NotifyIconOverflowWindow"} {
|
||||
@@ -625,6 +637,8 @@ func trayClick(kind int) {
|
||||
sysToggle()
|
||||
case trayGM:
|
||||
gmToggle()
|
||||
case trayEmoji:
|
||||
tapChord(vkLWin, vkPeriod) // Win+. opens the emoji panel
|
||||
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.
|
||||
@@ -756,6 +770,8 @@ func handleTrayCommand(cmd uintptr) bool {
|
||||
case menuGMCloseID:
|
||||
gmClose()
|
||||
redraw(hwndMain)
|
||||
case menuEmojiID:
|
||||
tapChord(vkLWin, vkPeriod)
|
||||
case menuSysCopyID:
|
||||
if clipboardSet(sysText(sysGather())) {
|
||||
sysCopied = "Copied everything"
|
||||
@@ -778,7 +794,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, trayBattery, trayVolume, trayWifi, trayChevron}
|
||||
var trayOrder = []int{trayClock, trayWeather, trayNews, traySys, trayGM, trayEmoji, trayBattery, trayVolume, trayWifi, trayChevron}
|
||||
|
||||
var (
|
||||
dragTray int // the tray item the mouse went down on, 0 for none
|
||||
@@ -797,7 +813,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 > trayGM || seen[n] {
|
||||
if err != nil || n < trayClock || n > trayEmoji || seen[n] {
|
||||
return
|
||||
}
|
||||
seen[n] = true
|
||||
@@ -828,6 +844,9 @@ func loadTrayOrder() {
|
||||
if !seen[trayGM] {
|
||||
insertAfter(traySys, trayGM)
|
||||
}
|
||||
if !seen[trayEmoji] {
|
||||
insertAfter(trayGM, trayEmoji)
|
||||
}
|
||||
if len(order) == len(trayOrder) {
|
||||
trayOrder = order
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user