Commit 5ec1c8c9 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Improve visibility of the magnitude number in the labels.

parent 9e82b30f
...@@ -157,19 +157,22 @@ double DeepSkyObject::labelOffset() const { ...@@ -157,19 +157,22 @@ double DeepSkyObject::labelOffset() const {
return 0.5*size + 4.; return 0.5*size + 4.;
} }
QString DeepSkyObject::labelString() const { QString DeepSkyObject::labelString() const
{
QString oName; QString oName;
if( Options::showDeepSkyNames() ) { if( Options::showDeepSkyNames() )
{
if( Options::deepSkyLongLabels() && translatedLongName() != translatedName() ) if( Options::deepSkyLongLabels() && translatedLongName() != translatedName() )
oName = translatedLongName() + " (" + translatedName() + ')'; oName = translatedLongName() + " (" + translatedName() + ')';
else else
oName = translatedName(); oName = translatedName();
} }
if( Options::showDeepSkyMagnitudes() ) { if( Options::showDeepSkyMagnitudes() )
{
if( Options::showDeepSkyNames() ) if( Options::showDeepSkyNames() )
oName += "; "; oName += " ";
oName += QLocale().toString( mag(), 1 ); oName += "[" + QLocale().toString( mag(), 'f', 1 ) + "m]";
} }
return oName; return oName;
......
...@@ -552,14 +552,14 @@ QString StarObject::nameLabel( bool drawName, bool drawMag ) const ...@@ -552,14 +552,14 @@ QString StarObject::nameLabel( bool drawName, bool drawMag ) const
sName = gname( true ); sName = gname( true );
else { else {
if ( drawMag ) if ( drawMag )
return QLocale().toString( mag(), 1 ); return ("[" + QLocale().toString( mag(), 'f', 1 ) + "m]");
} }
if ( ! drawMag ) if ( ! drawMag )
return sName; return sName;
else else
return sName + ' ' + QLocale().toString( mag(), 1 ); return sName + " [" + QLocale().toString( mag(), 'f', 1 ) + "m]";
} }
return QLocale().toString( mag(), 1 ); return ("[" + QLocale().toString( mag(), 'f', 1 ) + "m]");
} }
//If this works, we can maybe get rid of customLabel() and nameLabel()?? //If this works, we can maybe get rid of customLabel() and nameLabel()??
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment