summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-06-25 19:07:25 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-06-25 19:07:25 (GMT)
commit794a049be7aa820b1ce49ab4f542d907975d281a (patch)
tree6becc59b497bc866a57ee73d6c4f5d799401787e
parent5518a05a200d6531b5ee1d1409a1d451bc3b0749 (diff)
downloadswift-contrib-794a049be7aa820b1ce49ab4f542d907975d281a.zip
swift-contrib-794a049be7aa820b1ce49ab4f542d907975d281a.tar.bz2
Allow for margins in the status popup.
Thanks to Ephraim for the getContentsMargins hint.
-rw-r--r--Swift/QtUI/QtStatusWidget.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Swift/QtUI/QtStatusWidget.cpp b/Swift/QtUI/QtStatusWidget.cpp
index cd5777f..769f010 100644
--- a/Swift/QtUI/QtStatusWidget.cpp
+++ b/Swift/QtUI/QtStatusWidget.cpp
@@ -168,8 +168,16 @@ void QtStatusWidget::handleClicked() {
}
}
generateList();
-
+
height = menu_->sizeHintForRow(0) * menu_->count();
+ int marginLeft;
+ int marginTop;
+ int marginRight;
+ int marginBottom;
+ menu_->getContentsMargins(&marginLeft, &marginTop, &marginRight, &marginBottom);
+ height += marginTop + marginBottom;
+ width += marginLeft + marginRight;
+
menu_->setGeometry(x, y, width, height);
menu_->move(x, y);
menu_->setMaximumWidth(width);