-
-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change background #42
Conversation
Ok @lescx. Do you mind adding the background colors for the other themes as well?
|
it's alr. I will |
i've done it in #43 |
hummm i actually did this what do you think? model.go var output = termenv.NewOutput(os.Stdout)
var terminalBackgroundColor = output.BackgroundColor()
var channel = make(chan channelMessage, 1000) func (m model) Init() tea.Cmd {
output := termenv.NewOutput(os.Stdout)
output.SetBackgroundColor(output.Color(theme.TerminalBackground))
return tea.Batch(
tea.SetWindowTitle("SuperFile"),
textinput.Blink,
listenForchannelMessage(channel),
)
} case Config.Quit[0], Config.Quit[1]:
output.SetBackgroundColor(terminalBackgroundColor)
return m, tea.Quit main.go func main() {
output := termenv.NewOutput(os.Stdout)
terminalBackgroundColor := output.BackgroundColor()
app := &cli.App{
Name: "superfile",
Version: currentVersion,
Description: "A Modern file manager with golang",
ArgsUsage: "[path]",
Action: func(c *cli.Context) error {
path := ""
if c.Args().Present() {
path = c.Args().First()
}
InitConfigFile()
p := tea.NewProgram(components.InitialModel(path), tea.WithAltScreen())
if _, err := p.Run(); err != nil {
output.SetBackgroundColor(terminalBackgroundColor)
log.Fatalf("Alas, there's been an error: %v", err)
os.Exit(1)
}
CheckForUpdates()
return nil
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatalln(err)
}
} |
It sets the terminal color as the background color and on error or exit it returns to the default color |
Please just send the code or a diff but not images when asking for code reviews, @MHNightCat This changes nothing as currently it uses the terminal background color by default. |
but this is exactly what it is doing right now even |
i am so sorry |
it's alright |
So what do you think about this |
I like @AnshumanNeon's solution of just using the themes background color. Nothing wrong with that. |
The bg color should match the theme, otherwise no point in a theme. I have just added a lot of .background(backrgoundwindow) in the code. it works. for now. |
|
Added the ability to change background color in the config file of the theme. To do so you should use "backgroundWindow" parameter in the json file. Example of it is available in the catpuccin.json file of these commits