diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-03 14:54:55 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-10 00:23:01 +1100 |
commit | 4912205adb5e8e245b33b8e0d5581bcf0ec37e8a (patch) | |
tree | 90e28657c0af72cd0a880842f88750c01a32834d /pkg/theme/theme.go | |
parent | 9440dcf9de3214927125693e512cdc941ca4e123 (diff) |
remove viper
WIP
Diffstat (limited to 'pkg/theme/theme.go')
-rw-r--r-- | pkg/theme/theme.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/pkg/theme/theme.go b/pkg/theme/theme.go index 0c85da775..3b8e65c8a 100644 --- a/pkg/theme/theme.go +++ b/pkg/theme/theme.go @@ -3,7 +3,7 @@ package theme import ( "github.com/fatih/color" "github.com/jesseduffield/gocui" - "github.com/spf13/viper" + "github.com/jesseduffield/lazygit/pkg/config" ) var ( @@ -38,16 +38,16 @@ var ( ) // UpdateTheme updates all theme variables -func UpdateTheme(userConfig *viper.Viper) { - ActiveBorderColor = GetGocuiColor(userConfig.GetStringSlice("gui.theme.activeBorderColor")) - InactiveBorderColor = GetGocuiColor(userConfig.GetStringSlice("gui.theme.inactiveBorderColor")) - SelectedLineBgColor = GetBgColor(userConfig.GetStringSlice("gui.theme.selectedLineBgColor")) - SelectedRangeBgColor = GetBgColor(userConfig.GetStringSlice("gui.theme.selectedRangeBgColor")) - GocuiSelectedLineBgColor = GetGocuiColor(userConfig.GetStringSlice("gui.theme.selectedLineBgColor")) - OptionsColor = GetGocuiColor(userConfig.GetStringSlice("gui.theme.optionsTextColor")) - OptionsFgColor = GetFgColor(userConfig.GetStringSlice("gui.theme.optionsTextColor")) - - isLightTheme := userConfig.GetBool("gui.theme.lightTheme") +func UpdateTheme(themeConfig config.ThemeConfig) { + ActiveBorderColor = GetGocuiColor(themeConfig.ActiveBorderColor) + InactiveBorderColor = GetGocuiColor(themeConfig.InactiveBorderColor) + SelectedLineBgColor = GetBgColor(themeConfig.SelectedLineBgColor) + SelectedRangeBgColor = GetBgColor(themeConfig.SelectedRangeBgColor) + GocuiSelectedLineBgColor = GetGocuiColor(themeConfig.SelectedLineBgColor) + OptionsColor = GetGocuiColor(themeConfig.OptionsTextColor) + OptionsFgColor = GetFgColor(themeConfig.OptionsTextColor) + + isLightTheme := themeConfig.LightTheme if isLightTheme { DefaultTextColor = color.FgBlack DefaultHiTextColor = color.FgHiBlack |