Skip to content

Commit b5e02e0

Browse files
committed
Show additional configs only if there is more than one
1 parent 242052a commit b5e02e0

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

trayicon.go

+13-8
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,20 @@ func setupSysTrayReal() {
124124

125125
configs := getConfigs()
126126

127-
for _, config := range configs {
128-
entry := systray.AddMenuItem(config.Name, "")
129-
mConfigCheckbox = append(mConfigCheckbox, entry)
130-
// decorate configs
131-
gliph := " ☐ "
132-
if *configIni == config.Localtion {
133-
gliph = " 🗹 "
127+
if len(configs) > 1 {
128+
for _, config := range configs {
129+
entry := systray.AddMenuItem(config.Name, "")
130+
mConfigCheckbox = append(mConfigCheckbox, entry)
131+
// decorate configs
132+
gliph := " ☐ "
133+
if *configIni == config.Localtion {
134+
gliph = " 🗹 "
135+
}
136+
entry.SetTitle(gliph + config.Name)
134137
}
135-
entry.SetTitle(gliph + config.Name)
138+
} else {
139+
// apply env setting from first config immediately
140+
// applyEnvironment(configs[0].Localtion)
136141
}
137142
//mQuit := systray.AddMenuItem("Quit Plugin", "")
138143

0 commit comments

Comments
 (0)