mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Close yearly statistics with shortcut
This enables closing the yearly statistics window with esc or ctrl+w keys. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									126106f9b0
								
							
						
					
					
						commit
						fcaf30081f
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -19,6 +19,7 @@ | ||||||
| #include <QDesktopServices> | #include <QDesktopServices> | ||||||
| #include <QStringList> | #include <QStringList> | ||||||
| #include <QSettings> | #include <QSettings> | ||||||
|  | #include <QShortcut> | ||||||
| #include "divelistview.h" | #include "divelistview.h" | ||||||
| #include "starwidget.h" | #include "starwidget.h" | ||||||
| 
 | 
 | ||||||
|  | @ -437,6 +438,10 @@ void MainWindow::on_actionYearlyStatistics_triggered() | ||||||
| 		yearlyStats->setMinimumWidth(600); | 		yearlyStats->setMinimumWidth(600); | ||||||
| 		yearlyStats->setWindowTitle(tr("Yearly Statistics")); | 		yearlyStats->setWindowTitle(tr("Yearly Statistics")); | ||||||
| 		yearlyStats->setWindowIcon(QIcon(":subsurface-icon")); | 		yearlyStats->setWindowIcon(QIcon(":subsurface-icon")); | ||||||
|  | 		QShortcut* closeKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), yearlyStats); | ||||||
|  | 		connect(closeKey, SIGNAL(activated()), yearlyStats, SLOT(close())); | ||||||
|  | 		closeKey = new QShortcut(QKeySequence(Qt::Key_Escape), yearlyStats); | ||||||
|  | 		connect(closeKey, SIGNAL(activated()), yearlyStats, SLOT(close())); | ||||||
| 	} | 	} | ||||||
| 	/* problem here is that without more MainWindow variables or a separate YearlyStatistics
 | 	/* problem here is that without more MainWindow variables or a separate YearlyStatistics
 | ||||||
| 	 * class the user needs to close the window/widget and re-open it for it to update. | 	 * class the user needs to close the window/widget and re-open it for it to update. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue