mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Correctly remove the Close button from most message widgets
The only time we want the close button is when showing an error at the bottom of the main window. In the other cases (maintab, globe) we need to explicitly hide it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									eca96ee8b7
								
							
						
					
					
						commit
						78fee70450
					
				
					 3 changed files with 6 additions and 1 deletions
				
			
		|  | @ -287,6 +287,7 @@ void GlobeGPS::prepareForGetDiveCoordinates() | |||
| 		messageWidget->setMessageType(KMessageWidget::Warning); | ||||
| 		messageWidget->setText(QObject::tr("Move the map and double-click to set the dive location")); | ||||
| 		messageWidget->setWordWrap(true); | ||||
| 		messageWidget->setCloseButtonVisible(false); | ||||
| 		messageWidget->animatedShow(); | ||||
| 		editingDiveLocation = true; | ||||
| 		if (!dive_has_gps_location(current_dive)) | ||||
|  |  | |||
|  | @ -61,7 +61,7 @@ void KMessageWidgetPrivate::init(KMessageWidget *q_ptr) | |||
| 	closeButton = new QToolButton(content); | ||||
| 	closeButton->setAutoRaise(true); | ||||
| 	closeButton->setDefaultAction(closeAction); | ||||
| 
 | ||||
| 	closeButton->setVisible(false); | ||||
| 	q->setMessageType(KMessageWidget::Information); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -227,6 +227,10 @@ void MainTab::closeMessage() | |||
| 
 | ||||
| void MainTab::displayMessage(QString str) | ||||
| { | ||||
| 	ui.diveNotesMessage->setCloseButtonVisible(false); | ||||
| 	ui.diveEquipmentMessage->setCloseButtonVisible(false); | ||||
| 	ui.diveInfoMessage->setCloseButtonVisible(false); | ||||
| 	ui.diveStatisticsMessage->setCloseButtonVisible(false); | ||||
| 	ui.diveNotesMessage->setText(str); | ||||
| 	ui.diveNotesMessage->animatedShow(); | ||||
| 	ui.diveEquipmentMessage->setText(str); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue