Commit c5bb591e authored by Samikshan Bairagya's avatar Samikshan Bairagya

Add a "Close" button to close the QML GUI for WI.

parent 9a4c0980
......@@ -5,4 +5,5 @@ install( FILES wiview.qml
settingsIcon.png
next.png
previous.png
dialog_close.png
DESTINATION ${DATA_INSTALL_DIR}/kstars/tools/whatsinteresting/qml )
......@@ -14,6 +14,24 @@ Rectangle {
color: "#020518"
anchors.fill: parent
opacity: 0.890
Image {
id: closeButton
objectName: "closeButtonObj"
x: 333
y: 11
sourceSize.height: 28
sourceSize.width: 28
source: "dialog_close.png"
signal closeButtonClicked()
MouseArea {
id: closeMouseArea
anchors.fill: parent
onClicked: closeButton.closeButtonClicked()
}
}
}
Text {
......
......@@ -21,7 +21,7 @@
#include "kstandarddirs.h"
WIView::WIView(QObject *parent, ObsConditions *obs) : QObject(parent)
WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent)
{
m = new ModelManager(obs);
......@@ -36,7 +36,7 @@ WIView::WIView(QObject *parent, ObsConditions *obs) : QObject(parent)
baseView->setAttribute(Qt::WA_TranslucentBackground);
baseView->setStyleSheet("background: transparent;");
// baseView->setWindowFlags(Qt::FramelessWindowHint);
baseView->setWindowFlags(Qt::FramelessWindowHint);
ctxt = baseView->rootContext();
......@@ -59,10 +59,12 @@ WIView::WIView(QObject *parent, ObsConditions *obs) : QObject(parent)
m_PrevObj = m_BaseObj->findChild<QObject *>("prevObj");
connect(m_PrevObj, SIGNAL(prevObjClicked()), this, SLOT(onPrevObjClicked()));
QObject *closeButtonObj = m_BaseObj->findChild<QObject *>("closeButtonObj");
connect(closeButtonObj, SIGNAL(closeButtonClicked()), baseView, SLOT(close()));
m_OptMag = obs->getOptimumMAG();
baseView->setResizeMode(QDeclarativeView::SizeRootObjectToView);
// baseView->setParent(skyMap);
// mapScene->addItem(qobject_cast<QGraphicsObject *>(baseView->rootObject()));
// mapScene->setItemIndexMethod(QGraphicsScene::NoIndex);
......
......@@ -35,7 +35,7 @@
* sent to the UI for display.
* \author Samikshan Bairagya
*/
class WIView : public QObject
class WIView : public QWidget
{
Q_OBJECT
public:
......@@ -45,7 +45,7 @@ public:
* Connect signals from various QML components into public slots.
* Displays the user interface for What's Interesting
*/
WIView(QObject *parent = 0, ObsConditions *obs = 0);
WIView(QWidget *parent = 0, ObsConditions *obs = 0);
/**
* \brief Destructor
......
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