mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-30 23:40:06 +00:00 
			
		
		
		
	Add anti-aliasing to settings
This commit is contained in:
		
							parent
							
								
									3a754c01c5
								
							
						
					
					
						commit
						c5a56680ea
					
				
					 6 changed files with 32 additions and 6 deletions
				
			
		|  | @ -200,10 +200,13 @@ public slots: | |||
| 
 | ||||
| MapWidget::MapWidget(const QMapLibreGL::Settings& settings) : | ||||
|     p(std::make_unique<MapWidgetImpl>(this, settings)) | ||||
| { | ||||
|    if (settings::GeneralSettings::Instance().anti_aliasing_enabled().GetValue()) | ||||
|    { | ||||
|       QSurfaceFormat surfaceFormat = QSurfaceFormat::defaultFormat(); | ||||
|       surfaceFormat.setSamples(4); | ||||
|       setFormat(surfaceFormat); | ||||
|    } | ||||
| 
 | ||||
|    setFocusPolicy(Qt::StrongFocus); | ||||
| 
 | ||||
|  |  | |||
|  | @ -29,6 +29,7 @@ public: | |||
|       boost::to_lower(defaultDefaultAlertActionValue); | ||||
|       boost::to_lower(defaultMapProviderValue); | ||||
| 
 | ||||
|       antiAliasingEnabled_.SetDefault(true); | ||||
|       debugEnabled_.SetDefault(false); | ||||
|       defaultAlertAction_.SetDefault(defaultDefaultAlertActionValue); | ||||
|       defaultRadarSite_.SetDefault("KLSX"); | ||||
|  | @ -104,6 +105,7 @@ public: | |||
| 
 | ||||
|    ~Impl() {} | ||||
| 
 | ||||
|    SettingsVariable<bool>        antiAliasingEnabled_ {"anti_aliasing_enabled"}; | ||||
|    SettingsVariable<bool>        debugEnabled_ {"debug_enabled"}; | ||||
|    SettingsVariable<std::string> defaultAlertAction_ {"default_alert_action"}; | ||||
|    SettingsVariable<std::string> defaultRadarSite_ {"default_radar_site"}; | ||||
|  | @ -122,7 +124,8 @@ public: | |||
| GeneralSettings::GeneralSettings() : | ||||
|     SettingsCategory("general"), p(std::make_unique<Impl>()) | ||||
| { | ||||
|    RegisterVariables({&p->debugEnabled_, | ||||
|    RegisterVariables({&p->antiAliasingEnabled_, | ||||
|                       &p->debugEnabled_, | ||||
|                       &p->defaultAlertAction_, | ||||
|                       &p->defaultRadarSite_, | ||||
|                       &p->fontSizes_, | ||||
|  | @ -143,6 +146,11 @@ GeneralSettings::GeneralSettings(GeneralSettings&&) noexcept = default; | |||
| GeneralSettings& | ||||
| GeneralSettings::operator=(GeneralSettings&&) noexcept = default; | ||||
| 
 | ||||
| SettingsVariable<bool>& GeneralSettings::anti_aliasing_enabled() const | ||||
| { | ||||
|    return p->antiAliasingEnabled_; | ||||
| } | ||||
| 
 | ||||
| SettingsVariable<bool>& GeneralSettings::debug_enabled() const | ||||
| { | ||||
|    return p->debugEnabled_; | ||||
|  | @ -229,7 +237,8 @@ GeneralSettings& GeneralSettings::Instance() | |||
| 
 | ||||
| bool operator==(const GeneralSettings& lhs, const GeneralSettings& rhs) | ||||
| { | ||||
|    return (lhs.p->debugEnabled_ == rhs.p->debugEnabled_ && | ||||
|    return (lhs.p->antiAliasingEnabled_ == rhs.p->antiAliasingEnabled_ && | ||||
|            lhs.p->debugEnabled_ == rhs.p->debugEnabled_ && | ||||
|            lhs.p->defaultAlertAction_ == rhs.p->defaultAlertAction_ && | ||||
|            lhs.p->defaultRadarSite_ == rhs.p->defaultRadarSite_ && | ||||
|            lhs.p->fontSizes_ == rhs.p->fontSizes_ && | ||||
|  |  | |||
|  | @ -25,6 +25,7 @@ public: | |||
|    GeneralSettings(GeneralSettings&&) noexcept; | ||||
|    GeneralSettings& operator=(GeneralSettings&&) noexcept; | ||||
| 
 | ||||
|    SettingsVariable<bool>&                       anti_aliasing_enabled() const; | ||||
|    SettingsVariable<bool>&                       debug_enabled() const; | ||||
|    SettingsVariable<std::string>&                default_alert_action() const; | ||||
|    SettingsVariable<std::string>&                default_radar_site() const; | ||||
|  |  | |||
|  | @ -99,6 +99,7 @@ public: | |||
|           &mapboxApiKey_, | ||||
|           &mapTilerApiKey_, | ||||
|           &defaultAlertAction_, | ||||
|           &antiAliasingEnabled_, | ||||
|           &updateNotificationsEnabled_, | ||||
|           &debugEnabled_, | ||||
|           &hoverTextWrap_, | ||||
|  | @ -176,6 +177,7 @@ public: | |||
|    settings::SettingsInterface<std::string>  mapboxApiKey_ {}; | ||||
|    settings::SettingsInterface<std::string>  mapTilerApiKey_ {}; | ||||
|    settings::SettingsInterface<std::string>  defaultAlertAction_ {}; | ||||
|    settings::SettingsInterface<bool>         antiAliasingEnabled_ {}; | ||||
|    settings::SettingsInterface<bool>         updateNotificationsEnabled_ {}; | ||||
|    settings::SettingsInterface<bool>         debugEnabled_ {}; | ||||
| 
 | ||||
|  | @ -511,6 +513,10 @@ void SettingsDialogImpl::SetupGeneralTab() | |||
|    defaultAlertAction_.SetEditWidget(self_->ui->defaultAlertActionComboBox); | ||||
|    defaultAlertAction_.SetResetButton(self_->ui->resetDefaultAlertActionButton); | ||||
| 
 | ||||
|    antiAliasingEnabled_.SetSettingsVariable( | ||||
|       generalSettings.anti_aliasing_enabled()); | ||||
|    antiAliasingEnabled_.SetEditWidget(self_->ui->antiAliasingEnabledCheckBox); | ||||
| 
 | ||||
|    updateNotificationsEnabled_.SetSettingsVariable( | ||||
|       generalSettings.update_notifications_enabled()); | ||||
|    updateNotificationsEnabled_.SetEditWidget( | ||||
|  |  | |||
|  | @ -292,6 +292,13 @@ | |||
|             </layout> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item> | ||||
|            <widget class="QCheckBox" name="antiAliasingEnabledCheckBox"> | ||||
|             <property name="text"> | ||||
|              <string>Anti-Aliasing Enabled</string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item> | ||||
|            <widget class="QCheckBox" name="enableUpdateNotificationsCheckBox"> | ||||
|             <property name="text"> | ||||
|  |  | |||
|  | @ -1 +1 @@ | |||
| Subproject commit 58d61ba37385c699df1eca547668ec3c2a93871e | ||||
| Subproject commit fc428fa1460b3d5ce04646727e379e2f4f90f5ec | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat