mirror of
				https://github.com/taigrr/wtf
				synced 2025-01-18 04:03:14 -08:00 
			
		
		
		
	enable user to disable emoji for weather module.
This commit is contained in:
		
							parent
							
								
									715ec4f952
								
							
						
					
					
						commit
						0b63a56e40
					
				| @ -81,5 +81,9 @@ func (widget *Widget) temperatures(cityData *owm.CurrentWeatherData) string { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (widget *Widget) buildTitle(cityData *owm.CurrentWeatherData) string { | func (widget *Widget) buildTitle(cityData *owm.CurrentWeatherData) string { | ||||||
| 	return fmt.Sprintf("%s %s", widget.emojiFor(cityData), cityData.Name) | 	if widget.settings.useEmoji { | ||||||
|  | 		return fmt.Sprintf("%s %s", widget.emojiFor(cityData), cityData.Name) | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	return fmt.Sprintf("%s", cityData.Name) | ||||||
| } | } | ||||||
|  | |||||||
| @ -24,6 +24,7 @@ type Settings struct { | |||||||
| 	cityIDs  []interface{} | 	cityIDs  []interface{} | ||||||
| 	language string | 	language string | ||||||
| 	tempUnit string | 	tempUnit string | ||||||
|  | 	useEmoji bool | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { | func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { | ||||||
| @ -34,6 +35,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co | |||||||
| 		cityIDs:  ymlConfig.UList("cityids"), | 		cityIDs:  ymlConfig.UList("cityids"), | ||||||
| 		language: ymlConfig.UString("language", "EN"), | 		language: ymlConfig.UString("language", "EN"), | ||||||
| 		tempUnit: ymlConfig.UString("tempUnit", "C"), | 		tempUnit: ymlConfig.UString("tempUnit", "C"), | ||||||
|  | 		useEmoji: ymlConfig.UBool("useEmoji", true), | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	settings.colors.current = ymlConfig.UString("colors.current", "green") | 	settings.colors.current = ymlConfig.UString("colors.current", "green") | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user