Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove --fix-text option #3344

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cmake/stellarium.pod.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ on *nix operating systems).

Even more diagnostic output in logfile (esp. multimedia handling).

=item B<-t, --fix-text>

May fix text rendering problems.

=item B<--scale-gui> I<scale factor>

Scaling the GUI according to scale factor.
Expand Down
2 changes: 1 addition & 1 deletion guide/ch_advanced_use.tex
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ \chapter{Command Line Options}
-\/-safe-mode or -s & {[}none{]} & Synonymous to -\/-mesa-mode.\footnotemark[1]\\
-\/-single-buffer & {[}none{]} & Use single-buffering. This reportedly avoids screen blanking problems with some Intel GPUs. \\
-\/-opengl-compat or -C & {[}none{]} & Request OpenGL 3.3 Compatibility Profile. Might fix graphics problems in some driver configurations.\\
gzotti marked this conversation as resolved.
Show resolved Hide resolved
-\/-fix-text or -t & {[}none{]} & Alternative way of creating the Info text, required on some systems.\footnote{E.g., Raspberry Pi 2/3 with Raspbian Jessie and VC4 drivers from Mesa 11 (2016).}\\\bottomrule
\bottomrule
\end{longtable}

\noindent \newFeature{0.15} If you want to avoid adding the same
Expand Down
4 changes: 0 additions & 4 deletions src/CLIProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ void CLIProcessor::parseCLIArgsPreConfig(const QStringList& argList)
<< " (esp. multimedia handling)\n"
<< "--opengl-compat (or -C) : Request OpenGL Compatibility profile\n"
<< " May help for certain driver configurations.\n"
<< "--fix-text (or -t) : May fix text rendering problems\n"
<< "--single-buffer : Use single buffer swap (avoid screen blanking on Intel UHD)\n"
<< "--scale-gui <scale factor> : Scaling the GUI according to scale factor\n"
<< "--gui-css (or -G) <styleName> : Use customized <styleName>.css file for GUI colors\n"
Expand Down Expand Up @@ -153,9 +152,6 @@ void CLIProcessor::parseCLIArgsPreConfig(const QStringList& argList)
if (argsGetOption(argList, "-C", "--opengl-compat"))
qApp->setProperty("onetime_opengl_compat", true);

if (argsGetOption(argList, "-t", "--fix-text"))
qApp->setProperty("text_texture", true); // Will be observed in StelPainter::drawText()

if (argsGetOption(argList, "", "--single-buffer"))
qApp->setProperty("onetime_single_buffer", true);

Expand Down
10 changes: 1 addition & 9 deletions src/core/StelPainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,15 +682,7 @@ StringTexture* StelPainter::getTextTexture(const QString& str, int pixelSize) co
QPixmap strImage = QPixmap(StelUtils::getBiggerPowerOfTwo(w), StelUtils::getBiggerPowerOfTwo(h));
strImage.fill(Qt::transparent);
QPainter painter(&strImage);
if (qApp->property("text_texture").toBool()) // CLI option -t given?
{
// This is essential on devices like Raspberry Pi (2016-03).
tmpFont.setStyleStrategy(QFont::NoAntialias);
}
else
{
painter.setRenderHints(QPainter::TextAntialiasing);
}
painter.setRenderHints(QPainter::TextAntialiasing);
painter.setFont(tmpFont);
painter.setPen(Qt::white);
painter.drawText(-strRect.x(), -strRect.y(), str);
Expand Down
150 changes: 15 additions & 135 deletions src/gui/StelGuiItems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,6 @@
#include <QSettings>
#include <QGuiApplication>

// 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. Mesa 13 (2016-11) has finally fixed this on RasPi(VC4).
QPixmap getTextPixmap(const QString& str, QFont font)
{
// Render the text str into a QPixmap.
QRect strRect = QFontMetrics(font).boundingRect(str);
int w = static_cast<int>(1.02f*static_cast<float>(strRect.width()))+1;
int h = strRect.height();

QPixmap strPixmap(w, h);
strPixmap.fill(Qt::transparent);
QPainter painter(&strPixmap);
font.setStyleStrategy(QFont::NoAntialias); // else: font problems on RasPi20160326
painter.setFont(font);
//painter.setRenderHints(QPainter::TextAntialiasing);
painter.setPen(Qt::white);
painter.drawText(-strRect.x(), -strRect.y(), str);
return strPixmap;
}

void StelButton::initCtor(const QPixmap& apixOn,
const QPixmap& apixOff,
const QPixmap& apixNoChange,
Expand Down Expand Up @@ -363,13 +343,10 @@
LeftStelBar::LeftStelBar(QGraphicsItem* parent)
: QGraphicsItem(parent)
, hideTimeLine(nullptr)
, helpLabelPixmap(nullptr)
{
// Create the help label
helpLabel = new QGraphicsSimpleTextItem("", this);
helpLabel->setBrush(QBrush(QColor::fromRgbF(1,1,1,1)));
if (qApp->property("text_texture")==true) // CLI option -t given?
helpLabelPixmap=new QGraphicsPixmapItem(this);

setFontSizeFromApp(StelApp::getInstance().getScreenFontSize());
connect(&StelApp::getInstance(), SIGNAL(screenFontSizeChanged(int)), this, SLOT(setFontSizeFromApp(int)));
Expand All @@ -378,7 +355,6 @@

LeftStelBar::~LeftStelBar()
{
if (helpLabelPixmap) { delete helpLabelPixmap; helpLabelPixmap=nullptr; }
}

void LeftStelBar::addButton(StelButton* button)
Expand Down Expand Up @@ -413,7 +389,7 @@
QRectF childRect;
for (auto* child : QGraphicsItem::childItems())
{
if ((child==helpLabel) || (child==helpLabelPixmap))
if (child==helpLabel)
continue;
QPointF childPos = child->pos();
QTransform matrix = child->transform() * QTransform().translate(childPos.x(), childPos.y());
Expand Down Expand Up @@ -443,20 +419,11 @@
}
helpLabel->setText(tip);
helpLabel->setPos(qRound(boundingRectNoHelpLabel().width()+15.5),qRound(button->pos().y()+button->getButtonPixmapHeight()/2-8));
if (qApp->property("text_texture")==true)
{
helpLabel->setVisible(false);
helpLabelPixmap->setPixmap(getTextPixmap(tip, helpLabel->font()));
helpLabelPixmap->setPos(helpLabel->pos());
helpLabelPixmap->setVisible(true);
}
}
}
else
{
helpLabel->setText("");
if (qApp->property("text_texture")==true)
helpLabelPixmap->setVisible(false);
}
// Update the screen as soon as possible.
StelMainView::getInstance().thereWasAnEvent();
Expand Down Expand Up @@ -508,30 +475,17 @@
const QPixmap& pixMiddle,
const QPixmap& pixSingle) :
QGraphicsItem(parent),
locationPixmap(nullptr),
datetimePixmap(nullptr),
fovPixmap(nullptr),
fpsPixmap(nullptr),
gap(2),
pixBackgroundLeft(pixLeft),
pixBackgroundRight(pixRight),
pixBackgroundMiddle(pixMiddle),
pixBackgroundSingle(pixSingle),
helpLabelPixmap(nullptr)
pixBackgroundSingle(pixSingle)
{
// The text is dummy just for testing
datetime = new QGraphicsSimpleTextItem("2008-02-06 17:33", this);
location = new QGraphicsSimpleTextItem("Munich, Earth, 500m", this);
fov = new QGraphicsSimpleTextItem("FOV 43.45", this);
fps = new QGraphicsSimpleTextItem("43.2 FPS", this);
if (qApp->property("text_texture")==true) // CLI option -t given?
{
datetimePixmap=new QGraphicsPixmapItem(this);
locationPixmap=new QGraphicsPixmapItem(this);
fovPixmap=new QGraphicsPixmapItem(this);
fpsPixmap=new QGraphicsPixmapItem(this);
helpLabelPixmap=new QGraphicsPixmapItem(this);
}

// Create the help label
helpLabel = new QGraphicsSimpleTextItem("", this);
Expand Down Expand Up @@ -577,15 +531,6 @@
updateButtonsGroups(); // Make sure bounding boxes are readjusted.
}
}
if (qApp->property("text_texture")==true) // CLI option -t given?
{
// We must do something to rebuild the pixmaps if fontsize changes. We solve this with setting custom data item 0 to true
datetimePixmap->setData(0, true);
locationPixmap->setData(0, true);
fovPixmap->setData(0, true);
fpsPixmap->setData(0, true);
helpLabelPixmap->setData(0, true);
}
}

