diff --git a/saoriview.cpp b/saoriview.cpp
index d6a3d61..8a554eb 100644
--- a/saoriview.cpp
+++ b/saoriview.cpp
@@ -112,6 +112,7 @@
SaoriView::~SaoriView()
{
+ savePinnedGeometry();
delete ui;
m_viewList.removeOne(this);
}
@@ -389,7 +390,7 @@
return QString("
");
}
-void SaoriView::closeEvent(QCloseEvent *event)
+void SaoriView::savePinnedGeometry()
{
SaoriApplication::saori()->setting()->beginGroup(SAORI_SETTING_VIEW);
if ((ui->actionPin->isChecked()) && (!(qobject_cast(parent())->windowState() & Qt::WindowMaximized))) {
@@ -398,7 +399,12 @@
}
SaoriApplication::saori()->setting()->setValue(m_config + SAORI_SETTING_VIEW_PINED,ui->actionPin->isChecked());
SaoriApplication::saori()->setting()->endGroup();
- QWidget::closeEvent(event);
+}
+
+void SaoriView::closeEvent(QCloseEvent *event)
+{
+ if (ui->actionPin->isChecked()) event->ignore();
+ else QWidget::closeEvent(event);
}
void SaoriView::recived(const QString timeline,const QByteArray data)
diff --git a/saoriview.h b/saoriview.h
index b06f0c8..7492b09 100644
--- a/saoriview.h
+++ b/saoriview.h
@@ -73,6 +73,7 @@
static const QString htmlAnc(const QString link,const QString text);
static const QString htmlHr();
+ void savePinnedGeometry();
virtual void closeEvent(QCloseEvent *event);
public slots: