]> sigrok.org Git - pulseview.git/blobdiff - pv/widgets/popup.cpp
Added Popup::closed signal
[pulseview.git] / pv / widgets / popup.cpp
index f89e38a6b1b84e3fdc9b923060f31688277c87f1..9863887ed5dab9595e69f6c8ba5b1308186223dd 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <algorithm>
 
+#include <assert.h>
+
 #include <QtGui>
 
 #include "popup.h"
@@ -29,9 +31,9 @@ using namespace std;
 namespace pv {
 namespace widgets {
 
-const unsigned int Popup::ArrowLength = 15;
+const unsigned int Popup::ArrowLength = 10;
 const unsigned int Popup::ArrowOverlap = 3;
-const unsigned int Popup::MarginWidth = 10;
+const unsigned int Popup::MarginWidth = 6;
 
 Popup::Popup(QWidget *parent) :
        QWidget(parent, Qt::Popup | Qt::FramelessWindowHint),
@@ -162,6 +164,11 @@ void Popup::reposition_widget()
        move(_point + o);
 }
 
+void Popup::closeEvent(QCloseEvent*)
+{
+       closed();
+}
+
 void Popup::paintEvent(QPaintEvent*)
 {
        QPainter painter(this);
@@ -198,11 +205,6 @@ void Popup::resizeEvent(QResizeEvent*)
        setMask(popup_region());
 }
 
-void Popup::showEvent(QShowEvent*)
-{
-       reposition_widget();
-}
-
 void Popup::mouseReleaseEvent(QMouseEvent *e)
 {
        assert(e);
@@ -213,6 +215,11 @@ void Popup::mouseReleaseEvent(QMouseEvent *e)
                close();
 }
 
+void Popup::showEvent(QShowEvent*)
+{
+       reposition_widget();
+}
+
 } // namespace widgets
 } // namespace pv