summaryrefslogtreecommitdiffstats
path: root/styles/dotnet/dotnet.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-11-11 17:29:42 -0600
committerTimothy Pearson <[email protected]>2012-11-11 17:29:42 -0600
commitb2be7bd4d62cd8743fed9f138a95e17ac91d6aa3 (patch)
treea496f3956b6f767c999c37fe3bed039ed26b7860 /styles/dotnet/dotnet.cpp
parent8bf50f1d81a5baf486143105de38e14d9ff8a56c (diff)
downloadtdeartwork-b2be7bd4d62cd8743fed9f138a95e17ac91d6aa3.tar.gz
tdeartwork-b2be7bd4d62cd8743fed9f138a95e17ac91d6aa3.zip
Fix crashes when used with third party toolkit
Diffstat (limited to 'styles/dotnet/dotnet.cpp')
-rw-r--r--styles/dotnet/dotnet.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/styles/dotnet/dotnet.cpp b/styles/dotnet/dotnet.cpp
index 107f182b..666b3f80 100644
--- a/styles/dotnet/dotnet.cpp
+++ b/styles/dotnet/dotnet.cpp
@@ -1088,9 +1088,8 @@ void dotNETstyle::drawControl(TQ_ControlElement element,
}
case CE_PushButton: {
- TQPushButton *button = (TQPushButton *)widget;
TQRect br = r;
- bool btnDefault = button->isDefault();
+ bool btnDefault = (elementFlags & CEF_IsDefault);
static int di = pixelMetric(PM_ButtonDefaultIndicator, ceData, elementFlags);
br.addCoords(di, di, -di, -di);
@@ -1581,8 +1580,6 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
// TOOLBUTTON
// ----------
case CC_ToolButton: {
- const TQToolButton *tb = (const TQToolButton *) widget;
-
TQRect button, menuarea;
button = querySubControlMetrics(control, ceData, elementFlags, SC_ToolButton, opt, widget);
menuarea = querySubControlMetrics(control, ceData, elementFlags, SC_ToolButtonMenu, opt, widget);
@@ -1600,11 +1597,9 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
// If we're pressed, on, or raised...
if (bflags & (Style_Down | Style_On | Style_Raised)) {
drawPrimitive(PE_ButtonTool, p, ceData, elementFlags, button, cg, bflags, opt);
- } else if (tb->parentWidget() &&
- tb->parentWidget()->backgroundPixmap() &&
- !tb->parentWidget()->backgroundPixmap()->isNull()) {
- TQPixmap pixmap = *(tb->parentWidget()->backgroundPixmap());
- p->drawTiledPixmap( r, pixmap, tb->pos() );
+ } else if (!ceData.parentWidgetData.bgPixmap.isNull()) {
+ TQPixmap pixmap = ceData.parentWidgetData.bgPixmap;
+ p->drawTiledPixmap( r, pixmap, ceData.pos );
}
}
@@ -1616,8 +1611,8 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
drawPrimitive(PE_ArrowDown, p, ceData, elementFlags, menuarea, cg, mflags, opt);
}
- if (tb->hasFocus() && !tb->focusProxy()) {
- TQRect fr = tb->rect();
+ if ((elementFlags & CEF_HasFocus) && !(elementFlags & CEF_HasFocusProxy)) {
+ TQRect fr = ceData.rect;
fr.addCoords(2, 2, -2, -2);
drawPrimitive(PE_FocusRect, p, ceData, elementFlags, fr, cg);
}