//! connect from StelApp to resize fonts on the fly.
Expand Down Expand Up @@ -620,11 +565,6 @@
}
}
}
if (datetimePixmap) { delete datetimePixmap; datetimePixmap=nullptr; }
if (locationPixmap) { delete locationPixmap; locationPixmap=nullptr; }
if (fovPixmap) { delete fovPixmap; fovPixmap=nullptr; }
if (fpsPixmap) { delete fpsPixmap; fpsPixmap=nullptr; }
if (helpLabelPixmap) { delete helpLabelPixmap; helpLabelPixmap=nullptr; }
}

void BottomStelBar::addButton(StelButton* button, const QString& groupName, const QString& beforeActionName)
Expand Down Expand Up @@ -718,29 +658,15 @@
{
QRectF childRect;
bool hasBtn = false;
if (qApp->property("text_texture")==true) // CLI option -t given?
{
// For unknown reasons the matrix operation is not needed and even wrong here.
for (auto* child : QGraphicsItem::childItems())
{
if (qgraphicsitem_cast<StelButton*>(child)==nullptr)
continue;
hasBtn = true;
childRect |= child->boundingRect();
}
}
else
for (auto* child : QGraphicsItem::childItems())
{
for (auto* child : QGraphicsItem::childItems())
{
if (qgraphicsitem_cast<StelButton*>(child)==nullptr)
continue;
hasBtn = true;
QPointF childPos = child->pos();
//qDebug() << "childPos" << childPos;
QTransform matrix = child->transform() * QTransform().translate(childPos.x(), childPos.y());
childRect |= matrix.mapRect(child->boundingRect() | child->childrenBoundingRect());
}
if (qgraphicsitem_cast<StelButton*>(child)==nullptr)
continue;
hasBtn = true;
QPointF childPos = child->pos();
//qDebug() << "childPos" << childPos;
QTransform matrix = child->transform() * QTransform().translate(childPos.x(), childPos.y());
childRect |= matrix.mapRect(child->boundingRect() | child->childrenBoundingRect());
}

if (hasBtn)
Expand Down Expand Up @@ -817,271 +743,235 @@
// create text elements and tooltips in bottom toolbar.
// Make sure to avoid any change if not necessary to avoid triggering useless redraw
// This is also called when button groups have been updated.
void BottomStelBar::updateText(bool updatePos, bool updateTopocentric)
{
StelCore* core = StelApp::getInstance().getCore();
const double jd = core->getJD();
const double deltaT = core->getDeltaT();
const double sigma = StelUtils::getDeltaTStandardError(jd);
QString validRangeMarker = "";
core->getCurrentDeltaTAlgorithmValidRangeDescription(jd, &validRangeMarker);

const StelLocaleMgr& locmgr = StelApp::getInstance().getLocaleMgr();
QString tz = locmgr.getPrintableTimeZoneLocal(jd);
QString newDateInfo = " ";
if (getFlagShowTime())
{
if (getFlagShowTz())
newDateInfo = QString("%1 %2 %3").arg(locmgr.getPrintableDateLocal(jd), locmgr.getPrintableTimeLocal(jd), tz);
else
newDateInfo = QString("%1 %2").arg(locmgr.getPrintableDateLocal(jd), locmgr.getPrintableTimeLocal(jd));
}
QString newDateAppx = QString("JD %1").arg(jd, 0, 'f', 5); // up to seconds
if (getFlagTimeJd())
{
newDateAppx = newDateInfo;
newDateInfo = QString("JD %1").arg(jd, 0, 'f', 5); // up to seconds
}

QString planetName = core->getCurrentLocation().planetName;
QString planetNameI18n;
if (planetName=="SpaceShip") // Avoid crash
{
const StelTranslator& trans = StelApp::getInstance().getLocaleMgr().getSkyTranslator();
planetNameI18n = trans.qtranslate(planetName, "special celestial body"); // added context
}
else
planetNameI18n = GETSTELMODULE(SolarSystem)->searchByEnglishName(planetName)->getNameI18n();

QString tzName = core->getCurrentTimeZone();
if (tzName.contains("system_default") || (tzName.isEmpty() && planetName=="Earth"))
tzName = q_("System default");

QString currTZ = QString("%1: %2").arg(q_("Time zone"), tzName);

if (tzName.contains("LMST") || tzName.contains("auto") || (planetName=="Earth" && jd<=StelCore::TZ_ERA_BEGINNING && !core->getUseCustomTimeZone()) )
currTZ = q_("Local Mean Solar Time");

if (tzName.contains("LTST"))
currTZ = q_("Local True Solar Time");

// TRANSLATORS: unit of measurement: minutes per second
QString timeRateMU = qc_("min/s", "unit of measurement");
double timeRate = qAbs(core->getTimeRate()/StelCore::JD_SECOND);
double timeSpeed = timeRate/60.;

if (timeSpeed>=60.)
{
timeSpeed /= 60.;
// TRANSLATORS: unit of measurement: hours per second
timeRateMU = qc_("hr/s", "unit of measurement");
}
if (timeSpeed>=24.)
{
timeSpeed /= 24.;
// TRANSLATORS: unit of measurement: days per second
timeRateMU = qc_("d/s", "unit of measurement");
}
if (timeSpeed>=365.25)
{
timeSpeed /= 365.25;
// 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);

if (datetime->text()!=newDateInfo || (datetimePixmap && datetimePixmap->data(0).toBool()))
if (datetime->text()!=newDateInfo)
{
updatePos = true;
datetime->setText(newDateInfo);
}

if (core->getCurrentDeltaTAlgorithm()!=StelCore::WithoutCorrection)
{
QString sigmaInfo("");
if (sigma>0)
sigmaInfo = QString("; %1(%2T) = %3s").arg(QChar(0x03c3)).arg(QChar(0x0394)).arg(sigma, 3, 'f', 1);

QString deltaTInfo;
if (qAbs(deltaT)>60.)
deltaTInfo = QString("%1 (%2s)%3").arg(StelUtils::hoursToHmsStr(deltaT/3600.)).arg(deltaT, 5, 'f', 2).arg(validRangeMarker);
else
deltaTInfo = QString("%1s%2").arg(deltaT, 3, 'f', 3).arg(validRangeMarker);

// the corrective ndot to be displayed could be set according to the currently used DeltaT algorithm.
//float ndot=core->getDeltaTnDot();
// or just to the used ephemeris. This has to be read as "Selected DeltaT formula used, but with the ephemeris's nDot applied it corrects DeltaT to..."
const double ndot=( (EphemWrapper::use_de430(jd) || EphemWrapper::use_de431(jd) || EphemWrapper::use_de440(jd) || EphemWrapper::use_de441(jd)) ? -25.8 : -23.8946 );

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), deltaTInfo, QString::number(ndot, 'f', 4), QChar(0x00B2), sigmaInfo, newDateAppx, currTZ, QChar(0x2032), timeRateInfo));
}
else
datetime->setToolTip(QString("<p style='white-space:pre'>%1<br>%2<br>%3</p>").arg(newDateAppx, currTZ, timeRateInfo));

