Ver Fonte

config: remove theme.background_color and fix highlights

ayn2op há 9 meses atrás
pai
commit
728c1977c3
7 ficheiros alterados com 9 adições e 17 exclusões
  1. 0 1
      cmd/message_input.go
  2. 0 1
      cmd/messages_list.go
  3. 1 2
      cmd/root.go
  4. 1 1
      go.mod
  5. 2 2
      go.sum
  6. 0 4
      internal/config/config.toml
  7. 5 6
      internal/config/theme.go

+ 0 - 1
cmd/message_input.go

@@ -58,7 +58,6 @@ func newMessageInput(cfg *config.Config) *messageInput {
 
 	mi.Box = ui.ConfigureBox(mi.Box, &cfg.Theme)
 	mi.
-		SetTextStyle(tcell.StyleDefault.Background(tcell.GetColor(cfg.Theme.BackgroundColor))).
 		SetClipboard(func(s string) {
 			_ = clipboard.WriteAll(s)
 		}, func() string {

+ 0 - 1
cmd/messages_list.go

@@ -55,7 +55,6 @@ func newMessagesList(cfg *config.Config) *messagesList {
 		SetWordWrap(true).
 		ScrollToEnd().
 		SetHighlightedFunc(ml.onHighlighted).
-		SetTextColor(tcell.ColorDefault).
 		SetTitle("Messages").
 		SetInputCapture(ml.onInputCapture)
 

+ 1 - 2
cmd/root.go

@@ -11,7 +11,6 @@ import (
 	"github.com/ayn2op/tview"
 	"github.com/diamondburned/arikawa/v3/utils/ws"
 	"github.com/diamondburned/ningen/v3"
-	"github.com/gdamore/tcell/v2"
 	"github.com/spf13/cobra"
 	"github.com/zalando/go-keyring"
 )
@@ -59,7 +58,7 @@ var (
 				}
 			}
 
-			tview.Styles.PrimitiveBackgroundColor = tcell.GetColor(cfg.Theme.BackgroundColor)
+			tview.Styles = tview.Theme{}
 			app = newApplication(cfg)
 			return app.run(token)
 		},

+ 1 - 1
go.mod

@@ -5,7 +5,7 @@ go 1.24.4
 require (
 	github.com/BurntSushi/toml v1.5.0
 	github.com/atotto/clipboard v0.1.4
-	github.com/ayn2op/tview v0.0.0-20250712230729-d9ce783318a5
+	github.com/ayn2op/tview v0.0.0-20250713001733-14dcf667392e
 	github.com/deckarep/gosx-notifier v0.0.0-20180201035817-e127226297fb
 	github.com/diamondburned/arikawa/v3 v3.5.1-0.20250703053218-19d9c3f2e011
 	github.com/diamondburned/ningen/v3 v3.0.1-0.20250703054403-e5dc4cf15e84

+ 2 - 2
go.sum

@@ -27,8 +27,8 @@ github.com/akavel/rsrc v0.10.2 h1:Zxm8V5eI1hW4gGaYsJQUhxpjkENuG91ki8B4zCrvEsw=
 github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
 github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
 github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
-github.com/ayn2op/tview v0.0.0-20250712230729-d9ce783318a5 h1:Ce7uvVsXLhi1gWFoIvCbRCPCj6IIXsj2PAEWxG5NH2k=
-github.com/ayn2op/tview v0.0.0-20250712230729-d9ce783318a5/go.mod h1:PuMMP3J7SfW0jgAc1fdABOHJkoGbQIw3jejRAkl0API=
+github.com/ayn2op/tview v0.0.0-20250713001733-14dcf667392e h1:WvuLnxCc7IqUrN5hrAmA/OyUpA8WzYsSat3sn32jYmc=
+github.com/ayn2op/tview v0.0.0-20250713001733-14dcf667392e/go.mod h1:xqhotzuhTSxSudyNSHJfpD6S5C7+FFVv+JzJ8YaFNK4=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=

+ 0 - 4
internal/config/config.toml

@@ -99,11 +99,7 @@ open_file_picker = "Ctrl+\\"
 up = "Up"
 down = "Down"
 
-# Applies to all
 # style = { foreground = "", background = "", attributes = "" or [""] }
-[theme]
-background_color = "default"
-
 [theme.title]
 alignment = "left"                     # `"left"`, `"center"`, or `"right"`.
 normal_style = { attributes = "dim" }

+ 5 - 6
internal/config/theme.go

@@ -115,12 +115,11 @@ type (
 	}
 
 	Theme struct {
-		BackgroundColor string            `toml:"background_color"`
-		Title           TitleTheme        `toml:"title"`
-		Border          BorderTheme       `toml:"border"`
-		GuildsTree      GuildsTreeTheme   `toml:"guilds_tree"`
-		MessagesList    MessagesListTheme `toml:"messages_list"`
-		MentionsList    MentionsListTheme `toml:"mentions_list"`
+		Title        TitleTheme        `toml:"title"`
+		Border       BorderTheme       `toml:"border"`
+		GuildsTree   GuildsTreeTheme   `toml:"guilds_tree"`
+		MessagesList MessagesListTheme `toml:"messages_list"`
+		MentionsList MentionsListTheme `toml:"mentions_list"`
 	}
 )