mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Desktop: show filter panel with maximized dive list
This way we can filter both in the default layout and in the dive list layout. Fixes #1951 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									7b61cd7452
								
							
						
					
					
						commit
						2ae33376f7
					
				
					 2 changed files with 14 additions and 1 deletions
				
			
		|  | @ -1033,7 +1033,7 @@ void MainWindow::on_actionViewList_triggered() | ||||||
| 	toggleCollapsible(true); | 	toggleCollapsible(true); | ||||||
| 	beginChangeState(LIST_MAXIMIZED); | 	beginChangeState(LIST_MAXIMIZED); | ||||||
| 	ui.mainSplitter->setSizes({ COLLAPSED, EXPANDED }); | 	ui.mainSplitter->setSizes({ COLLAPSED, EXPANDED }); | ||||||
| 	ui.bottomSplitter->setSizes({ EXPANDED, COLLAPSED }); | 	showFilterIfEnabled(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MainWindow::on_actionViewProfile_triggered() | void MainWindow::on_actionViewProfile_triggered() | ||||||
|  | @ -1806,8 +1806,20 @@ void MainWindow::on_paste_triggered() | ||||||
| void MainWindow::on_actionFilterTags_triggered() | void MainWindow::on_actionFilterTags_triggered() | ||||||
| { | { | ||||||
| 	setApplicationState(getCurrentAppState() == "FilterDive" ? "Default" : "FilterDive"); | 	setApplicationState(getCurrentAppState() == "FilterDive" ? "Default" : "FilterDive"); | ||||||
|  | 	if (state == LIST_MAXIMIZED) | ||||||
|  | 		showFilterIfEnabled(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void MainWindow::showFilterIfEnabled() | ||||||
|  | { | ||||||
|  | 	if (getCurrentAppState() == "FilterDive") { | ||||||
|  | 		const int appW = qApp->desktop()->size().width(); | ||||||
|  | 		QList<int> profileFilterSizes = { round_int(appW * 0.7), round_int(appW * 0.3) }; | ||||||
|  | 		ui.bottomSplitter->setSizes(profileFilterSizes); | ||||||
|  | 	} else { | ||||||
|  | 		ui.bottomSplitter->setSizes({ EXPANDED, COLLAPSED }); | ||||||
|  | 	} | ||||||
|  | } | ||||||
| void MainWindow::registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight) | void MainWindow::registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight) | ||||||
| { | { | ||||||
| 	applicationState[state] = WidgetForQuadrant(topLeft, topRight, bottomLeft, bottomRight); | 	applicationState[state] = WidgetForQuadrant(topLeft, topRight, bottomLeft, bottomRight); | ||||||
|  |  | ||||||
|  | @ -207,6 +207,7 @@ private: | ||||||
| 	void beginChangeState(CurrentState s); | 	void beginChangeState(CurrentState s); | ||||||
| 	void saveSplitterSizes(); | 	void saveSplitterSizes(); | ||||||
| 	void toggleCollapsible(bool toggle); | 	void toggleCollapsible(bool toggle); | ||||||
|  | 	void showFilterIfEnabled(); | ||||||
| 	void updateLastUsedDir(const QString &s); | 	void updateLastUsedDir(const QString &s); | ||||||
| 	void registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight); | 	void registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight); | ||||||
| 	void enterState(CurrentState); | 	void enterState(CurrentState); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue