From a0bee29162ae5dfb574ab34ccde7710ab729d136 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 26 Jul 2017 17:47:48 +0100 Subject: [PATCH] Make sure not to account for an invisible frame when sizing line edits --- qrenderdoc/Styles/RDStyle/RDStyle.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qrenderdoc/Styles/RDStyle/RDStyle.cpp b/qrenderdoc/Styles/RDStyle/RDStyle.cpp index 37b7c511d..7bbb6a835 100644 --- a/qrenderdoc/Styles/RDStyle/RDStyle.cpp +++ b/qrenderdoc/Styles/RDStyle/RDStyle.cpp @@ -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(opt); + + if(frame && frame->lineWidth > 0) + { + ret.setWidth(Constants::ButtonBorder * 2 + ret.width()); + ret.setHeight(Constants::ButtonBorder * 2 + ret.height()); + } return ret; }