SkyGui.cpp   SkyGui.cpp 
skipping to change at line 47 skipping to change at line 47
infoTextFilters = StelObject::InfoStringGroup(StelObject::Al lInfo); infoTextFilters = StelObject::InfoStringGroup(StelObject::Al lInfo);
else if (objectInfo == "short") else if (objectInfo == "short")
infoTextFilters = StelObject::InfoStringGroup(StelObject::Sh ortInfo); infoTextFilters = StelObject::InfoStringGroup(StelObject::Sh ortInfo);
else if (objectInfo == "none") else if (objectInfo == "none")
infoTextFilters = StelObject::InfoStringGroup(0); infoTextFilters = StelObject::InfoStringGroup(0);
else else
{ {
qWarning() << "config.ini option gui/selected_object_info is invalid, using \"all\""; qWarning() << "config.ini option gui/selected_object_info is invalid, using \"all\"";
infoTextFilters = StelObject::InfoStringGroup(StelObject::Al lInfo); infoTextFilters = StelObject::InfoStringGroup(StelObject::Al lInfo);
} }
QFont font("DejaVuSans");
font.setPixelSize(13);
setFont(font);
} }
void InfoPanel::setTextFromObjects(const QList<StelObjectP>& selected) void InfoPanel::setTextFromObjects(const QList<StelObjectP>& selected)
{ {
if (selected.size() == 0) if (selected.isEmpty())
{ {
if (!document()->isEmpty()) if (!document()->isEmpty())
document()->clear(); document()->clear();
} }
else else
{ {
// just print details of the first item for now // just print details of the first item for now
QString s = selected[0]->getInfoString(StelApp::getInstance( ).getCore(), infoTextFilters); QString s = selected[0]->getInfoString(StelApp::getInstance( ).getCore(), infoTextFilters);
setHtml(s); setHtml(s);
} }
} }
SkyGui::SkyGui(): QGraphicsWidget(), stelGui(NULL) SkyGui::SkyGui(QGraphicsItem * parent): QGraphicsWidget(parent), stelGui(NU LL)
{ {
setObjectName("StelSkyGui"); setObjectName("StelSkyGui");
// Construct the Windows buttons bar // Construct the Windows buttons bar
winBar = new LeftStelBar(NULL); winBar = new LeftStelBar(this);
// Construct the bottom buttons bar // Construct the bottom buttons bar
buttonBar = new BottomStelBar(NULL, QPixmap(":/graphicGui/gui/btbg-l buttonBar = new BottomStelBar(this, QPixmap(":/graphicGui/btbg-left.
eft.png"), QPixmap(":/graphicGui/gui/btbg-right.png"), png"), QPixmap(":/graphicGui/btbg-right.png"),
QPixmap(": QPixmap(":
/graphicGui/gui/btbg-middle.png"), QPixmap(":/graphicGui/gui/btbg-single.pn /graphicGui/btbg-middle.png"), QPixmap(":/graphicGui/btbg-single.png"));
g")); infoPanel = new InfoPanel(this);
infoPanel = new InfoPanel(NULL);
// Used to display some progress bar in the lower right corner, e.g. when loading a file // Used to display some progress bar in the lower right corner, e.g. when loading a file
progressBarMgr = new StelProgressBarMgr(NULL); progressBarMgr = new StelProgressBarMgr(this);
// The path drawn around the button bars // The path drawn around the button bars
buttonBarPath = new StelBarsPath(NULL); buttonBarPath = new StelBarsPath(this);
lastButtonbarWidth = 0; lastButtonbarWidth = 0;
autoHidebts = NULL; autoHidebts = NULL;
autoHideHorizontalButtonBar = true; autoHideHorizontalButtonBar = true;
autoHideVerticalButtonBar = true; autoHideVerticalButtonBar = true;
animLeftBarTimeLine = new QTimeLine(200, this); animLeftBarTimeLine = new QTimeLine(200, this);
animLeftBarTimeLine->setCurveShape(QTimeLine::EaseInOutCurve); animLeftBarTimeLine->setCurveShape(QTimeLine::EaseInOutCurve);
connect(animLeftBarTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT (updateBarsPos())); connect(animLeftBarTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT (updateBarsPos()));
skipping to change at line 114 skipping to change at line 110
stelGui = astelGui; stelGui = astelGui;
winBar->setParentItem(this); winBar->setParentItem(this);
buttonBar->setParentItem(this); buttonBar->setParentItem(this);
buttonBarPath->setParentItem(this); buttonBarPath->setParentItem(this);
infoPanel->setParentItem(this); infoPanel->setParentItem(this);
progressBarMgr->setParentItem(this); progressBarMgr->setParentItem(this);
// Create the 2 auto hide buttons in the bottom left corner // Create the 2 auto hide buttons in the bottom left corner
autoHidebts = new CornerButtons(); autoHidebts = new CornerButtons();
QPixmap pxmapOn = QPixmap(":/graphicGui/gui/HorizontalAutoHideOn.png QPixmap pxmapOn = QPixmap(":/graphicGui/HorizontalAutoHideOn.png");
"); QPixmap pxmapOff = QPixmap(":/graphicGui/HorizontalAutoHideOff.png")
QPixmap pxmapOff = QPixmap(":/graphicGui/gui/HorizontalAutoHideOff.p ;
ng");
btHorizAutoHide = new StelButton(autoHidebts, pxmapOn, pxmapOff, QPi xmap(), stelGui->getGuiActions("actionAutoHideHorizontalButtonBar"), true); btHorizAutoHide = new StelButton(autoHidebts, pxmapOn, pxmapOff, QPi xmap(), stelGui->getGuiActions("actionAutoHideHorizontalButtonBar"), true);
btHorizAutoHide->setChecked(autoHideHorizontalButtonBar); btHorizAutoHide->setChecked(autoHideHorizontalButtonBar);
pxmapOn = QPixmap(":/graphicGui/gui/VerticalAutoHideOn.png"); pxmapOn = QPixmap(":/graphicGui/VerticalAutoHideOn.png");
pxmapOff = QPixmap(":/graphicGui/gui/VerticalAutoHideOff.png"); pxmapOff = QPixmap(":/graphicGui/VerticalAutoHideOff.png");
btVertAutoHide = new StelButton(autoHidebts, pxmapOn, pxmapOff, QPix map(), stelGui->getGuiActions("actionAutoHideVerticalButtonBar"), true); btVertAutoHide = new StelButton(autoHidebts, pxmapOn, pxmapOff, QPix map(), stelGui->getGuiActions("actionAutoHideVerticalButtonBar"), true);
btVertAutoHide->setChecked(autoHideVerticalButtonBar); btVertAutoHide->setChecked(autoHideVerticalButtonBar);
btHorizAutoHide->setPos(1,btVertAutoHide->pixmap().height()-btHorizA utoHide->pixmap().height()+1); btHorizAutoHide->setPos(1,btVertAutoHide->pixmap().height()-btHorizA utoHide->pixmap().height()+1);
btVertAutoHide->setPos(0,0); btVertAutoHide->setPos(0,0);
btVertAutoHide->setZValue(1000); btVertAutoHide->setZValue(1000);
autoHidebts->setParentItem(this); autoHidebts->setParentItem(this);
infoPanel->setPos(8,8); infoPanel->setPos(8,8);
skipping to change at line 201 skipping to change at line 197
const int ww = geometry().width(); const int ww = geometry().width();
const int hh = geometry().height(); const int hh = geometry().height();
bool updatePath = false; bool updatePath = false;
// Use a position cache to avoid useless redraw triggered by the pos ition set if the bars don't move // Use a position cache to avoid useless redraw triggered by the pos ition set if the bars don't move
double rangeX = winBar->boundingRectNoHelpLabel().width()+2.*buttonB arPath->getRoundSize()+1.; double rangeX = winBar->boundingRectNoHelpLabel().width()+2.*buttonB arPath->getRoundSize()+1.;
const qreal newWinBarX = buttonBarPath->getRoundSize()-(1.-animLeftB arTimeLine->currentValue())*rangeX-0.5; const qreal newWinBarX = buttonBarPath->getRoundSize()-(1.-animLeftB arTimeLine->currentValue())*rangeX-0.5;
const qreal newWinBarY = hh-winBar->boundingRectNoHelpLabel().height ()-buttonBar->boundingRectNoHelpLabel().height()-20; const qreal newWinBarY = hh-winBar->boundingRectNoHelpLabel().height ()-buttonBar->boundingRectNoHelpLabel().height()-20;
if (winBar->pos().x()!=newWinBarX || winBar->pos().y()!=newWinBarY) if (winBar->pos().x()!=newWinBarX || winBar->pos().y()!=newWinBarY)
{ {
winBar->setPos(newWinBarX, newWinBarY); winBar->setPos(round(newWinBarX), round(newWinBarY));
updatePath = true; updatePath = true;
} }
double rangeY = buttonBar->boundingRectNoHelpLabel().height()+0.5-7. -buttonBarPath->getRoundSize(); double rangeY = buttonBar->boundingRectNoHelpLabel().height()+0.5-7. -buttonBarPath->getRoundSize();
const qreal newButtonBarX = winBar->boundingRectNoHelpLabel().right( )+buttonBarPath->getRoundSize(); const qreal newButtonBarX = winBar->boundingRectNoHelpLabel().right( )+buttonBarPath->getRoundSize();
const qreal newButtonBarY = hh-buttonBar->boundingRectNoHelpLabel(). height()-buttonBarPath->getRoundSize()+0.5+(1.-animBottomBarTimeLine->curre ntValue())*rangeY; const qreal newButtonBarY = hh-buttonBar->boundingRectNoHelpLabel(). height()-buttonBarPath->getRoundSize()+0.5+(1.-animBottomBarTimeLine->curre ntValue())*rangeY;
if (buttonBar->pos().x()!=newButtonBarX || buttonBar->pos().y()!=new ButtonBarY) if (buttonBar->pos().x()!=newButtonBarX || buttonBar->pos().y()!=new ButtonBarY)
{ {
buttonBar->setPos(newButtonBarX, newButtonBarY); buttonBar->setPos(round(newButtonBarX), round(newButtonBarY) );
updatePath = true; updatePath = true;
} }
if (lastButtonbarWidth != buttonBar->boundingRectNoHelpLabel().width ()) if (lastButtonbarWidth != buttonBar->boundingRectNoHelpLabel().width ())
{ {
updatePath = true; updatePath = true;
lastButtonbarWidth = (int)(buttonBar->boundingRectNoHelpLabe l().width()); lastButtonbarWidth = (int)(buttonBar->boundingRectNoHelpLabe l().width());
} }
if (updatePath) if (updatePath)
 End of changes. 11 change blocks. 
23 lines changed or deleted 17 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/