mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Removed the pkg/gui/theme.go file
Moved most functions to the new theme/theme.go
This commit is contained in:
@ -444,7 +444,8 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
||||
return err
|
||||
}
|
||||
v.Frame = false
|
||||
v.FgColor = gui.GetOptionsPanelTextColor()
|
||||
userConfig := gui.Config.GetUserConfig()
|
||||
v.FgColor = theme.GetColor(userConfig.GetStringSlice("gui.theme.optionsTextColor"))
|
||||
}
|
||||
|
||||
if gui.getCommitMessageView() == nil {
|
||||
@ -650,7 +651,7 @@ func (gui *Gui) Run() error {
|
||||
|
||||
gui.g = g // TODO: always use gui.g rather than passing g around everywhere
|
||||
|
||||
if err := gui.SetColorScheme(); err != nil {
|
||||
if err := gui.setColorScheme(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -745,3 +746,14 @@ func (gui *Gui) handleDonate(g *gocui.Gui, v *gocui.View) error {
|
||||
}
|
||||
return gui.OSCommand.OpenLink("https://donorbox.org/lazygit")
|
||||
}
|
||||
|
||||
// setColorScheme sets the color scheme for the app based on the user config
|
||||
func (gui *Gui) setColorScheme() error {
|
||||
userConfig := gui.Config.GetUserConfig()
|
||||
theme.UpdateTheme(userConfig)
|
||||
|
||||
gui.g.FgColor = theme.InactiveBorderColor
|
||||
gui.g.SelFgColor = theme.ActiveBorderColor
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user