mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Replace macro TOGGLE_COLLAPSABLE by function toggleCollapsible()
There was no reason to do this in a macro. Let the compiler decide if it wants to inline or not. Note that for consistency with the Qt functions, collapsAble was replaced by collabsIble. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									b4e36c5912
								
							
						
					
					
						commit
						f8517c583b
					
				
					 2 changed files with 15 additions and 14 deletions
				
			
		|  | @ -1117,17 +1117,19 @@ void MainWindow::on_actionYearlyStatistics_triggered() | |||
| 
 | ||||
| #define BEHAVIOR QList<int>() | ||||
| 
 | ||||
| #define TOGGLE_COLLAPSABLE( X ) \ | ||||
| 	ui.mainSplitter->setCollapsible(0, X); \ | ||||
| 	ui.mainSplitter->setCollapsible(1, X); \ | ||||
| 	ui.topSplitter->setCollapsible(0, X); \ | ||||
| 	ui.topSplitter->setCollapsible(1, X); \ | ||||
| 	ui.bottomSplitter->setCollapsible(0, X); \ | ||||
| 	ui.bottomSplitter->setCollapsible(1, X); | ||||
| void MainWindow::toggleCollapsible(bool toggle) | ||||
| { | ||||
| 	ui.mainSplitter->setCollapsible(0, toggle); | ||||
| 	ui.mainSplitter->setCollapsible(1, toggle); | ||||
| 	ui.topSplitter->setCollapsible(0, toggle); | ||||
| 	ui.topSplitter->setCollapsible(1, toggle); | ||||
| 	ui.bottomSplitter->setCollapsible(0, toggle); | ||||
| 	ui.bottomSplitter->setCollapsible(1, toggle); | ||||
| } | ||||
| 
 | ||||
| void MainWindow::on_actionViewList_triggered() | ||||
| { | ||||
| 	TOGGLE_COLLAPSABLE( true ); | ||||
| 	toggleCollapsible(true); | ||||
| 	beginChangeState(LIST_MAXIMIZED); | ||||
| 	ui.mainSplitter->setSizes(BEHAVIOR << COLLAPSED << EXPANDED); | ||||
| 	ui.bottomSplitter->setSizes(BEHAVIOR << EXPANDED << COLLAPSED); | ||||
|  | @ -1135,7 +1137,7 @@ void MainWindow::on_actionViewList_triggered() | |||
| 
 | ||||
| void MainWindow::on_actionViewProfile_triggered() | ||||
| { | ||||
| 	TOGGLE_COLLAPSABLE( true ); | ||||
| 	toggleCollapsible(true); | ||||
| 	beginChangeState(PROFILE_MAXIMIZED); | ||||
| 	ui.topSplitter->setSizes(BEHAVIOR << COLLAPSED << EXPANDED); | ||||
| 	ui.mainSplitter->setSizes(BEHAVIOR << EXPANDED << COLLAPSED); | ||||
|  | @ -1143,7 +1145,7 @@ void MainWindow::on_actionViewProfile_triggered() | |||
| 
 | ||||
| void MainWindow::on_actionViewInfo_triggered() | ||||
| { | ||||
| 	TOGGLE_COLLAPSABLE( true ); | ||||
| 	toggleCollapsible(true); | ||||
| 	beginChangeState(INFO_MAXIMIZED); | ||||
| 	ui.topSplitter->setSizes(BEHAVIOR << EXPANDED << COLLAPSED); | ||||
| 	ui.mainSplitter->setSizes(BEHAVIOR << EXPANDED << COLLAPSED); | ||||
|  | @ -1151,7 +1153,7 @@ void MainWindow::on_actionViewInfo_triggered() | |||
| 
 | ||||
| void MainWindow::on_actionViewMap_triggered() | ||||
| { | ||||
| 	TOGGLE_COLLAPSABLE( true ); | ||||
| 	toggleCollapsible(true); | ||||
| 	beginChangeState(MAP_MAXIMIZED); | ||||
| 	ui.mainSplitter->setSizes(BEHAVIOR << COLLAPSED << EXPANDED); | ||||
| 	ui.bottomSplitter->setSizes(BEHAVIOR << COLLAPSED << EXPANDED); | ||||
|  | @ -1160,7 +1162,7 @@ void MainWindow::on_actionViewMap_triggered() | |||
| 
 | ||||
| void MainWindow::on_actionViewAll_triggered() | ||||
| { | ||||
| 	TOGGLE_COLLAPSABLE( false ); | ||||
| 	toggleCollapsible(false); | ||||
| 	beginChangeState(VIEWALL); | ||||
| 	static QList<int> mainSizes; | ||||
| 	const int appH = qApp->desktop()->size().height(); | ||||
|  | @ -1207,8 +1209,6 @@ void MainWindow::on_actionViewAll_triggered() | |||
| 	ui.bottomSplitter->setCollapsible(1,false); | ||||
| } | ||||
| 
 | ||||
| #undef TOGGLE_COLLAPSABLE | ||||
| 
 | ||||
| void MainWindow::beginChangeState(CurrentState s) | ||||
| { | ||||
| 	if (state == VIEWALL && state != s) { | ||||
|  |  | |||
|  | @ -205,6 +205,7 @@ private: | |||
| 	int file_save_as(); | ||||
| 	void beginChangeState(CurrentState s); | ||||
| 	void saveSplitterSizes(); | ||||
| 	void toggleCollapsible(bool toggle); | ||||
| 	QString lastUsedDir(); | ||||
| 	void updateLastUsedDir(const QString &s); | ||||
| 	void registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue