From: Joel Holdsworth Date: Sat, 23 Nov 2013 09:06:01 +0000 (+0000) Subject: Slightly offset the PopupToolButton popup X-Git-Tag: pulseview-0.2.0~216 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4b53a1edfa2309a5b1f40f4adc78eff814fb0d15;p=pulseview.git Slightly offset the PopupToolButton popup --- diff --git a/pv/widgets/popuptoolbutton.cpp b/pv/widgets/popuptoolbutton.cpp index ea3515c4..4ea6f3ed 100644 --- a/pv/widgets/popuptoolbutton.cpp +++ b/pv/widgets/popuptoolbutton.cpp @@ -45,7 +45,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(); }