mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:20:05 +00:00 
			
		
		
		
	Add hover text wrap to settings
This commit is contained in:
		
							parent
							
								
									fc6cdc729b
								
							
						
					
					
						commit
						f9e69d15e4
					
				
					 10 changed files with 218 additions and 10 deletions
				
			
		
							
								
								
									
										56
									
								
								scwx-qt/source/scwx/qt/settings/text_settings.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								scwx-qt/source/scwx/qt/settings/text_settings.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,56 @@ | |||
| #include <scwx/qt/settings/text_settings.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace settings | ||||
| { | ||||
| 
 | ||||
| static const std::string logPrefix_ = "scwx::qt::settings::text_settings"; | ||||
| 
 | ||||
| class TextSettings::Impl | ||||
| { | ||||
| public: | ||||
|    explicit Impl() | ||||
|    { | ||||
|       hoverTextWrap_.SetDefault(80); | ||||
|       hoverTextWrap_.SetMinimum(0); | ||||
|       hoverTextWrap_.SetMaximum(999); | ||||
|    } | ||||
| 
 | ||||
|    ~Impl() {} | ||||
| 
 | ||||
|    SettingsVariable<std::int64_t> hoverTextWrap_ {"hover_text_wrap"}; | ||||
| }; | ||||
| 
 | ||||
| TextSettings::TextSettings() : | ||||
|     SettingsCategory("text"), p(std::make_unique<Impl>()) | ||||
| { | ||||
|    RegisterVariables({&p->hoverTextWrap_}); | ||||
|    SetDefaults(); | ||||
| } | ||||
| TextSettings::~TextSettings() = default; | ||||
| 
 | ||||
| TextSettings::TextSettings(TextSettings&&) noexcept            = default; | ||||
| TextSettings& TextSettings::operator=(TextSettings&&) noexcept = default; | ||||
| 
 | ||||
| SettingsVariable<std::int64_t>& TextSettings::hover_text_wrap() const | ||||
| { | ||||
|    return p->hoverTextWrap_; | ||||
| } | ||||
| 
 | ||||
| TextSettings& TextSettings::Instance() | ||||
| { | ||||
|    static TextSettings TextSettings_; | ||||
|    return TextSettings_; | ||||
| } | ||||
| 
 | ||||
| bool operator==(const TextSettings& lhs, const TextSettings& rhs) | ||||
| { | ||||
|    return (lhs.p->hoverTextWrap_ == rhs.p->hoverTextWrap_); | ||||
| } | ||||
| 
 | ||||
| } // namespace settings
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat