mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:20:06 +00:00 
			
		
		
		
	Adding custom styles to settings
This commit is contained in:
		
							parent
							
								
									45d3e45923
								
							
						
					
					
						commit
						f182e985c0
					
				
					 3 changed files with 32 additions and 8 deletions
				
			
		|  | @ -93,6 +93,11 @@ public: | ||||||
|       nmeaBaudRate_.SetMinimum(1); |       nmeaBaudRate_.SetMinimum(1); | ||||||
|       nmeaBaudRate_.SetMaximum(999999999); |       nmeaBaudRate_.SetMaximum(999999999); | ||||||
| 
 | 
 | ||||||
|  |       customStyleDrawLayer_.SetTransform([](const std::string& value) | ||||||
|  |                                          { return boost::trim_copy(value); }); | ||||||
|  |       customStyleUrl_.SetTransform([](const std::string& value) | ||||||
|  |                                    { return boost::trim_copy(value); }); | ||||||
|  | 
 | ||||||
|       clockFormat_.SetValidator( |       clockFormat_.SetValidator( | ||||||
|          SCWX_SETTINGS_ENUM_VALIDATOR(scwx::util::ClockFormat, |          SCWX_SETTINGS_ENUM_VALIDATOR(scwx::util::ClockFormat, | ||||||
|                                       scwx::util::ClockFormatIterator(), |                                       scwx::util::ClockFormatIterator(), | ||||||
|  | @ -130,6 +135,9 @@ public: | ||||||
| 
 | 
 | ||||||
|    SettingsVariable<bool>        antiAliasingEnabled_ {"anti_aliasing_enabled"}; |    SettingsVariable<bool>        antiAliasingEnabled_ {"anti_aliasing_enabled"}; | ||||||
|    SettingsVariable<std::string> clockFormat_ {"clock_format"}; |    SettingsVariable<std::string> clockFormat_ {"clock_format"}; | ||||||
|  |    SettingsVariable<std::string> customStyleDrawLayer_ { | ||||||
|  |       "custom_style_draw_layer"}; | ||||||
|  |    SettingsVariable<std::string> customStyleUrl_ {"custom_style_url"}; | ||||||
|    SettingsVariable<bool>        debugEnabled_ {"debug_enabled"}; |    SettingsVariable<bool>        debugEnabled_ {"debug_enabled"}; | ||||||
|    SettingsVariable<std::string> defaultAlertAction_ {"default_alert_action"}; |    SettingsVariable<std::string> defaultAlertAction_ {"default_alert_action"}; | ||||||
|    SettingsVariable<std::string> defaultRadarSite_ {"default_radar_site"}; |    SettingsVariable<std::string> defaultRadarSite_ {"default_radar_site"}; | ||||||
|  | @ -158,8 +166,10 @@ public: | ||||||
| GeneralSettings::GeneralSettings() : | GeneralSettings::GeneralSettings() : | ||||||
|     SettingsCategory("general"), p(std::make_unique<Impl>()) |     SettingsCategory("general"), p(std::make_unique<Impl>()) | ||||||
| { | { | ||||||
|    RegisterVariables({&p->antiAliasingEnabled_, //
 |    RegisterVariables({&p->antiAliasingEnabled_, | ||||||
|                       &p->clockFormat_, |                       &p->clockFormat_, | ||||||
|  |                       &p->customStyleDrawLayer_, | ||||||
|  |                       &p->customStyleUrl_, | ||||||
|                       &p->debugEnabled_, |                       &p->debugEnabled_, | ||||||
|                       &p->defaultAlertAction_, |                       &p->defaultAlertAction_, | ||||||
|                       &p->defaultRadarSite_, |                       &p->defaultRadarSite_, | ||||||
|  | @ -201,6 +211,16 @@ SettingsVariable<std::string>& GeneralSettings::clock_format() const | ||||||
|    return p->clockFormat_; |    return p->clockFormat_; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | SettingsVariable<std::string>& GeneralSettings::custom_style_draw_layer() const | ||||||
|  | { | ||||||
|  |    return p->customStyleDrawLayer_; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | SettingsVariable<std::string>& GeneralSettings::custom_style_url() const | ||||||
|  | { | ||||||
|  |    return p->customStyleUrl_; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| SettingsVariable<bool>& GeneralSettings::debug_enabled() const | SettingsVariable<bool>& GeneralSettings::debug_enabled() const | ||||||
| { | { | ||||||
|    return p->debugEnabled_; |    return p->debugEnabled_; | ||||||
|  | @ -340,6 +360,8 @@ bool operator==(const GeneralSettings& lhs, const GeneralSettings& rhs) | ||||||
| { | { | ||||||
|    return (lhs.p->antiAliasingEnabled_ == rhs.p->antiAliasingEnabled_ && |    return (lhs.p->antiAliasingEnabled_ == rhs.p->antiAliasingEnabled_ && | ||||||
|            lhs.p->clockFormat_ == rhs.p->clockFormat_ && |            lhs.p->clockFormat_ == rhs.p->clockFormat_ && | ||||||
|  |            lhs.p->customStyleDrawLayer_ == rhs.p->customStyleDrawLayer_ && | ||||||
|  |            lhs.p->customStyleUrl_ == rhs.p->customStyleUrl_ && | ||||||
|            lhs.p->debugEnabled_ == rhs.p->debugEnabled_ && |            lhs.p->debugEnabled_ == rhs.p->debugEnabled_ && | ||||||
|            lhs.p->defaultAlertAction_ == rhs.p->defaultAlertAction_ && |            lhs.p->defaultAlertAction_ == rhs.p->defaultAlertAction_ && | ||||||
|            lhs.p->defaultRadarSite_ == rhs.p->defaultRadarSite_ && |            lhs.p->defaultRadarSite_ == rhs.p->defaultRadarSite_ && | ||||||
|  |  | ||||||
|  | @ -27,6 +27,8 @@ public: | ||||||
| 
 | 
 | ||||||
|    SettingsVariable<bool>&        anti_aliasing_enabled() const; |    SettingsVariable<bool>&        anti_aliasing_enabled() const; | ||||||
|    SettingsVariable<std::string>& clock_format() const; |    SettingsVariable<std::string>& clock_format() const; | ||||||
|  |    SettingsVariable<std::string>& custom_style_draw_layer() const; | ||||||
|  |    SettingsVariable<std::string>& custom_style_url() const; | ||||||
|    SettingsVariable<bool>&        debug_enabled() const; |    SettingsVariable<bool>&        debug_enabled() const; | ||||||
|    SettingsVariable<std::string>& default_alert_action() const; |    SettingsVariable<std::string>& default_alert_action() const; | ||||||
|    SettingsVariable<std::string>& default_radar_site() const; |    SettingsVariable<std::string>& default_radar_site() const; | ||||||
|  |  | ||||||
|  | @ -1 +1 @@ | ||||||
| Subproject commit 6fe42c4f776ced46f0f808109d0d773ffc2255e3 | Subproject commit f631a9ffa16353d8560ecec7ee16f4e2ae20b310 | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat