]> sigrok.org Git - pulseview.git/blobdiff - pv/widgets/popuptoolbutton.cpp
Added missing includes to popuptoolbutton.{h,cpp}
[pulseview.git] / pv / widgets / popuptoolbutton.cpp
index ea3515c4981130696dc135b61748b510bbd90182..c3e938e05b2a117f240fbc6a82a224a413ef4e1f 100644 (file)
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
+#include <assert.h>
+
 #include "popuptoolbutton.h"
 
 namespace pv {
@@ -45,7 +47,9 @@ void PopupToolButton::on_clicked(bool)
        if(!_popup)
                return;
 
-       _popup->set_position(mapToGlobal(rect().center()), Popup::Bottom);
+       const QRect r = rect();
+       _popup->set_position(mapToGlobal(QPoint((r.left() + r.right()) / 2,
+               ((r.top() + r.bottom() * 3) / 4))), Popup::Bottom);
        _popup->show();
 }