summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-14 19:44:42 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-14 19:44:42 (GMT)
commit5ec1c8c947120f20bc6ab3b08256aa934d3ac271 (patch)
tree5c1a60c36b965d6c4e221dc55b9d521158d99ee7
parent9e82b30fe779d138741c38826acd5e9b4ca3069a (diff)
Improve visibility of the magnitude number in the labels.
-rw-r--r--kstars/skyobjects/deepskyobject.cpp13
-rw-r--r--kstars/skyobjects/starobject.cpp6
2 files changed, 11 insertions, 8 deletions
diff --git a/kstars/skyobjects/deepskyobject.cpp b/kstars/skyobjects/deepskyobject.cpp
index 27fda13..9f1d63a 100644
--- a/kstars/skyobjects/deepskyobject.cpp
+++ b/kstars/skyobjects/deepskyobject.cpp
@@ -157,19 +157,22 @@ double DeepSkyObject::labelOffset() const {
return 0.5*size + 4.;
}
-QString DeepSkyObject::labelString() const {
+QString DeepSkyObject::labelString() const
+{
QString oName;
- if( Options::showDeepSkyNames() ) {
+ if( Options::showDeepSkyNames() )
+ {
if( Options::deepSkyLongLabels() && translatedLongName() != translatedName() )
oName = translatedLongName() + " (" + translatedName() + ')';
else
oName = translatedName();
}
- if( Options::showDeepSkyMagnitudes() ) {
+ if( Options::showDeepSkyMagnitudes() )
+ {
if( Options::showDeepSkyNames() )
- oName += "; ";
- oName += QLocale().toString( mag(), 1 );
+ oName += " ";
+ oName += "[" + QLocale().toString( mag(), 'f', 1 ) + "m]";
}
return oName;
diff --git a/kstars/skyobjects/starobject.cpp b/kstars/skyobjects/starobject.cpp
index 22f5e7c..264bf48 100644
--- a/kstars/skyobjects/starobject.cpp
+++ b/kstars/skyobjects/starobject.cpp
@@ -552,14 +552,14 @@ QString StarObject::nameLabel( bool drawName, bool drawMag ) const
sName = gname( true );
else {
if ( drawMag )
- return QLocale().toString( mag(), 1 );
+ return ("[" + QLocale().toString( mag(), 'f', 1 ) + "m]");
}
if ( ! drawMag )
return sName;
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()??