Commit eee31506 authored by Samikshan Bairagya's avatar Samikshan Bairagya

Include source information of description text for sky-objects in the details-view of the QML UI.

parent 91c8d082
......@@ -515,7 +515,7 @@ Rectangle {
anchors.bottomMargin: 4
contentWidth: parent.width
contentHeight: col.height
contentHeight: col.height + 4
Item {
id: descTextItem
......@@ -538,6 +538,19 @@ Rectangle {
width: parent.width
font.pixelSize: 13
}
Text {
id: descSrcText
objectName: "descSrcTextObj"
color: "#18885f"
text: qsTr("Source: ")
font.family: "Cantarell"
font.italic: true
horizontalAlignment: Text.AlignRight
clip: true
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width
font.pixelSize: 13
}
}
}
}
......
......@@ -124,6 +124,16 @@ QString SkyObjItem::getDesc() const
return getTypeName();
}
QString SkyObjItem::getDescSource()
{
if (m_Type == Planet)
{
return i18n("(Source: Wikipedia)");
}
return i18n("(Source: N/A)");
}
QString SkyObjItem::getSurfaceBrightness() const
{
/** Surface Brightness is applicable only for extended light sources like
......
......@@ -102,6 +102,12 @@ public:
*/
QString getDesc() const;
/**
* \brief Get source of description for the SkyObjItem.
* \return Source of description for the SkyObjItem as a QString.
*/
QString getDescSource();
/**
* \brief Get magnitude of sky-object associated with the SkyObjItem.
* \return Magnitude of sky-object associated with the SkyObjItem.
......
......@@ -107,6 +107,7 @@ void WIView::loadDetailsView(SkyObjItem *soitem, int index)
QObject *sonameObj = m_DetailsViewObj->findChild<QObject *>("sonameObj");
QObject *posTextObj = m_DetailsViewObj->findChild<QObject *>("posTextObj");
QObject *descTextObj = m_DetailsViewObj->findChild<QObject *>("descTextObj");
QObject *descSrcTextObj = m_DetailsViewObj->findChild<QObject *>("descSrcTextObj");
QObject *magTextObj = m_DetailsViewObj->findChild<QObject *>("magTextObj");
QObject *sbTextObj = m_DetailsViewObj->findChild<QObject *>("sbTextObj");
QObject *sizeTextObj = m_DetailsViewObj->findChild<QObject *>("sizeTextObj");
......@@ -114,6 +115,7 @@ void WIView::loadDetailsView(SkyObjItem *soitem, int index)
sonameObj->setProperty("text", soitem->getLongName());
posTextObj->setProperty("text", soitem->getPosition());
descTextObj->setProperty("text", soitem->getDesc());
descSrcTextObj->setProperty("text", soitem->getDescSource());
QString magText;
if (soitem->getType() == SkyObjItem::Constellation)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment