mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 08:50:05 +00:00 
			
		
		
		
	added saving geometry
This commit is contained in:
		
							parent
							
								
									449912e655
								
							
						
					
					
						commit
						1b16b903a0
					
				
					 3 changed files with 27 additions and 5 deletions
				
			
		|  | @ -20,6 +20,7 @@ public: | |||
|       mapSettingsExpanded_.SetDefault(true); | ||||
|       timelineExpanded_.SetDefault(true); | ||||
|       mainUIState_.SetDefault(""); | ||||
|       mainUIGeometry_.SetDefault(""); | ||||
|    } | ||||
| 
 | ||||
|    ~UiSettingsImpl() {} | ||||
|  | @ -30,6 +31,7 @@ public: | |||
|    SettingsVariable<bool> mapSettingsExpanded_ {"map_settings_expanded"}; | ||||
|    SettingsVariable<bool> timelineExpanded_ {"timeline_expanded"}; | ||||
|    SettingsVariable<std::string> mainUIState_ {"main_ui_state"}; | ||||
|    SettingsVariable<std::string> mainUIGeometry_ {"main_ui_geometry"}; | ||||
| }; | ||||
| 
 | ||||
| UiSettings::UiSettings() : | ||||
|  | @ -40,7 +42,8 @@ UiSettings::UiSettings() : | |||
|                       &p->level3ProductsExpanded_, | ||||
|                       &p->mapSettingsExpanded_, | ||||
|                       &p->timelineExpanded_, | ||||
|                       &p->mainUIState_}); | ||||
|                       &p->mainUIState_, | ||||
|                       &p->mainUIGeometry_}); | ||||
|    SetDefaults(); | ||||
| } | ||||
| UiSettings::~UiSettings() = default; | ||||
|  | @ -78,6 +81,11 @@ SettingsVariable<std::string>& UiSettings::main_ui_state() const | |||
|    return p->mainUIState_; | ||||
| } | ||||
| 
 | ||||
| SettingsVariable<std::string>& UiSettings::main_ui_geometry() const | ||||
| { | ||||
|    return p->mainUIGeometry_; | ||||
| } | ||||
| 
 | ||||
| bool UiSettings::Shutdown() | ||||
| { | ||||
|    bool dataChanged = false; | ||||
|  | @ -89,6 +97,7 @@ bool UiSettings::Shutdown() | |||
|    dataChanged |= p->mapSettingsExpanded_.Commit(); | ||||
|    dataChanged |= p->timelineExpanded_.Commit(); | ||||
|    dataChanged |= p->mainUIState_.Commit(); | ||||
|    dataChanged |= p->mainUIGeometry_.Commit(); | ||||
| 
 | ||||
|    return dataChanged; | ||||
| } | ||||
|  | @ -106,7 +115,8 @@ bool operator==(const UiSettings& lhs, const UiSettings& rhs) | |||
|            lhs.p->level3ProductsExpanded_ == rhs.p->level3ProductsExpanded_ && | ||||
|            lhs.p->mapSettingsExpanded_ == rhs.p->mapSettingsExpanded_ && | ||||
|            lhs.p->timelineExpanded_ == rhs.p->timelineExpanded_ && | ||||
|            lhs.p->mainUIState_ == rhs.p->mainUIState_); | ||||
|            lhs.p->mainUIState_ == rhs.p->mainUIState_ && | ||||
|            lhs.p->mainUIGeometry_ == rhs.p->mainUIGeometry_); | ||||
| } | ||||
| 
 | ||||
| } // namespace settings
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak