aboutsummaryrefslogtreecommitdiff
path: root/xA/xA.go
diff options
context:
space:
mode:
Diffstat (limited to 'xA/xA.go')
-rw-r--r--xA/xA.go29
1 files changed, 26 insertions, 3 deletions
diff --git a/xA/xA.go b/xA/xA.go
index 8150026..c1038e5 100644
--- a/xA/xA.go
+++ b/xA/xA.go
@@ -6,6 +6,7 @@ package main
import (
"bufio"
"context"
+ _ "embed"
"encoding/binary"
"flag"
"fmt"
@@ -31,6 +32,16 @@ var (
debug = flag.Bool("debug", false, "enable debug output")
projectName = "xA"
projectVersion = "?"
+
+ //go:embed xA.png
+ iconNormal []byte
+ //go:embed xA-highlighted.png
+ iconHighlighted []byte
+
+ resourceIconNormal = fyne.NewStaticResource(
+ "xA.png", iconNormal)
+ resourceIconHighlighted = fyne.NewStaticResource(
+ "xA-highlighted.png", iconHighlighted)
)
// --- Theme -------------------------------------------------------------------
@@ -326,7 +337,19 @@ func bufferScrollToBottom() {
// --- UI state refresh --------------------------------------------------------
func refreshIcon() {
- // TODO(p): We can have an icon.
+ highlighted := false
+ for _, b := range buffers {
+ if b.highlighted {
+ highlighted = true
+ break
+ }
+ }
+
+ if highlighted {
+ wWindow.SetIcon(resourceIconHighlighted)
+ } else {
+ wWindow.SetIcon(resourceIconNormal)
+ }
}
func refreshTopic(topic []bufferLineItem) {
@@ -577,9 +600,8 @@ func bufferPrintLine(lines []bufferLine, index int) {
}
func bufferPrintSeparator() {
- // TODO(p): Formatting.
+ // TODO(p): Implement our own, so that it can use the primary colour.
wRichText.Segments = append(wRichText.Segments,
- &widget.TextSegment{Style: widget.RichTextStyleParagraph},
&widget.SeparatorSegment{})
}
@@ -656,6 +678,7 @@ func relayProcessBufferLine(b *buffer, m *RelayEventDataBufferLine) {
bufferScrollToBottom()
}
+ // TODO(p): On mobile, we should probably send notifications.
if line.isHighlight || (!visible && !line.isUnimportant &&
b.kind == RelayBufferKindPrivateMessage) {
beep()