From bab9b0a1a3a61d83a455e81c8a23d15319133e45 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 9 Oct 2012 18:21:01 +0200 Subject: [PATCH] don't put buttons if the theme doesn't have any --- private/style.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/private/style.cpp b/private/style.cpp index 182e35c8c..d3cae152b 100644 --- a/private/style.cpp +++ b/private/style.cpp @@ -305,6 +305,26 @@ QRect Style::subControlRect(ComplexControl control, const QStyleOptionComplex *o } break; } + case CC_ScrollBar: { + const bool hasButtons = d->scrollbar->hasElement("arrow-up"); + switch (subControl) { + //If one of the arrows is missing, don't reserve space for them + case SC_ScrollBarAddLine: + if (!hasButtons) { + rect.setRect(0,0,0,0); + } + break; + + case SC_ScrollBarSubLine: + if (!hasButtons) { + rect.setRect(0,0,0,0); + } + break; + + default: + break; + } + } default: break; }