v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-21 10:00:59 -07:00

style: change borderColor to border_color in config

This commit is contained in:
eeeXun 2023-02-17 22:31:04 +08:00
parent c1ebe7eb3c
commit 529decb190

View File

@ -13,17 +13,17 @@ func configInit() {
var ( var (
defaultConfigPath string defaultConfigPath string
defaultConfig = map[string]interface{}{ defaultConfig = map[string]interface{}{
"hide_below": false,
"transparent": false, "transparent": false,
"theme": "Gruvbox", "theme": "Gruvbox",
"source.borderColor": "red", "source.border_color": "red",
"destination.borderColor": "blue", "destination.border_color": "blue",
"source.language.apertiumtranslate": "English", "source.language.apertiumtranslate": "English",
"destination.language.apertiumtranslate": "English", "destination.language.apertiumtranslate": "English",
"source.language.argostranslate": "English", "source.language.argostranslate": "English",
"destination.language.argostranslate": "English", "destination.language.argostranslate": "English",
"source.language.googletranslate": "English", "source.language.googletranslate": "English",
"destination.language.googletranslate": "English", "destination.language.googletranslate": "English",
"hide_below": false,
"translator": "ArgosTranslate", "translator": "ArgosTranslate",
} }
) )
@ -73,8 +73,8 @@ func configInit() {
uiStyle.Theme = config.GetString("theme") uiStyle.Theme = config.GetString("theme")
uiStyle.HideBelow = config.GetBool("hide_below") uiStyle.HideBelow = config.GetBool("hide_below")
uiStyle.Transparent = config.GetBool("transparent") uiStyle.Transparent = config.GetBool("transparent")
uiStyle.SetSrcBorderColor(config.GetString("source.borderColor")). uiStyle.SetSrcBorderColor(config.GetString("source.border_color")).
SetDstBorderColor(config.GetString("destination.borderColor")) SetDstBorderColor(config.GetString("destination.border_color"))
// set argument language // set argument language
if len(*srcLangArg) > 0 { if len(*srcLangArg) > 0 {
translator.SetSrcLang(*srcLangArg) translator.SetSrcLang(*srcLangArg)
@ -122,13 +122,13 @@ func updateConfig() {
changed = true changed = true
config.Set("transparent", uiStyle.Transparent) config.Set("transparent", uiStyle.Transparent)
} }
if config.GetString("source.borderColor") != uiStyle.SrcBorderStr() { if config.GetString("source.border_color") != uiStyle.SrcBorderStr() {
changed = true changed = true
config.Set("source.borderColor", uiStyle.SrcBorderStr()) config.Set("source.border_color", uiStyle.SrcBorderStr())
} }
if config.GetString("destination.borderColor") != uiStyle.DstBorderStr() { if config.GetString("destination.border_color") != uiStyle.DstBorderStr() {
changed = true changed = true
config.Set("destination.borderColor", uiStyle.DstBorderStr()) config.Set("destination.border_color", uiStyle.DstBorderStr())
} }
if changed { if changed {