StelGuiItems.cpp   StelGuiItems.cpp 
skipping to change at line 54 skipping to change at line 54
#include <QMouseEvent> #include <QMouseEvent>
#include <QRegExp> #include <QRegExp>
#include <QPixmapCache> #include <QPixmapCache>
#include <QProgressBar> #include <QProgressBar>
#include <QGraphicsWidget> #include <QGraphicsWidget>
#include <QGraphicsProxyWidget> #include <QGraphicsProxyWidget>
#include <QGraphicsLinearLayout> #include <QGraphicsLinearLayout>
#include <QSettings> #include <QSettings>
// Inspired by text-use-opengl-buffer branch: work around font problems in GUI buttons. // Inspired by text-use-opengl-buffer branch: work around font problems in GUI buttons.
// May be useful in other broken OpenGL font situations. RasPi necessity as of 2016-03-26. // May be useful in other broken OpenGL font situations. RasPi necessity as of 2016-03-26. Mesa 13 (2016-11) has finally fixed this on RasPi(VC4).
QPixmap getTextPixmap(const QString& str, QFont font) QPixmap getTextPixmap(const QString& str, QFont font)
{ {
// Render the text str into a QPixmap. // Render the text str into a QPixmap.
QRect strRect = QFontMetrics(font).boundingRect(str); QRect strRect = QFontMetrics(font).boundingRect(str);
int w = strRect.width()+1+(int)(0.02f*strRect.width()); int w = strRect.width()+1+(int)(0.02f*strRect.width());
int h = strRect.height(); int h = strRect.height();
QPixmap strPixmap(w, h); QPixmap strPixmap(w, h);
strPixmap.fill(Qt::transparent); strPixmap.fill(Qt::transparent);
QPainter painter(&strPixmap); QPainter painter(&strPixmap);
skipping to change at line 203 skipping to change at line 203
timeLine->start(); timeLine->start();
emit(hoverChanged(false)); emit(hoverChanged(false));
} }
void StelButton::mouseReleaseEvent(QGraphicsSceneMouseEvent*) void StelButton::mouseReleaseEvent(QGraphicsSceneMouseEvent*)
{ {
if (action!=NULL && !action->isCheckable()) if (action!=NULL && !action->isCheckable())
setChecked(toggleChecked(checked)); setChecked(toggleChecked(checked));
if (flagChangeFocus) // true if button is on bottom bar if (flagChangeFocus) // true if button is on bottom bar
StelMainView::getInstance().setFocusOnSky(); // Change the f ocus after clicking on button StelMainView::getInstance().focusSky(); // Change the focus after clicking on button
} }
void StelButton::updateIcon() void StelButton::updateIcon()
{ {
if (opacity < 0.) if (opacity < 0.)
opacity = 0; opacity = 0;
QPixmap pix(pixOn.size()); QPixmap pix(pixOn.size());
pix.fill(QColor(0,0,0,0)); pix.fill(QColor(0,0,0,0));
QPainter painter(&pix); QPainter painter(&pix);
painter.setOpacity(opacity); painter.setOpacity(opacity);
skipping to change at line 634 skipping to change at line 634
newDateInfo = QString("JD %1").arg(jd, 0, 'f', 6); newDateInfo = QString("JD %1").arg(jd, 0, 'f', 6);
} }
QString planetName = core->getCurrentLocation().planetName; QString planetName = core->getCurrentLocation().planetName;
QString tzName = core->getCurrentTimeZone(); QString tzName = core->getCurrentTimeZone();
if (tzName.contains("system_default") || (tzName.isEmpty() && planet Name=="Earth")) if (tzName.contains("system_default") || (tzName.isEmpty() && planet Name=="Earth"))
tzName = q_("System default"); tzName = q_("System default");
QString currTZ = QString("%1: %2").arg(q_("Time zone")).arg(tzName); QString currTZ = QString("%1: %2").arg(q_("Time zone")).arg(tzName);
if (tzName.contains("LMST") || tzName.contains("auto") || (planetNam e=="Earth" && jd<=StelCore::TZ_ERA_BEGINNING) || planetName!="Earth") if (tzName.contains("LMST") || tzName.contains("auto") || (planetNam e=="Earth" && jd<=StelCore::TZ_ERA_BEGINNING && !core->getUseCustomTimeZone ()) || planetName!="Earth")
currTZ = q_("Local Mean Solar Time"); currTZ = q_("Local Mean Solar Time");
if (tzName.contains("LTST")) if (tzName.contains("LTST"))
currTZ = q_("Local True Solar Time"); currTZ = q_("Local True Solar Time");
if (datetime->text()!=newDateInfo) updatePos = true;
{ datetime->setText(newDateInfo);
updatePos = true; if (core->getCurrentDeltaTAlgorithm()!=StelCore::WithoutCorrection)
datetime->setText(newDateInfo); {
if (core->getCurrentDeltaTAlgorithm()!=StelCore::WithoutCorr if (sigma>0)
ection) sigmaInfo = QString("; %1(%2T) = %3s").arg(QChar(0x0
{ 3c3)).arg(QChar(0x0394)).arg(sigma, 3, 'f', 1);
if (sigma>0)
sigmaInfo = QString("; %1(%2T) = %3s").arg(Q QString deltaTInfo = "";
Char(0x03c3)).arg(QChar(0x0394)).arg(sigma, 3, 'f', 1); if (qAbs(deltaT)>60.)
deltaTInfo = QString("%1 (%2s)%3").arg(StelUtils::ho
QString deltaTInfo = ""; ursToHmsStr(deltaT/3600.)).arg(deltaT, 5, 'f', 2).arg(validRangeMarker);
if (qAbs(deltaT)>60.) else
deltaTInfo = QString("%1 (%2s)%3").arg(StelU deltaTInfo = QString("%1s%2").arg(deltaT, 3, 'f', 3)
tils::hoursToHmsStr(deltaT/3600.)).arg(deltaT, 5, 'f', 2).arg(validRangeMar .arg(validRangeMarker);
ker);
else
deltaTInfo = QString("%1s%2").arg(deltaT, 3,
'f', 3).arg(validRangeMarker);
float ndot = -23.8946f; // the corrective ndot to be displayed could be set accordin
if (core->de430IsActive() || core->de431IsActive()) g to the currently used DeltaT algorithm.
ndot = -25.8f; //float ndot=core->getDeltaTnDot();
// or just to the used ephemeris. This has to be read as "Se
lected DeltaT formula used, but with the ephemeris's nDot applied it correc
ts DeltaT to..."
float ndot=( (core->de430IsActive() || core->de431IsActive()
) ? -25.8f : -23.8946f );
datetime->setToolTip(QString("<p style='white-space: datetime->setToolTip(QString("<p style='white-space:pre'>%1T
pre'>%1T = %2 [n-dot @ %3\"/cy%4%5]<br>%6<br>%7</p>").arg(QChar(0x0394)).ar = %2 [n%8 @ %3\"/cy%4%5]<br>%6<br>%7</p>").arg(QChar(0x0394)).arg(deltaTIn
g(deltaTInfo).arg(QString::number(ndot, 'f', 4)).arg(QChar(0x00B2)).arg(sig fo).arg(QString::number(ndot, 'f', 4)).arg(QChar(0x00B2)).arg(sigmaInfo).ar
maInfo).arg(newDateAppx).arg(currTZ)); g(newDateAppx).arg(currTZ).arg(QChar(0x2032)));
} }
else else
datetime->setToolTip(QString("<p style='white-space: datetime->setToolTip(QString("<p style='white-space:pre'>%1<
pre'>%1<br>%2</p>").arg(newDateAppx).arg(currTZ)); br>%2</p>").arg(newDateAppx).arg(currTZ));
if (qApp->property("text_texture")==true) // CLI option -t g if (qApp->property("text_texture")==true) // CLI option -t given?
iven? {
{ datetime->setVisible(false); // hide normal thingy.
datetime->setVisible(false); // hide normal thingy. datetimePixmap->setPixmap(getTextPixmap(newDateInfo, datetim
datetimePixmap->setPixmap(getTextPixmap(newDateInfo, e->font()));
datetime->font()));
}
} }
// build location tooltip // build location tooltip
QString newLocation = ""; QString newLocation = "";
const StelLocation* loc = &core->getCurrentLocation(); const StelLocation* loc = &core->getCurrentLocation();
const StelTranslator& trans = locmgr.getSkyTranslator(); const StelTranslator& trans = locmgr.getSkyTranslator();
if (getFlagShowLocation() && !loc->name.isEmpty()) if (getFlagShowLocation() && !loc->name.isEmpty())
{ {
newLocation = trans.qtranslate(loc->planetName) +", "+loc->n ame + ", "+q_("%1m").arg(loc->altitude); newLocation = trans.qtranslate(loc->planetName) +", "+loc->n ame + ", "+q_("%1m").arg(loc->altitude);
} }
 End of changes. 7 change blocks. 
40 lines changed or deleted 39 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/