diff options
-rw-r--r-- | xA/xA.go | 29 |
1 files changed, 26 insertions, 3 deletions
@@ -84,6 +84,14 @@ func init() { func (t *customTheme) Color( name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color { + /* + // Fyne may use a dark background with the Light variant, + // which makes the UI unusable. + if runtime.GOOS == "android" { + variant = theme.VariantDark + } + */ + // Fuck this low contrast shit, text must be black. if name == theme.ColorNameForeground && variant == theme.VariantLight { @@ -191,6 +199,8 @@ var ( // Widgets: + inForeground = true + wWindow fyne.Window wTopic *widget.RichText wBufferList *widget.List @@ -396,7 +406,7 @@ func convertItemFormatting( case *RelayItemDataFlipUnderline: cf.format.Underline = !cf.format.Underline case *RelayItemDataFlipCrossedOut: - // ¯\_(ツ)_/¯ + // https://github.com/fyne-io/fyne/issues/1084 case *RelayItemDataFlipInverse: *inverse = !*inverse case *RelayItemDataFlipMonospace: @@ -606,8 +616,8 @@ func relayProcessBufferLine(b *buffer, m *RelayEventDataBufferLine) { // Retained mode is complicated. display := (!m.IsUnimportant || !bc.hideUnimportant) && (b.bufferName == bufferCurrent || m.LeakToActive) - toBottom := display // && bufferAtBottom() - visible := display && toBottom // && ... + toBottom := display && bufferAtBottom() + visible := display && toBottom && inForeground // && log not visible separate := display && !visible && bc.newMessages == 0 && bc.newUnimportantMessages == 0 @@ -957,6 +967,19 @@ func main() { a := app.New() a.Settings().SetTheme(&customTheme{}) wWindow = a.NewWindow(projectName) + wWindow.Resize(fyne.NewSize(640, 480)) + + a.Lifecycle().SetOnEnteredForeground(func() { + // TODO(p): Does this need locking? + inForeground = true + if b := bufferByName(bufferCurrent); b != nil { + b.highlighted = false + refreshIcon() + } + }) + a.Lifecycle().SetOnExitedForeground(func() { + inForeground = false + }) // TODO(p): Consider using data bindings. wBufferList = widget.NewList(func() int { return len(buffers) }, |