Google Messages text flyout, part 2, README update
This commit is contained in:
@@ -23,7 +23,9 @@ The real taskbar is hidden and a see-through pill takes its place. The pill is a
|
||||
|
||||
- Click the newspaper and a panel of local headlines opens above the bar, newest first, with the outlet and how long ago each ran. Click a headline and it opens in your default browser. It uses the same ZIP code as the weather: the ZIP code is turned into a town name and the headlines are Google News' feed for that town, so someone in 43220 gets Columbus stations and papers and someone in 46750 gets Fort Wayne and Huntington ones. The headlines are only downloaded when a ZIP code is set. Small towns have fewer stories than cities.
|
||||
|
||||
- "Show weather on the bar" and "Show local news on the bar" in the settings window turn either feature off. The icon leaves the bar and nothing is downloaded for it; tick the box again and it comes back.
|
||||
- Click the little speech bubble and Google Messages for web opens in a small window above the bar, so you can read and answer texts without opening a browser tab. The first time, scan the QR code from the Messages app on your phone (Settings, Device pairing) and tick "Remember this computer"; after that it stays signed in. It runs Microsoft Edge in app mode (no tabs, no address bar) with its own private profile folder in `%LOCALAPPDATA%\MirrorBar\messages`, separate from your normal Edge, and goes only to messages.google.com. Once you have paired, MirrorBar quietly starts it in the background about 20 seconds after it launches, keeps the window just off the edge of the screen, and shows the unread count from the window title as a red number on the bubble. Click anywhere else and the window slides away again. Right-click the bubble and choose "Close Messages" to stop the background window and give the memory back. Messages for web only works while your phone is on and connected; that is how Google built it. `messages-titles.txt` in the MirrorBar data folder keeps the first 25 different window titles it has seen, only so the unread badge can be tuned; delete it any time.
|
||||
|
||||
- "Show weather on the bar", "Show local news on the bar", "Show system stats on the bar" and "Show Google Messages on the bar" in the settings window turn each feature off. The icon leaves the bar and nothing is downloaded for it; tick the box again and it comes back.
|
||||
|
||||
- The weather, news and system stats panels are as see-through as the bar itself: set the bar to Clear and the panels go clear too, with only their text, pictures and outline staying solid. Untick "Panels match the bar's transparency" in the settings window to keep the panels solid.
|
||||
|
||||
|
||||
@@ -237,6 +237,8 @@ func renderLayer(screen uintptr, w, h int32, fills, fg bool, base uintptr) []uin
|
||||
drawNewsIcon(memV, r)
|
||||
case traySys:
|
||||
drawSysIcon(memV, r)
|
||||
case trayGM:
|
||||
drawGMIcon(memV, r)
|
||||
}
|
||||
}
|
||||
pGdiFlush.Call()
|
||||
|
||||
+13
-8
@@ -72,6 +72,7 @@ const (
|
||||
idShowNews = 214
|
||||
idShowSys = 215
|
||||
idPanelFade = 216
|
||||
idShowGM = 217
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -82,7 +83,7 @@ var (
|
||||
ctlAlpha, ctlAlphaValue, ctlLogo, ctlClock, ctlTrayIcons, ctlStyle uintptr
|
||||
ctlVertical, ctlAutostart uintptr
|
||||
ctlZip, ctlZipStatus uintptr
|
||||
ctlShowWeather, ctlShowNews, ctlShowSys, ctlPanelFade uintptr
|
||||
ctlShowWeather, ctlShowNews, ctlShowSys, ctlShowGM, ctlPanelFade uintptr
|
||||
zipSyncing bool // true while the program itself is filling in the ZIP box
|
||||
)
|
||||
|
||||
@@ -134,7 +135,7 @@ func openSettings() {
|
||||
settingsFont = makeFont(px(13), 400)
|
||||
}
|
||||
|
||||
r := rect{0, 0, px(400), px(488)}
|
||||
r := rect{0, 0, px(400), px(516)}
|
||||
pAdjustWindowRectEx.Call(uintptr(unsafe.Pointer(&r)), wsWindowFrame, 0, 0)
|
||||
ow, oh := r.Right-r.Left, r.Bottom-r.Top
|
||||
sw, sh := screenSize()
|
||||
@@ -184,13 +185,14 @@ func openSettings() {
|
||||
ctlShowWeather = makeControl(hw, inst, "BUTTON", "Show weather on the bar", bsAutoCheckBox|wsTabStop, 16, 262, 368, 22, idShowWeather)
|
||||
ctlShowNews = makeControl(hw, inst, "BUTTON", "Show local news on the bar", bsAutoCheckBox|wsTabStop, 16, 290, 368, 22, idShowNews)
|
||||
ctlShowSys = makeControl(hw, inst, "BUTTON", "Show system stats on the bar", bsAutoCheckBox|wsTabStop, 16, 318, 368, 22, idShowSys)
|
||||
ctlPanelFade = makeControl(hw, inst, "BUTTON", "Panels match the bar's transparency", bsAutoCheckBox|wsTabStop, 16, 346, 368, 22, idPanelFade)
|
||||
ctlVertical = makeControl(hw, inst, "BUTTON", "Stand the bar up at the right edge (vertical)", bsAutoCheckBox|wsTabStop, 16, 374, 368, 22, idVertical)
|
||||
ctlAutostart = makeControl(hw, inst, "BUTTON", "Start MirrorBar when I sign in", bsAutoCheckBox|wsTabStop, 16, 402, 368, 22, idAutostart)
|
||||
ctlShowGM = makeControl(hw, inst, "BUTTON", "Show Google Messages on the bar", bsAutoCheckBox|wsTabStop, 16, 346, 368, 22, idShowGM)
|
||||
ctlPanelFade = makeControl(hw, inst, "BUTTON", "Panels match the bar's transparency", bsAutoCheckBox|wsTabStop, 16, 374, 368, 22, idPanelFade)
|
||||
ctlVertical = makeControl(hw, inst, "BUTTON", "Stand the bar up at the right edge (vertical)", bsAutoCheckBox|wsTabStop, 16, 402, 368, 22, idVertical)
|
||||
ctlAutostart = makeControl(hw, inst, "BUTTON", "Start MirrorBar when I sign in", bsAutoCheckBox|wsTabStop, 16, 430, 368, 22, idAutostart)
|
||||
|
||||
makeControl(hw, inst, "BUTTON", "Reset position", bsPushButton|wsTabStop, 16, 442, 116, 28, idResetPos)
|
||||
makeControl(hw, inst, "BUTTON", "Reset bar width", bsPushButton|wsTabStop, 140, 442, 116, 28, idResetWidth)
|
||||
makeControl(hw, inst, "BUTTON", "Close", bsDefPushButton|wsTabStop, 292, 442, 92, 28, idClose)
|
||||
makeControl(hw, inst, "BUTTON", "Reset position", bsPushButton|wsTabStop, 16, 470, 116, 28, idResetPos)
|
||||
makeControl(hw, inst, "BUTTON", "Reset bar width", bsPushButton|wsTabStop, 140, 470, 116, 28, idResetWidth)
|
||||
makeControl(hw, inst, "BUTTON", "Close", bsDefPushButton|wsTabStop, 292, 470, 92, 28, idClose)
|
||||
|
||||
hwndSettings = hw
|
||||
settingsSync()
|
||||
@@ -212,6 +214,7 @@ func settingsSync() {
|
||||
pSendMessage.Call(ctlShowWeather, bmSetCheck, boolWP(showWeather), 0)
|
||||
pSendMessage.Call(ctlShowNews, bmSetCheck, boolWP(showNews), 0)
|
||||
pSendMessage.Call(ctlShowSys, bmSetCheck, boolWP(showSys), 0)
|
||||
pSendMessage.Call(ctlShowGM, bmSetCheck, boolWP(showGM), 0)
|
||||
pSendMessage.Call(ctlPanelFade, bmSetCheck, boolWP(flyMatchBar), 0)
|
||||
pSendMessage.Call(ctlVertical, bmSetCheck, boolWP(vertical), 0)
|
||||
pSendMessage.Call(ctlAutostart, bmSetCheck, boolWP(autostartEnabled()), 0)
|
||||
@@ -313,6 +316,8 @@ func settingsCommand(id, note uintptr) {
|
||||
setShowNews(checked(ctlShowNews))
|
||||
case idShowSys:
|
||||
setShowSys(checked(ctlShowSys))
|
||||
case idShowGM:
|
||||
setShowGM(checked(ctlShowGM))
|
||||
case idPanelFade:
|
||||
setFlyMatchBar(checked(ctlPanelFade))
|
||||
case idVertical:
|
||||
|
||||
@@ -137,6 +137,7 @@ func sysToggle() {
|
||||
previewHide()
|
||||
weatherHide() // one panel at a time
|
||||
newsHide()
|
||||
gmHide()
|
||||
sysRows = sysGather()
|
||||
sysShown = true
|
||||
sysPrevBtn = true // ignore a button that is still held from the click that opened this
|
||||
|
||||
@@ -23,6 +23,7 @@ const (
|
||||
trayWeather // added after the others so saved orders from older versions still mean the same thing
|
||||
trayNews
|
||||
traySys
|
||||
trayGM // Google Messages
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -51,6 +52,8 @@ const (
|
||||
menuNewsZipID = 29
|
||||
menuSysID = 34
|
||||
menuSysCopyID = 35
|
||||
menuGMID = 36
|
||||
menuGMCloseID = 37
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -128,6 +131,11 @@ func trayItemsAt(x, clientH int32) []trayItem {
|
||||
continue
|
||||
}
|
||||
w = px(36)
|
||||
case trayGM:
|
||||
if !showGM {
|
||||
continue
|
||||
}
|
||||
w = px(36)
|
||||
case trayChevron:
|
||||
w = px(28)
|
||||
}
|
||||
@@ -321,6 +329,8 @@ func drawTray(hdc uintptr, w, h int32) {
|
||||
drawNewsIcon(hdc, it.r)
|
||||
case traySys:
|
||||
drawSysIcon(hdc, it.r)
|
||||
case trayGM:
|
||||
drawGMIcon(hdc, it.r)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -605,6 +615,8 @@ func trayClick(kind int) {
|
||||
newsToggle()
|
||||
case traySys:
|
||||
sysToggle()
|
||||
case trayGM:
|
||||
gmToggle()
|
||||
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.
|
||||
@@ -699,6 +711,10 @@ func addTrayMenu(add func(flags uintptr, id uintptr, text string), sep func(), k
|
||||
add(0, menuSysID, "Show system stats")
|
||||
add(0, menuSysCopyID, "Copy system stats")
|
||||
sep()
|
||||
case trayGM:
|
||||
add(0, menuGMID, "Show Messages")
|
||||
add(0, menuGMCloseID, "Close Messages (stop checking for texts)")
|
||||
sep()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -725,6 +741,13 @@ func handleTrayCommand(cmd uintptr) bool {
|
||||
if !sysShown {
|
||||
sysToggle()
|
||||
}
|
||||
case menuGMID:
|
||||
if !gmShown {
|
||||
gmToggle()
|
||||
}
|
||||
case menuGMCloseID:
|
||||
gmClose()
|
||||
redraw(hwndMain)
|
||||
case menuSysCopyID:
|
||||
if clipboardSet(sysText(sysGather())) {
|
||||
sysCopied = "Copied everything"
|
||||
@@ -747,7 +770,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, trayBattery, trayVolume, trayWifi, trayChevron}
|
||||
var trayOrder = []int{trayClock, trayWeather, trayNews, traySys, trayGM, trayBattery, trayVolume, trayWifi, trayChevron}
|
||||
|
||||
var (
|
||||
dragTray int // the tray item the mouse went down on, 0 for none
|
||||
@@ -766,7 +789,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 > traySys || seen[n] {
|
||||
if err != nil || n < trayClock || n > trayGM || seen[n] {
|
||||
return
|
||||
}
|
||||
seen[n] = true
|
||||
@@ -794,6 +817,9 @@ func loadTrayOrder() {
|
||||
if !seen[traySys] {
|
||||
insertAfter(trayNews, traySys)
|
||||
}
|
||||
if !seen[trayGM] {
|
||||
insertAfter(traySys, trayGM)
|
||||
}
|
||||
if len(order) == len(trayOrder) {
|
||||
trayOrder = order
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user