StelGuiItems.cpp   StelGuiItems.cpp 
skipping to change at line 78 skipping to change at line 78
painter.setPen(Qt::white); painter.setPen(Qt::white);
painter.drawText(-strRect.x(), -strRect.y(), str); painter.drawText(-strRect.x(), -strRect.y(), str);
return strPixmap; return strPixmap;
} }
void StelButton::initCtor(const QPixmap& apixOn, void StelButton::initCtor(const QPixmap& apixOn,
const QPixmap& apixOff, const QPixmap& apixOff,
const QPixmap& apixNoChange, const QPixmap& apixNoChange,
const QPixmap& apixHover, const QPixmap& apixHover,
StelAction* aaction, StelAction* aaction,
bool noBackground, bool noBackground,
bool isTristate) bool isTristate)
{ {
pixOn = apixOn; pixOn = apixOn;
pixOff = apixOff; pixOff = apixOff;
pixHover = apixHover; pixHover = apixHover;
pixNoChange = apixNoChange; pixNoChange = apixNoChange;
noBckground = !StelApp::getInstance().getSettings()->value("gui/flag _show_buttons_background", !noBackground).toBool(); noBckground = noBackground;
isTristate_ = isTristate; isTristate_ = isTristate;
opacity = 1.; opacity = 1.;
hoverOpacity = 0.; hoverOpacity = 0.;
action = aaction; action = aaction;
checked = false; checked = false;
flagChangeFocus = false; flagChangeFocus = false;
Q_ASSERT(!pixOn.isNull()); Q_ASSERT(!pixOn.isNull());
Q_ASSERT(!pixOff.isNull()); Q_ASSERT(!pixOff.isNull());
skipping to change at line 107 skipping to change at line 107
{ {
Q_ASSERT(!pixNoChange.isNull()); Q_ASSERT(!pixNoChange.isNull());
} }
setShapeMode(QGraphicsPixmapItem::BoundingRectShape); setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
setAcceptHoverEvents(true); setAcceptHoverEvents(true);
timeLine = new QTimeLine(250, this); timeLine = new QTimeLine(250, this);
timeLine->setCurveShape(QTimeLine::EaseOutCurve); timeLine->setCurveShape(QTimeLine::EaseOutCurve);
connect(timeLine, SIGNAL(valueChanged(qreal)), connect(timeLine, SIGNAL(valueChanged(qreal)),
this, SLOT(animValueChanged(qreal))); this, SLOT(animValueChanged(qreal)));
connect(&StelMainView::getInstance(), SIGNAL(updateIconsRequested()) , this, SLOT(updateIcon()));
if (action!=NULL) if (action!=Q_NULLPTR)
{ {
if (action->isCheckable()) if (action->isCheckable())
{ {
setChecked(action->isChecked()); setChecked(action->isChecked());
connect(action, SIGNAL(toggled(bool)), this, SLOT(se tChecked(bool))); connect(action, SIGNAL(toggled(bool)), this, SLOT(se tChecked(bool)));
connect(this, SIGNAL(toggled(bool)), action, SLOT(se tChecked(bool))); connect(this, SIGNAL(toggled(bool)), action, SLOT(se tChecked(bool)));
} }
else else
{ {
QObject::connect(this, SIGNAL(triggered()), action, SLOT(trigger())); QObject::connect(this, SIGNAL(triggered()), action, SLOT(trigger()));
} }
} }
} }
StelButton::StelButton(QGraphicsItem* parent, StelButton::StelButton(QGraphicsItem* parent,
const QPixmap& apixOn, const QPixmap& apixOn,
const QPixmap& apixOff, const QPixmap& apixOff,
const QPixmap& apixHover, const QPixmap& apixHover,
StelAction *aaction, StelAction *aaction,
bool noBackground) : bool noBackground) :
QGraphicsPixmapItem(apixOff, parent) QGraphicsPixmapItem(apixOff, parent)
{ {
initCtor(apixOn, apixOff, QPixmap(), apixHover, aaction, noBackgroun d, false); initCtor(apixOn, apixOff, QPixmap(), apixHover, aaction, noBackgroun d, false);
} }
StelButton::StelButton(QGraphicsItem* parent, StelButton::StelButton(QGraphicsItem* parent,
const QPixmap& apixOn, const QPixmap& apixOn,
const QPixmap& apixOff, const QPixmap& apixOff,
const QPixmap& apixNoChange, const QPixmap& apixNoChange,
const QPixmap& apixHover, const QPixmap& apixHover,
const QString& aactionId, const QString& aactionId,
bool noBackground, bool noBackground,
bool isTristate) : bool isTristate) :
QGraphicsPixmapItem(apixOff, parent) QGraphicsPixmapItem(apixOff, parent)
{ {
StelAction *action = StelApp::getInstance().getStelActionManager()-> findAction(aactionId); StelAction *action = StelApp::getInstance().getStelActionManager()-> findAction(aactionId);
initCtor(apixOn, apixOff, apixNoChange, apixHover, action, noBackgro und, isTristate); initCtor(apixOn, apixOff, apixNoChange, apixHover, action, noBackgro und, isTristate);
} }
StelButton::StelButton(QGraphicsItem* parent, StelButton::StelButton(QGraphicsItem* parent,
const QPixmap& apixOn, const QPixmap& apixOn,
const QPixmap& apixOff, const QPixmap& apixOff,
const QPixmap& apixHover, const QPixmap& apixHover,
const QString& aactionId, const QString& aactionId,
bool noBackground) bool noBackground)
:QGraphicsPixmapItem(apixOff, parent) :QGraphicsPixmapItem(apixOff, parent)
{ {
StelAction *action = StelApp::getInstance().getStelActionManager()-> findAction(aactionId); StelAction *action = StelApp::getInstance().getStelActionManager()-> findAction(aactionId);
initCtor(apixOn, apixOff, QPixmap(), apixHover, action, noBackground , false); initCtor(apixOn, apixOff, QPixmap(), apixHover, action, noBackground , false);
} }
int StelButton::toggleChecked(int checked) int StelButton::toggleChecked(int checked)
{ {
if (!isTristate_) if (!isTristate_)
checked = !!!checked; checked = !!!checked;
skipping to change at line 199 skipping to change at line 200
void StelButton::hoverLeaveEvent(QGraphicsSceneHoverEvent*) void StelButton::hoverLeaveEvent(QGraphicsSceneHoverEvent*)
{ {
timeLine->setDirection(QTimeLine::Backward); timeLine->setDirection(QTimeLine::Backward);
if (timeLine->state()!=QTimeLine::Running) if (timeLine->state()!=QTimeLine::Running)
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!=Q_NULLPTR && !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().focusSky(); // Change the focus 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);
if (!pixBackground.isNull() && noBckground==false) if (!pixBackground.isNull() && noBckground==false && StelMainView::g etInstance().getFlagUseButtonsBackground())
painter.drawPixmap(0, 0, pixBackground); painter.drawPixmap(0, 0, pixBackground);
painter.drawPixmap(0, 0, painter.drawPixmap(0, 0,
(isTristate_ && checked == ButtonStateNoChange) ? (pixNoChan ge) : (isTristate_ && checked == ButtonStateNoChange) ? (pixNoChan ge) :
(checked == ButtonStateOn) ? (pixOn) : (checked == ButtonStateOn) ? (pixOn) :
/* (checked == ButtonStateOff) ? */ (pixOff)); /* (checked == ButtonStateOff) ? */ (pixOff));
if (hoverOpacity > 0) if (hoverOpacity > 0)
{ {
painter.setOpacity(hoverOpacity * opacity); painter.setOpacity(hoverOpacity * opacity);
skipping to change at line 250 skipping to change at line 251
} }
void StelButton::setBackgroundPixmap(const QPixmap &newBackground) void StelButton::setBackgroundPixmap(const QPixmap &newBackground)
{ {
pixBackground = newBackground; pixBackground = newBackground;
updateIcon(); updateIcon();
} }
LeftStelBar::LeftStelBar(QGraphicsItem* parent) LeftStelBar::LeftStelBar(QGraphicsItem* parent)
: QGraphicsItem(parent) : QGraphicsItem(parent)
, hideTimeLine(NULL) , hideTimeLine(Q_NULLPTR)
, helpLabelPixmap(NULL) , helpLabelPixmap(Q_NULLPTR)
{ {
// Create the help label // Create the help label
helpLabel = new QGraphicsSimpleTextItem("", this); helpLabel = new QGraphicsSimpleTextItem("", this);
helpLabel->setBrush(QBrush(QColor::fromRgbF(1,1,1,1))); helpLabel->setBrush(QBrush(QColor::fromRgbF(1,1,1,1)));
if (qApp->property("text_texture")==true) // CLI option -t given? if (qApp->property("text_texture")==true) // CLI option -t given?
helpLabelPixmap=new QGraphicsPixmapItem(this); helpLabelPixmap=new QGraphicsPixmapItem(this);
} }
LeftStelBar::~LeftStelBar() LeftStelBar::~LeftStelBar()
{ {
if (helpLabelPixmap) { delete helpLabelPixmap; helpLabelPixmap=NULL; } if (helpLabelPixmap) { delete helpLabelPixmap; helpLabelPixmap=Q_NUL LPTR; }
} }
void LeftStelBar::addButton(StelButton* button) void LeftStelBar::addButton(StelButton* button)
{ {
double posY = 0; double posY = 0;
if (QGraphicsItem::childItems().size()!=0) if (QGraphicsItem::childItems().size()!=0)
{ {
const QRectF& r = childrenBoundingRect(); const QRectF& r = childrenBoundingRect();
posY += r.bottom()-1; posY += r.bottom()-1;
} }
skipping to change at line 356 skipping to change at line 357
{ {
helpLabel->setBrush(c); helpLabel->setBrush(c);
} }
BottomStelBar::BottomStelBar(QGraphicsItem* parent, BottomStelBar::BottomStelBar(QGraphicsItem* parent,
const QPixmap& pixLeft, const QPixmap& pixLeft,
const QPixmap& pixRight, const QPixmap& pixRight,
const QPixmap& pixMiddle, const QPixmap& pixMiddle,
const QPixmap& pixSingle) : const QPixmap& pixSingle) :
QGraphicsItem(parent), QGraphicsItem(parent),
locationPixmap(NULL), locationPixmap(Q_NULLPTR),
datetimePixmap(NULL), datetimePixmap(Q_NULLPTR),
fovPixmap(NULL), fovPixmap(Q_NULLPTR),
fpsPixmap(NULL), fpsPixmap(Q_NULLPTR),
pixBackgroundLeft(pixLeft), pixBackgroundLeft(pixLeft),
pixBackgroundRight(pixRight), pixBackgroundRight(pixRight),
pixBackgroundMiddle(pixMiddle), pixBackgroundMiddle(pixMiddle),
pixBackgroundSingle(pixSingle), pixBackgroundSingle(pixSingle),
helpLabelPixmap(NULL) helpLabelPixmap(Q_NULLPTR)
{ {
// The text is dummy just for testing // The text is dummy just for testing
datetime = new QGraphicsSimpleTextItem("2008-02-06 17:33", this); datetime = new QGraphicsSimpleTextItem("2008-02-06 17:33", this);
location = new QGraphicsSimpleTextItem("Munich, Earth, 500m", this); location = new QGraphicsSimpleTextItem("Munich, Earth, 500m", this);
fov = new QGraphicsSimpleTextItem("FOV 43.45", this); fov = new QGraphicsSimpleTextItem("FOV 43.45", this);
fps = new QGraphicsSimpleTextItem("43.2 FPS", this); fps = new QGraphicsSimpleTextItem("43.2 FPS", this);
if (qApp->property("text_texture")==true) // CLI option -t given? if (qApp->property("text_texture")==true) // CLI option -t given?
{ {
datetimePixmap=new QGraphicsPixmapItem(this); datetimePixmap=new QGraphicsPixmapItem(this);
locationPixmap=new QGraphicsPixmapItem(this); locationPixmap=new QGraphicsPixmapItem(this);
skipping to change at line 414 skipping to change at line 415
BottomStelBar::~BottomStelBar() BottomStelBar::~BottomStelBar()
{ {
// Remove currently hidden buttons which are not delete by a parent element // Remove currently hidden buttons which are not delete by a parent element
for (QMap<QString, ButtonGroup>::iterator iter=buttonGroups.begin(); iter!=buttonGroups.end();++iter) for (QMap<QString, ButtonGroup>::iterator iter=buttonGroups.begin(); iter!=buttonGroups.end();++iter)
{ {
foreach (StelButton* b, iter.value().elems) foreach (StelButton* b, iter.value().elems)
{ {
if (b->parentItem()==0) if (b->parentItem()==0)
{ {
delete b; delete b;
b=NULL; b=Q_NULLPTR;
} }
} }
} }
if (datetimePixmap) { delete datetimePixmap; datetimePixmap=NULL; } if (datetimePixmap) { delete datetimePixmap; datetimePixmap=Q_NULLPT
if (locationPixmap) { delete locationPixmap; locationPixmap=NULL; } R; }
if (fovPixmap) { delete fovPixmap; fovPixmap=NULL; } if (locationPixmap) { delete locationPixmap; locationPixmap=Q_NULLPT
if (fpsPixmap) { delete fpsPixmap; fpsPixmap=NULL; } R; }
if (helpLabelPixmap) { delete helpLabelPixmap; helpLabelPixmap=NULL; if (fovPixmap) { delete fovPixmap; fovPixmap=Q_NULLPTR; }
} if (fpsPixmap) { delete fpsPixmap; fpsPixmap=Q_NULLPTR; }
if (helpLabelPixmap) { delete helpLabelPixmap; helpLabelPixmap=Q_NUL
LPTR; }
} }
void BottomStelBar::addButton(StelButton* button, const QString& groupName, const QString& beforeActionName) void BottomStelBar::addButton(StelButton* button, const QString& groupName, const QString& beforeActionName)
{ {
QList<StelButton*>& g = buttonGroups[groupName].elems; QList<StelButton*>& g = buttonGroups[groupName].elems;
bool done = false; bool done = false;
for (int i=0; i<g.size(); ++i) for (int i=0; i<g.size(); ++i)
{ {
if (g[i]->action && g[i]->action->objectName()==beforeAction Name) if (g[i]->action && g[i]->action->objectName()==beforeAction Name)
{ {
skipping to change at line 453 skipping to change at line 454
button->setFocusOnSky(true); button->setFocusOnSky(true);
updateButtonsGroups(); updateButtonsGroups();
connect(button, SIGNAL(hoverChanged(bool)), this, SLOT(buttonHoverCh anged(bool))); connect(button, SIGNAL(hoverChanged(bool)), this, SLOT(buttonHoverCh anged(bool)));
emit sizeChanged(); emit sizeChanged();
} }
StelButton* BottomStelBar::hideButton(const QString& actionName) StelButton* BottomStelBar::hideButton(const QString& actionName)
{ {
QString gName; QString gName;
StelButton* bToRemove = NULL; StelButton* bToRemove = Q_NULLPTR;
for (QMap<QString, ButtonGroup>::iterator iter=buttonGroups.begin(); iter!=buttonGroups.end();++iter) for (QMap<QString, ButtonGroup>::iterator iter=buttonGroups.begin(); iter!=buttonGroups.end();++iter)
{ {
int i=0; int i=0;
foreach (StelButton* b, iter.value().elems) foreach (StelButton* b, iter.value().elems)
{ {
if (b->action && b->action->objectName()==actionName ) if (b->action && b->action->objectName()==actionName )
{ {
gName = iter.key(); gName = iter.key();
bToRemove = b; bToRemove = b;
iter.value().elems.removeAt(i); iter.value().elems.removeAt(i);
break; break;
} }
++i; ++i;
} }
} }
if (bToRemove == NULL) if (bToRemove == Q_NULLPTR)
return NULL; return Q_NULLPTR;
if (buttonGroups[gName].elems.size() == 0) if (buttonGroups[gName].elems.size() == 0)
{ {
buttonGroups.remove(gName); buttonGroups.remove(gName);
} }
// Cannot really delete because some part of the GUI depend on the p resence of some buttons // Cannot really delete because some part of the GUI depend on the p resence of some buttons
// so just make invisible // so just make invisible
bToRemove->setParentItem(NULL); bToRemove->setParentItem(Q_NULLPTR);
bToRemove->setVisible(false); bToRemove->setVisible(false);
updateButtonsGroups(); updateButtonsGroups();
emit sizeChanged(); emit sizeChanged();
return bToRemove; return bToRemove;
} }
// Set the margin at the left and right of a button group in pixels // Set the margin at the left and right of a button group in pixels
void BottomStelBar::setGroupMargin(const QString& groupName, int left, int right) void BottomStelBar::setGroupMargin(const QString& groupName, int left, int right)
{ {
if (!buttonGroups.contains(groupName)) if (!buttonGroups.contains(groupName))
skipping to change at line 553 skipping to change at line 554
x += group.leftMargin; x += group.leftMargin;
int n = 0; int n = 0;
foreach (StelButton* b, buttons) foreach (StelButton* b, buttons)
{ {
// We check if the group has its own background if n ot the case // We check if the group has its own background if n ot the case
// We apply a default background. // We apply a default background.
if (n == 0) if (n == 0)
{ {
if (buttons.size() == 1) if (buttons.size() == 1)
{ {
if (group.pixBackgroundSingle == NUL L) if (group.pixBackgroundSingle == Q_N ULLPTR)
b->setBackgroundPixmap(pixBa ckgroundSingle); b->setBackgroundPixmap(pixBa ckgroundSingle);
else else
b->setBackgroundPixmap(*grou p.pixBackgroundSingle); b->setBackgroundPixmap(*grou p.pixBackgroundSingle);
} }
else else
{ {
if (group.pixBackgroundLeft == NULL) if (group.pixBackgroundLeft == Q_NUL LPTR)
b->setBackgroundPixmap(pixBa ckgroundLeft); b->setBackgroundPixmap(pixBa ckgroundLeft);
else else
b->setBackgroundPixmap(*grou p.pixBackgroundLeft); b->setBackgroundPixmap(*grou p.pixBackgroundLeft);
} }
} }
else if (n == buttons.size()-1) else if (n == buttons.size()-1)
{ {
if (buttons.size() != 1) if (buttons.size() != 1)
{ {
if (group.pixBackgroundSingle == NUL L) if (group.pixBackgroundSingle == Q_N ULLPTR)
b->setBackgroundPixmap(pixBa ckgroundSingle); b->setBackgroundPixmap(pixBa ckgroundSingle);
else else
b->setBackgroundPixmap(*grou p.pixBackgroundSingle); b->setBackgroundPixmap(*grou p.pixBackgroundSingle);
} }
if (group.pixBackgroundRight == NULL) if (group.pixBackgroundRight == Q_NULLPTR)
b->setBackgroundPixmap(pixBackground Right); b->setBackgroundPixmap(pixBackground Right);
else else
b->setBackgroundPixmap(*group.pixBac kgroundRight); b->setBackgroundPixmap(*group.pixBac kgroundRight);
} }
else else
{ {
if (group.pixBackgroundMiddle == NULL) if (group.pixBackgroundMiddle == Q_NULLPTR)
b->setBackgroundPixmap(pixBackground Middle); b->setBackgroundPixmap(pixBackground Middle);
else else
b->setBackgroundPixmap(*group.pixBac kgroundMiddle); b->setBackgroundPixmap(*group.pixBac kgroundMiddle);
} }
// Update the button pixmap // Update the button pixmap
b->animValueChanged(0.); b->animValueChanged(0.);
b->setPos(x, y); b->setPos(x, y);
x += b->getButtonPixmapWidth(); x += b->getButtonPixmapWidth();
++n; ++n;
} }
skipping to change at line 640 skipping to change at line 641
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 && !core->getUseCustomTimeZone ()) || 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");
// TRANSLATORS: unit of measurement: minutes per second
QString timeRateMU = qc_("min/s", "unit of measurement");
float timeRate = qAbs(core->getTimeRate()/StelCore::JD_SECOND);
float timeSpeed = timeRate/60.f;
if (timeSpeed>=60.f)
{
timeSpeed /= 60.f;
// TRANSLATORS: unit of measurement: hours per second
timeRateMU = qc_("hr/s", "unit of measurement");
}
if (timeSpeed>=24.f)
{
timeSpeed /= 24.f;
// TRANSLATORS: unit of measurement: days per second
timeRateMU = qc_("d/s", "unit of measurement");
}
if (timeSpeed>=365.25f)
{
timeSpeed /= 365.25f;
// TRANSLATORS: unit of measurement: years per second
timeRateMU = qc_("yr/s", "unit of measurement");
}
QString timeRateInfo = QString("%1: x%2").arg(q_("Simulation speed")
, QString::number(timeRate, 'f', 0));
if (timeRate>60.)
timeRateInfo = QString("%1: x%2 (%3 %4)").arg(q_("Simulation
speed"), QString::number(timeRate, 'f', 0), QString::number(timeSpeed, 'f'
, 2), timeRateMU);
updatePos = true; updatePos = true;
datetime->setText(newDateInfo); datetime->setText(newDateInfo);
if (core->getCurrentDeltaTAlgorithm()!=StelCore::WithoutCorrection) if (core->getCurrentDeltaTAlgorithm()!=StelCore::WithoutCorrection)
{ {
if (sigma>0) if (sigma>0)
sigmaInfo = QString("; %1(%2T) = %3s").arg(QChar(0x0 3c3)).arg(QChar(0x0394)).arg(sigma, 3, 'f', 1); sigmaInfo = QString("; %1(%2T) = %3s").arg(QChar(0x0 3c3)).arg(QChar(0x0394)).arg(sigma, 3, 'f', 1);
QString deltaTInfo = ""; QString deltaTInfo = "";
if (qAbs(deltaT)>60.) if (qAbs(deltaT)>60.)
deltaTInfo = QString("%1 (%2s)%3").arg(StelUtils::ho ursToHmsStr(deltaT/3600.)).arg(deltaT, 5, 'f', 2).arg(validRangeMarker); deltaTInfo = QString("%1 (%2s)%3").arg(StelUtils::ho ursToHmsStr(deltaT/3600.)).arg(deltaT, 5, 'f', 2).arg(validRangeMarker);
else else
deltaTInfo = QString("%1s%2").arg(deltaT, 3, 'f', 3) .arg(validRangeMarker); deltaTInfo = QString("%1s%2").arg(deltaT, 3, 'f', 3) .arg(validRangeMarker);
// the corrective ndot to be displayed could be set accordin g to the currently used DeltaT algorithm. // the corrective ndot to be displayed could be set accordin g to the currently used DeltaT algorithm.
//float ndot=core->getDeltaTnDot(); //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..." // 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 ); float ndot=( (core->de430IsActive() || core->de431IsActive() ) ? -25.8f : -23.8946f );
datetime->setToolTip(QString("<p style='white-space:pre'>%1T = %2 [n%8 @ %3\"/cy%4%5]<br>%6<br>%7</p>").arg(QChar(0x0394)).arg(deltaTIn fo).arg(QString::number(ndot, 'f', 4)).arg(QChar(0x00B2)).arg(sigmaInfo).ar g(newDateAppx).arg(currTZ).arg(QChar(0x2032))); datetime->setToolTip(QString("<p style='white-space:pre'>%1T = %2 [n%8 @ %3\"/cy%4%5]<br>%6<br>%7<br>%9</p>").arg(QChar(0x0394)).arg(de ltaTInfo).arg(QString::number(ndot, 'f', 4)).arg(QChar(0x00B2)).arg(sigmaIn fo).arg(newDateAppx).arg(currTZ).arg(QChar(0x2032)).arg(timeRateInfo));
} }
else else
datetime->setToolTip(QString("<p style='white-space:pre'>%1< br>%2</p>").arg(newDateAppx).arg(currTZ)); datetime->setToolTip(QString("<p style='white-space:pre'>%1< br>%2<br>%3</p>").arg(newDateAppx).arg(currTZ).arg(timeRateInfo));
if (qApp->property("text_texture")==true) // CLI option -t given? if (qApp->property("text_texture")==true) // CLI option -t given?
{ {
datetime->setVisible(false); // hide normal thingy. datetime->setVisible(false); // hide normal thingy.
datetimePixmap->setPixmap(getTextPixmap(newDateInfo, datetim e->font())); datetimePixmap->setPixmap(getTextPixmap(newDateInfo, datetim e->font()));
} }
// build location tooltip // build location tooltip
QString newLocation = ""; QString newLocation = "";
const StelLocation* loc = &core->getCurrentLocation(); const StelLocation* loc = &core->getCurrentLocation();
skipping to change at line 783 skipping to change at line 811
} }
else else
{ {
fps->setText(""); fps->setText("");
fps->setToolTip(""); fps->setToolTip("");
} }
} }
if (updatePos) if (updatePos)
{ {
int fovShift = 170; QFontMetrics fpsMetrics(fps->font());
int fpsShift = fpsMetrics.width(fpsstr) + 50;
QFontMetrics fovMetrics(fov->font());
int fovShift = fpsShift + fovMetrics.width(fovstr) + 80;
if (getFlagFovDms()) if (getFlagFovDms())
fovShift = 195; fovShift += 25;
QRectF rectCh = getButtonsBoundingRect(); QRectF rectCh = getButtonsBoundingRect();
location->setPos(0, 0); location->setPos(0, 0);
int dtp = rectCh.right()-datetime->boundingRect().width()-5; int dtp = rectCh.right()-datetime->boundingRect().width()-5;
if ((dtp%2) == 1) dtp--; // make even pixel if ((dtp%2) == 1) dtp--; // make even pixel
datetime->setPos(dtp,0); datetime->setPos(dtp,0);
fov->setPos(datetime->x()-fovShift, 0); fov->setPos(datetime->x()-fovShift, 0);
fps->setPos(datetime->x()-75, 0); fps->setPos(datetime->x()-fpsShift, 0);
if (qApp->property("text_texture")==true) // CLI option -t g iven? if (qApp->property("text_texture")==true) // CLI option -t g iven?
{ {
locationPixmap->setPos(0,0); locationPixmap->setPos(0,0);
int dtp = rectCh.right()-datetimePixmap->boundingRec t().width()-5; int dtp = rectCh.right()-datetimePixmap->boundingRec t().width()-5;
if ((dtp%2) == 1) dtp--; // make even pixel if ((dtp%2) == 1) dtp--; // make even pixel
datetimePixmap->setPos(dtp,0); datetimePixmap->setPos(dtp,0);
fovPixmap->setPos(datetime->x()-fovShift, 0); fovPixmap->setPos(datetime->x()-fovShift, 0);
fpsPixmap->setPos(datetime->x()-75, 0); fpsPixmap->setPos(datetime->x()-fpsShift, 0);
} }
} }
} }
void BottomStelBar::paint(QPainter*, const QStyleOptionGraphicsItem*, QWidg et*) void BottomStelBar::paint(QPainter*, const QStyleOptionGraphicsItem*, QWidg et*)
{ {
updateText(); updateText();
} }
QRectF BottomStelBar::boundingRect() const QRectF BottomStelBar::boundingRect() const
skipping to change at line 942 skipping to change at line 974
{ {
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
QProgressBar* pb = new QProgressBar(); QProgressBar* pb = new QProgressBar();
pb->setFixedHeight(25); pb->setFixedHeight(25);
pb->setFixedWidth(200); pb->setFixedWidth(200);
pb->setTextVisible(true); pb->setTextVisible(true);
pb->setValue(p->getValue()); pb->setValue(p->getValue());
pb->setMinimum(p->getMin()); pb->setMinimum(p->getMin());
pb->setMaximum(p->getMax()); pb->setMaximum(p->getMax());
pb->setFormat(p->getFormat()); pb->setFormat(p->getFormat());
if (gui!=NULL) if (gui!=Q_NULLPTR)
pb->setStyleSheet(gui->getStelStyle().qtStyleSheet); pb->setStyleSheet(gui->getStelStyle().qtStyleSheet);
QGraphicsProxyWidget* pbProxy = new QGraphicsProxyWidget(); QGraphicsProxyWidget* pbProxy = new QGraphicsProxyWidget();
pbProxy->setWidget(pb); pbProxy->setWidget(pb);
pbProxy->setCacheMode(QGraphicsItem::DeviceCoordinateCache); pbProxy->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
pbProxy->setZValue(150); pbProxy->setZValue(150);
static_cast<QGraphicsLinearLayout*>(layout())->addItem(pbProxy); static_cast<QGraphicsLinearLayout*>(layout())->addItem(pbProxy);
allBars.insert(p, pb); allBars.insert(p, pb);
pb->setVisible(true); pb->setVisible(true);
connect(p, SIGNAL(changed()), this, SLOT(oneBarChanged())); connect(p, SIGNAL(changed()), this, SLOT(oneBarChanged()));
skipping to change at line 999 skipping to change at line 1031
void CornerButtons::setOpacity(double opacity) void CornerButtons::setOpacity(double opacity)
{ {
if (opacity<=0. && lastOpacity<=0.) if (opacity<=0. && lastOpacity<=0.)
return; return;
lastOpacity = opacity; lastOpacity = opacity;
if (QGraphicsItem::childItems().size()==0) if (QGraphicsItem::childItems().size()==0)
return; return;
foreach (QGraphicsItem *child, QGraphicsItem::childItems()) foreach (QGraphicsItem *child, QGraphicsItem::childItems())
{ {
StelButton* sb = qgraphicsitem_cast<StelButton*>(child); StelButton* sb = qgraphicsitem_cast<StelButton*>(child);
Q_ASSERT(sb!=NULL); Q_ASSERT(sb!=Q_NULLPTR);
sb->setOpacity(opacity); sb->setOpacity(opacity);
} }
} }
 End of changes. 32 change blocks. 
48 lines changed or deleted 85 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/