if (qApp->property("text_texture")==true) // CLI option -t given?
{
datetime->setVisible(false); // hide normal thingy.
datetimePixmap->setPixmap(getTextPixmap(newDateInfo, datetime->font()));
datetimePixmap->setData(0, false);
}

// build location tooltip
QString newLocation("");
if (getFlagShowLocation())
{
const StelLocation* loc = &core->getCurrentLocation();
if (core->getCurrentPlanet()->getPlanetType()==Planet::isObserver)
newLocation = planetNameI18n;
else if(loc->name.isEmpty())
newLocation = planetNameI18n +", "+StelUtils::decDegToDmsStr(loc->getLatitude())+", "+StelUtils::decDegToDmsStr(loc->getLongitude());
else if (loc->name.contains("->")) // a spaceship
newLocation = QString("%1 [%2 %3]").arg(planetNameI18n, q_("flight"), loc->name);
else
//TRANSLATORS: Unit of measure for distance - meter
newLocation = planetNameI18n +", "+q_(loc->name) + ", "+ QString("%1 %2").arg(loc->altitude).arg(qc_("m", "distance"));
}
// When topocentric switch is toggled, this must be redrawn!
if (location->text()!=newLocation || updateTopocentric || (locationPixmap && locationPixmap->data(0).toBool()))
if (location->text()!=newLocation || updateTopocentric)
{
updatePos = true;
location->setText(newLocation);
double lat = static_cast<double>(core->getCurrentLocation().getLatitude());
double lon = static_cast<double>(core->getCurrentLocation().getLongitude());
QString latStr, lonStr, pm;
if (lat >= 0)
pm = "N";
else
{
pm = "S";
lat *= -1;
}
latStr = QString("%1%2%3").arg(pm).arg(lat).arg(QChar(0x00B0));
if (lon >= 0)
pm = "E";
else
{
pm = "W";
lon *= -1;
}
lonStr = QString("%1%2%3").arg(pm).arg(lon).arg(QChar(0x00B0));
QString rho, weather;
if (core->getUseTopocentricCoordinates())
rho = QString("%1 %2 %3").arg(q_("planetocentric distance")).arg(core->getCurrentObserver()->getDistanceFromCenter() * AU).arg(qc_("km", "distance"));
else
rho = q_("planetocentric observer");

if (newLocation.contains("->")) // a spaceship
location->setToolTip(QString());
else
{
if (core->getCurrentPlanet()->hasAtmosphere())
{
const StelPropertyMgr* propMgr=StelApp::getInstance().getStelPropertyManager();
weather = QString("%1: %2 %3; %4: %5 °C").arg(q_("Atmospheric pressure"), QString::number(propMgr->getStelPropertyValue("StelSkyDrawer.atmospherePressure").toDouble(), 'f', 2), qc_("mbar", "pressure unit"), q_("temperature"), QString::number(propMgr->getStelPropertyValue("StelSkyDrawer.atmosphereTemperature").toDouble(), 'f', 1));
location->setToolTip(QString("<p style='white-space:pre'>%1 %2; %3<br>%4</p>").arg(latStr, lonStr, rho, weather));
}
else if (core->getCurrentPlanet()->getPlanetType()==Planet::isObserver)
newLocation = planetNameI18n;
else
location->setToolTip(QString("%1 %2; %3").arg(latStr, lonStr, rho));
}

if (qApp->property("text_texture")==true) // CLI option -t given?
{
locationPixmap->setPixmap(getTextPixmap(newLocation, location->font()));
locationPixmap->setData(0, false);
location->setVisible(false);
}
}

// build fov tooltip
// TRANSLATORS: Field of view. Please use abbreviation.
QString fovdms = StelUtils::decDegToDmsStr(core->getMovementMgr()->getCurrentFov());
QString fovText;
if (getFlagFovDms())
fovText=QString("%1 %2").arg(qc_("FOV", "abbreviation"), fovdms);
else
fovText=QString("%1 %2%3").arg(qc_("FOV", "abbreviation"), QString::number(core->getMovementMgr()->getCurrentFov(), 'g', 3), QChar(0x00B0));

if (fov->text()!=fovText || (fovPixmap && fovPixmap->data(0).toBool()))
if (fov->text()!=fovText)
{
updatePos = true;
if (getFlagShowFov())
{
fov->setText(fovText);
fov->setToolTip(QString("%1: %2").arg(q_("Field of view"), fovdms));
if (qApp->property("text_texture")==true) // CLI option -t given?
{
fovPixmap->setPixmap(getTextPixmap(fovText, fov->font()));
fovPixmap->setData(0, false);
fov->setVisible(false);
}
}
else
{
fov->setText("");
fov->setToolTip("");
}
}

// build fps tooltip
// TRANSLATORS: Frames per second. Please use abbreviation.
QString fpsText = QString("%1 %2").arg(QString::number(StelApp::getInstance().getFps(), 'g', 3), qc_("FPS", "abbreviation"));;
if (fps->text()!=fpsText || (fpsPixmap && fpsPixmap->data(0).toBool()))
if (fps->text()!=fpsText)
{
updatePos = true;
if (getFlagShowFps())
{
fps->setText(fpsText);
fps->setToolTip(q_("Frames per second"));
if (qApp->property("text_texture")==true) // CLI option -t given?
{
fpsPixmap->setPixmap(getTextPixmap(fpsText, fps->font()));
fpsPixmap->setData(0, false);
fps->setVisible(false);
}
}
else
{
fps->setText("");
fps->setToolTip("");
}
}

if (updatePos)
{
// The location string starts at left, dateTime ends at right. FoV and FPS come ahead of dateTime.
// In case the strings are wider than available button space, they are now pushed to the right.
QFontMetrics fontMetrics(location->font());
int fpsShift = qMax(fontMetrics.boundingRect(fps->text()+"MMM").width(), fontMetrics.boundingRect(qc_("FPS", "abbreviation")+"MM.M MMM").width());
int fovShift = fontMetrics.boundingRect(fov->text()+"MMM").width() + fpsShift;
int locationWidth= fontMetrics.boundingRect(location->text() + "MMM").width();
location->setPos(0, 0);

QRectF rectCh = getButtonsBoundingRect();
int dateTimePos = static_cast<int>(rectCh.right()-datetime->boundingRect().width())-5;
if ((dateTimePos%2) == 1) dateTimePos--; // make even pixel

const int rightPush=qMax(0, locationWidth-(dateTimePos-fovShift));
datetime->setPos(dateTimePos+rightPush, 0);
fov->setPos(datetime->x()-fovShift, 0);
fps->setPos(datetime->x()-fpsShift, 0);
if (qApp->property("text_texture")==true) // CLI option -t given?
{
const qreal yPos = -fontMetrics.descent();
locationPixmap->setPos(0,yPos);
dateTimePos = static_cast<int>(rectCh.right()-datetimePixmap->boundingRect().width())-5;
if ((dateTimePos%2) == 1) dateTimePos--; // make even pixel
datetimePixmap->setPos(dateTimePos+rightPush, yPos);
fovPixmap->setPos(datetimePixmap->x()-fovShift, yPos);
fpsPixmap->setPos(datetimePixmap->x()-fpsShift, yPos);
}
//emit sizeChanged(); // This causes max fps!
}
}

Check notice on line 974 in src/gui/StelGuiItems.cpp

View check run for this annotation

codefactor.io / CodeFactor

src/gui/StelGuiItems.cpp#L746-L974

Complex Method
void BottomStelBar::paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*)
{
updateText();
Expand All @@ -1101,7 +991,7 @@
QRectF childRect;
for (const auto* child : QGraphicsItem::childItems())
{
if ((child==helpLabel) || (child==helpLabelPixmap))
if (child==helpLabel)
continue;
QPointF childPos = child->pos();
QTransform matrix = child->transform() * QTransform().translate(childPos.x(), childPos.y());
Expand Down Expand Up @@ -1142,21 +1032,11 @@
helpLabel->setText(tip);
//helpLabel->setPos(button->pos().x()+button->pixmap().size().width()/2,-27);
helpLabel->setPos(20,-10-location->font().pixelSize()); // Set help text XY position. Y adjusted for font size!

if (qApp->property("text_texture")==true)
{
helpLabel->setVisible(false);
helpLabelPixmap->setPixmap(getTextPixmap(tip, helpLabel->font()));
helpLabelPixmap->setPos(helpLabel->pos());
helpLabelPixmap->setVisible(true);
}
}
}
else
{
helpLabel->setText("");
if (qApp->property("text_texture")==true)
helpLabelPixmap->setVisible(false);
}
// Update the screen as soon as possible.
StelMainView::getInstance().thereWasAnEvent();
Expand Down
8 changes: 0 additions & 8 deletions src/gui/StelGuiItems.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ private slots:
private:
QTimeLine* hideTimeLine;
QGraphicsSimpleTextItem* helpLabel;
QGraphicsPixmapItem* helpLabelPixmap; // bad-graphics replacement.
};

// The button bar on the bottom containing actions toggle buttons
Expand Down Expand Up @@ -304,12 +303,6 @@ private slots:
QGraphicsSimpleTextItem* datetime;
QGraphicsSimpleTextItem* fov;
QGraphicsSimpleTextItem* fps;
// For bad graphics, show these instead. We can use location etc for font info.
// We use ad-hoc pixmaps instead if command-line arg. -t (--text-fix) is given.
QGraphicsPixmapItem* locationPixmap;
QGraphicsPixmapItem* datetimePixmap;
QGraphicsPixmapItem* fovPixmap;
QGraphicsPixmapItem* fpsPixmap;
int gap; // a pixel distance between status line and buttons. May have fixed size or could depend on status element font size QFontMetrics::descent()


Expand Down Expand Up @@ -347,7 +340,6 @@ private slots:
bool flagShowTZ;

QGraphicsSimpleTextItem* helpLabel;
QGraphicsPixmapItem* helpLabelPixmap; // bad-graphics replacement.
};

//! @class StelBarsPath: The path around the bottom and left button bars
Expand Down
Loading