From 189c12d0b1d3362f490f26cc0fcd3005af8b426c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 11 Nov 2012 18:02:30 -0600 Subject: Fix style crashes when used with third party toolkits --- kstyles/keramik/keramik.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'kstyles/keramik') diff --git a/kstyles/keramik/keramik.cpp b/kstyles/keramik/keramik.cpp index b3c29d34f..2c558b5b1 100644 --- a/kstyles/keramik/keramik.cpp +++ b/kstyles/keramik/keramik.cpp @@ -2184,15 +2184,14 @@ void KeramikStyle::drawComplexControl( TQ_ComplexControl control, } case CC_ScrollBar: { - const TQScrollBar* sb = static_cast< const TQScrollBar* >( widget ); - if (highlightScrollBar && sb->parentWidget()) //Don't do the check if not highlighting anyway + if (highlightScrollBar && (elementFlags & CEF_HasParentWidget)) //Don't do the check if not highlighting anyway { - if (sb->parentWidget()->colorGroup().button() != sb->colorGroup().button()) + if (ceData.parentWidgetData.colorGroup.button() != ceData.colorGroup.button()) customScrollMode = true; } - bool horizontal = sb->orientation() == Qt::Horizontal; + bool horizontal = ceData.orientation == TQt::Horizontal; TQRect slider, subpage, addpage, subline, addline; - if ( sb->minValue() == sb->maxValue() ) flags &= ~Style_Enabled; + if ( ceData.minSteps == ceData.maxSteps ) flags &= ~Style_Enabled; slider = querySubControlMetrics( control, ceData, elementFlags, SC_ScrollBarSlider, opt, widget ); subpage = querySubControlMetrics( control, ceData, elementFlags, SC_ScrollBarSubPage, opt, widget ); @@ -2208,9 +2207,9 @@ void KeramikStyle::drawComplexControl( TQ_ComplexControl control, if ( controls & SC_ScrollBarSubPage ) clip |= subpage; if ( controls & SC_ScrollBarAddPage ) clip |= addpage; if ( horizontal ) - clip |= TQRect( slider.x(), 0, slider.width(), sb->height() ); + clip |= TQRect( slider.x(), 0, slider.width(), ceData.rect.height() ); else - clip |= TQRect( 0, slider.y(), sb->width(), slider.height() ); + clip |= TQRect( 0, slider.y(), ceData.rect.width(), slider.height() ); clip ^= slider; p->setClipRegion( clip ); -- cgit v1.2.1