diff options
author | Georg Zotti <Georg.Zotti@univie.ac.at> | 2023-11-27 03:58:28 +0100 |
---|---|---|
committer | Georg Zotti <Georg.Zotti@univie.ac.at> | 2023-11-29 00:51:03 +0100 |
commit | a6297fec118474a7988b1980d38acc2f8d2f83e2 (patch) | |
tree | c664afb0fcfbf833758ceca1a83b250dad80dcb0 | |
parent | 7638731d7a5e85b3499778d6028995b70fdaacd5 (diff) |
Apply StelDialog changes also hereprintsky
-rw-r--r-- | plugins/PrintSky/src/gui/PrintSkyDialog.cpp | 35 | ||||
-rw-r--r-- | plugins/PrintSky/src/gui/PrintSkyDialog.hpp | 2 | ||||
-rw-r--r-- | plugins/PrintSky/src/gui/printskyDialog.ui | 95 |
3 files changed, 20 insertions, 112 deletions
diff --git a/plugins/PrintSky/src/gui/PrintSkyDialog.cpp b/plugins/PrintSky/src/gui/PrintSkyDialog.cpp index 6bc9e473f8..e3a81061c2 100644 --- a/plugins/PrintSky/src/gui/PrintSkyDialog.cpp +++ b/plugins/PrintSky/src/gui/PrintSkyDialog.cpp @@ -70,11 +70,6 @@ void PrintSkyDialog::updateStyle() }
}
-void PrintSkyDialog::styleChanged()
-{
- // Nothing for now
-}
-
/* ********************************************************************* */
void PrintSkyDialog::closeWindow()
{
@@ -88,7 +83,9 @@ void PrintSkyDialog::createDialogContent() ui->setupUi(dialog);
//Now the rest of the actions.
- connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
+ connect(ui->titleBar, &TitleBar::closeClicked, this, &StelDialog::close);
+ connect(ui->titleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
+
connect(ui->previewSkyPushButton, SIGNAL(clicked()), this, SLOT(previewSky()));
connect(ui->printSkyPushButton, SIGNAL(clicked()), this, SLOT(printSky()));
@@ -117,8 +114,8 @@ void PrintSkyDialog::printFooter(QPrinter * printer, QPainter *painter, int page QString stelVersion = q_("Stellarium %1").arg(StelUtils::getApplicationVersion());
StelLocaleMgr lMgr=StelApp::getInstance().getLocaleMgr();
- QString footerDate=QString("%1 %2 (%3)").arg(lMgr.getPrintableDateLocal(jd)).arg(lMgr.getPrintableTimeLocal(jd)).arg(lMgr.getPrintableTimeZoneLocal(jd));
- QString footerText=QString("%1 %2 %3 %4").arg(q_("Created on")).arg(footerDate).arg(q_("by")).arg(stelVersion);
+ QString footerDate=QString("%1 %2 (%3)").arg(lMgr.getPrintableDateLocal(jd), lMgr.getPrintableTimeLocal(jd), lMgr.getPrintableTimeZoneLocal(jd));
+ QString footerText=QString("%1 %2 %3 %4").arg(q_("Created on"), footerDate, q_("by"), stelVersion);
const QPageLayout pageLayout=printer->pageLayout();
const QRectF fullRect=pageLayout.fullRect();
@@ -130,7 +127,7 @@ void PrintSkyDialog::printFooter(QPrinter * printer, QPainter *painter, int page qDebug() << "printFooter of page " << pageNumber << "at x:" << marginLeft << " y: " << yPos << "in fontsize" << fontSize;
painter->drawText(QRectF(marginLeft, yPos, fullRect.width()-marginLeft-marginRight, 2*fontSize), Qt::AlignLeft, footerText);
- painter->drawText(QRectF(marginLeft, yPos, fullRect.width()-marginLeft-marginRight, 2*fontSize), Qt::AlignRight, QString("%1 %2").arg(q_("Page")).arg(QString::number(pageNumber)));
+ painter->drawText(QRectF(marginLeft, yPos, fullRect.width()-marginLeft-marginRight, 2*fontSize), Qt::AlignRight, QString("%1 %2").arg(q_("Page"), QString::number(pageNumber)));
qDebug() << "printFooter done";
}
@@ -200,18 +197,18 @@ void PrintSkyDialog::printDataSky(QPrinter * printer) painter.drawText(surfaceData.adjusted(0, 0, 0, -(surfaceData.height()-lineSpacing)), Qt::AlignCenter, q_("CHART INFORMATION"));
- QString printLatitude=StelUtils::radToDmsStr((std::fabs(static_cast<double>(location.latitude))/180.)*M_PI);
- QString printLongitude=StelUtils::radToDmsStr((std::fabs(static_cast<double>(location.longitude))/180.)*M_PI);
+ QString printLatitude=StelUtils::radToDmsStr((std::fabs(static_cast<double>(location.getLatitude()))/180.)*M_PI);
+ QString printLongitude=StelUtils::radToDmsStr((std::fabs(static_cast<double>(location.getLongitude()))/180.)*M_PI);
QString locationStr = QString("%1: %2,\t%3,\t%4;\t%5\t%6\t%7%8")
- .arg(q_("Location"))
- .arg(location.name)
- .arg(q_(location.region))
- .arg(q_(location.planetName))
- .arg(location.latitude<0 ? QString("%1S").arg(printLatitude) : QString("%1N").arg(printLatitude))
- .arg(location.longitude<0 ? QString("%1W").arg(printLongitude) : QString("%1E").arg(printLongitude))
- .arg(location.altitude)
- .arg(qc_("m", "altitude, metres"));
+ .arg(q_("Location"),
+ location.name,
+ q_(location.region),
+ q_(location.planetName),
+ location.getLatitude()<0 ? QString("%1S").arg(printLatitude) : QString("%1N").arg(printLatitude),
+ location.getLongitude()<0 ? QString("%1W").arg(printLongitude) : QString("%1E").arg(printLongitude),
+ QString::number(location.altitude),
+ qc_("m", "altitude, metres"));
painter.drawText(surfaceData.adjusted(50, lineSpacing, 0, 0), Qt::AlignLeft, locationStr);
qDebug() << "PrintSky: Basic info 1 ";
diff --git a/plugins/PrintSky/src/gui/PrintSkyDialog.hpp b/plugins/PrintSky/src/gui/PrintSkyDialog.hpp index 0e54b8e4c5..a701e8f8ca 100644 --- a/plugins/PrintSky/src/gui/PrintSkyDialog.hpp +++ b/plugins/PrintSky/src/gui/PrintSkyDialog.hpp @@ -41,8 +41,6 @@ public: void retranslate() override;
void updateStyle();
- //! Notify that the application style changed
- void styleChanged() override;
void enableOutputOptions(bool enable);
public slots:
diff --git a/plugins/PrintSky/src/gui/printskyDialog.ui b/plugins/PrintSky/src/gui/printskyDialog.ui index f819c023fc..4d8aab5b88 100644 --- a/plugins/PrintSky/src/gui/printskyDialog.ui +++ b/plugins/PrintSky/src/gui/printskyDialog.ui @@ -39,97 +39,10 @@ <number>0</number>
</property>
<item>
- <widget class="BarFrame" name="TitleBar">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>25</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
+ <widget class="TitleBar" name="titleBar">
+ <property name="title" stdset="0">
+ <string>PrintSky Plug-in Configuration</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout_7">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="leftMargin">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="rightMargin">
- <number>4</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
- <item>
- <spacer name="spacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="stelWindowTitle">
- <property name="text">
- <string>Print sky</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="spacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="closeStelWindow">
- <property name="minimumSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- <property name="focusPolicy">
- <enum>Qt::NoFocus</enum>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
</widget>
</item>
<item>
@@ -410,7 +323,7 @@ In a optional second page you can get some Solar System ephemerides.</string> </widget>
<customwidgets>
<customwidget>
- <class>BarFrame</class>
+ <class>TitleBar</class>
<extends>QFrame</extends>
<header>Dialog.hpp</header>
<container>1</container>
|