mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 03:23:24 +00:00
Calm down the Globe widget
This addresses two issues: - the kMessageWidget did not word wrap, so if it was wider then the Globe widget the Globe would expand (and divelist shrink) when the user switched from a dive with location to a dive without location - the code was also too aggressive removing and redrawing the message widget when switching from dive to dive. with this change we only hide the widget if the next dive has a location (and only show it if it isn't shown already). We also hide the message if no dive is selected. Reported-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
375faa5cff
commit
d8673f9867
1 changed files with 7 additions and 5 deletions
|
@ -76,7 +76,7 @@ void GlobeGPS::reload()
|
|||
void GlobeGPS::centerOn(dive* dive)
|
||||
{
|
||||
// dive has changed, if we had the 'editingDive', hide it.
|
||||
if(messageWidget->isVisible()){
|
||||
if(messageWidget->isVisible() && (!dive || dive_has_gps_location(dive))){
|
||||
messageWidget->animatedHide();
|
||||
}
|
||||
|
||||
|
@ -95,10 +95,12 @@ void GlobeGPS::centerOn(dive* dive)
|
|||
|
||||
void GlobeGPS::prepareForGetDiveCoordinates(dive* dive)
|
||||
{
|
||||
messageWidget->setMessageType(KMessageWidget::Warning);
|
||||
messageWidget->setText(QObject::tr("This dive has no location! Please move the planet to the desired position, then double-click to set the new location for this dive."));
|
||||
messageWidget->animatedShow();
|
||||
|
||||
if (!messageWidget->isVisible()) {
|
||||
messageWidget->setMessageType(KMessageWidget::Warning);
|
||||
messageWidget->setText(QObject::tr("This dive has no location! Please move the planet to the desired position, then double-click to set the new location for this dive."));
|
||||
messageWidget->setWordWrap(true);
|
||||
messageWidget->animatedShow();
|
||||
}
|
||||
editingDiveCoords = dive;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue