mirror of https://github.com/procxx/kepka.git
				
				
				
			Disable touchbar on macOS < 10.13.
This commit is contained in:
		
							parent
							
								
									0f08342533
								
							
						
					
					
						commit
						f1e3d2f513
					
				|  | @ -83,6 +83,7 @@ protected: | |||
| 	void closeWithoutDestroy() override; | ||||
| 
 | ||||
| private: | ||||
| 	void initTouchBar(); | ||||
| 	void hideAndDeactivate(); | ||||
| 	void createGlobalMenu(); | ||||
| 	void updateTitleCounter(); | ||||
|  |  | |||
|  | @ -396,6 +396,21 @@ MainWindow::MainWindow() | |||
| 		} | ||||
| 	}); | ||||
| 
 | ||||
| 	initTouchBar(); | ||||
| } | ||||
| 
 | ||||
| void MainWindow::initTouchBar() { | ||||
| 	const int version = QSysInfo::macVersion(); | ||||
| 	constexpr int kShift = 2; | ||||
| 	if (version == QSysInfo::MV_Unknown | ||||
| #ifndef OS_MAC_OLD | ||||
| 		|| version == QSysInfo::MV_None | ||||
| #endif // OS_MAC_OLD | ||||
| 		// Allow touch bar only starting with 10.13. | ||||
| 		|| version < kShift + 13) { | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	subscribe(Core::App().authSessionChanged(), [this] { | ||||
| 		if (AuthSession::Exists()) { | ||||
| 			// We need only common pinned dialogs. | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue