From 794a049be7aa820b1ce49ab4f542d907975d281a Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Fri, 25 Jun 2010 20:07:25 +0100 Subject: Allow for margins in the status popup. Thanks to Ephraim for the getContentsMargins hint. 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); -- cgit v0.10.2-6-g49f6