Make sure not to account for an invisible frame when sizing line edits

This commit is contained in:
baldurk
2017-07-26 17:47:48 +01:00
parent b63c91da0f
commit a0bee29162
+7 -2
View File
@@ -517,8 +517,13 @@ QSize RDStyle::sizeFromContents(ContentsType type, const QStyleOption *opt, cons
{
QSize ret = size;
ret.setWidth(Constants::ButtonBorder * 2 + ret.width());
ret.setHeight(Constants::ButtonBorder * 2 + ret.height());
const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt);
if(frame && frame->lineWidth > 0)
{
ret.setWidth(Constants::ButtonBorder * 2 + ret.width());
ret.setHeight(Constants::ButtonBorder * 2 + ret.height());
}
return ret;
}