diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-11-03 20:35:31 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-11-03 20:35:31 -0500 |
commit | 6e12d65ff7d934b0e3b3ab5caf0ff1a67c3ea536 (patch) | |
tree | cffc7fe119fc1f85b25a8ee274c4c0570b03c7d7 /tdefx | |
parent | 55c0d54a9863b438be2949a4629ec3fb0a307fe4 (diff) | |
download | tdelibs-6e12d65ff7d934b0e3b3ab5caf0ff1a67c3ea536.tar.gz tdelibs-6e12d65ff7d934b0e3b3ab5caf0ff1a67c3ea536.zip |
Fix a number of crashes in various TDE styles when used by a third party toolkit
Diffstat (limited to 'tdefx')
-rw-r--r-- | tdefx/kstyle.cpp | 18 | ||||
-rw-r--r-- | tdefx/kstyle.h | 4 |
2 files changed, 10 insertions, 12 deletions
diff --git a/tdefx/kstyle.cpp b/tdefx/kstyle.cpp index bf5c5a22a..b56705146 100644 --- a/tdefx/kstyle.cpp +++ b/tdefx/kstyle.cpp @@ -881,11 +881,10 @@ void KStyle::drawControl( TQ_ControlElement element, case CE_ProgressBarContents: { // ### Take into account totalSteps() for busy indicator - const TQProgressBar* pb = (const TQProgressBar*)widget; TQRect cr = subRect(SR_ProgressBarContents, ceData, elementFlags, widget); - double progress = pb->progress(); + double progress = ceData.currentStep; bool reverse = TQApplication::reverseLayout(); - int steps = pb->totalSteps(); + int steps = ceData.totalSteps; if (!cr.isValid()) return; @@ -945,11 +944,10 @@ void KStyle::drawControl( TQ_ControlElement element, } case CE_ProgressBarLabel: { - const TQProgressBar* pb = (const TQProgressBar*)widget; TQRect cr = subRect(SR_ProgressBarContents, ceData, elementFlags, widget); - double progress = pb->progress(); + double progress = ceData.currentStep; bool reverse = TQApplication::reverseLayout(); - int steps = pb->totalSteps(); + int steps = ceData.totalSteps; if (!cr.isValid()) return; @@ -969,16 +967,16 @@ void KStyle::drawControl( TQ_ControlElement element, crect.setRect(cr.x()+width, cr.y(), cr.width(), cr.height()); p->save(); - p->setPen(pb->isEnabled() ? (reverse ? cg.text() : cg.highlightedText()) : cg.text()); - p->drawText(r, AlignCenter, pb->progressString()); + p->setPen((elementFlags & CEF_IsEnabled) ? (reverse ? cg.text() : cg.highlightedText()) : cg.text()); + p->drawText(r, AlignCenter, ceData.progressText); p->setClipRect(crect); p->setPen(reverse ? cg.highlightedText() : cg.text()); - p->drawText(r, AlignCenter, pb->progressString()); + p->drawText(r, AlignCenter, ceData.progressText); p->restore(); } else { p->setPen(cg.text()); - p->drawText(r, AlignCenter, pb->progressString()); + p->drawText(r, AlignCenter, ceData.progressText); } break; diff --git a/tdefx/kstyle.h b/tdefx/kstyle.h index 7b5de8c81..f73fc2dd8 100644 --- a/tdefx/kstyle.h +++ b/tdefx/kstyle.h @@ -237,8 +237,8 @@ class TDEFX_EXPORT KStyle: public TQCommonStyle KPE_ListViewBranch }; - // Old API - // DEPRECATED + // Old API + // DEPRECATED virtual void drawKStylePrimitive( KStylePrimitive kpe, TQPainter* p, const TQWidget* widget, |