summaryrefslogtreecommitdiffstats
path: root/styles/dotnet/dotnet.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-10-17 15:06:17 -0500
committerTimothy Pearson <[email protected]>2012-10-17 15:06:17 -0500
commit7bcedaa7972f1ee23f57c76e6964b53a01b59ccd (patch)
tree4bed036dc38e6de78ce4a9ce25f350685f48a30c /styles/dotnet/dotnet.cpp
parent4983755f93621b75b7853a4bab7a5c2bb54fbb56 (diff)
downloadtdeartwork-7bcedaa7972f1ee23f57c76e6964b53a01b59ccd.tar.gz
tdeartwork-7bcedaa7972f1ee23f57c76e6964b53a01b59ccd.zip
Do not use direct widget access when drawing tabs and popup menus
Diffstat (limited to 'styles/dotnet/dotnet.cpp')
-rw-r--r--styles/dotnet/dotnet.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/styles/dotnet/dotnet.cpp b/styles/dotnet/dotnet.cpp
index 5c85aefc..11e68412 100644
--- a/styles/dotnet/dotnet.cpp
+++ b/styles/dotnet/dotnet.cpp
@@ -869,20 +869,15 @@ void dotNETstyle::drawControl(TQ_ControlElement element,
// TABS
// ----
case CE_TabBarTab: {
- const TQTabBar *tb = (const TQTabBar *) widget;
bool cornerWidget = false;
- TQTabBar::Shape tbs = tb->shape();
+ TQTabBar::Shape tbs = ceData.tabBarData.shape;
bool selected = flags & Style_Selected;
int x, x2, y, y2, w, h;
r.rect(&x, &y, &w, &h);
r.coords(&x, &y, &x2, &y2);
- if (tb->parent()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) {
- const TQTabWidget *tw = (const TQTabWidget *)tb->parent();
- TQWidget *cw = tw->cornerWidget(TQt::TopLeft);
- if (cw) {
- cornerWidget = true;
- }
+ if (!ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].widgetObjectTypes.isEmpty()) {
+ cornerWidget = true;
}
switch (tbs) {
@@ -1200,7 +1195,6 @@ void dotNETstyle::drawControl(TQ_ControlElement element,
return;
}
- const TQPopupMenu *pum = (const TQPopupMenu *) widget;
static const int itemFrame = 2;
static const int itemHMargin = 3;
static const int itemVMargin = 3;
@@ -1215,13 +1209,13 @@ void dotNETstyle::drawControl(TQ_ControlElement element,
bool active = flags & Style_Active;
bool disabled = !mi->isEnabled();
- bool checkable = pum->isCheckable();
+ bool checkable = (elementFlags & CEF_IsCheckable);
int xpos = x;
int xm = itemFrame + checkcol + itemHMargin;
- if (pum->erasePixmap() && !pum->erasePixmap()->isNull()) {
- p->drawPixmap( x, y, *pum->erasePixmap(), x, y, w, h );
+ if (!ceData.bgPixmap.isNull()) {
+ p->drawPixmap( x, y, ceData.bgPixmap, x, y, w, h );
} else {
if (!TQApplication::reverseLayout()) {
p->fillRect( x, y, 22, h, cg.mid() );
@@ -1814,18 +1808,16 @@ int dotNETstyle::pixelMetric(PixelMetric m, TQStyleControlElementData ceData, Co
// TABS
// ----
case PM_TabBarTabVSpace: {
- const TQTabBar * tb = (const TQTabBar *) widget;
- if (tb->shape() == TQTabBar::RoundedAbove ||
- tb->shape() == TQTabBar::RoundedBelow)
+ if (ceData.tabBarData.shape == TQTabBar::RoundedAbove ||
+ ceData.tabBarData.shape == TQTabBar::RoundedBelow)
return 12;
else
return 0;
}
case PM_TabBarTabOverlap: {
- const TQTabBar* tb = (const TQTabBar*)widget;
- if (tb->shape() != TQTabBar::RoundedAbove &&
- tb->shape() != TQTabBar::RoundedBelow)
+ if (ceData.tabBarData.shape != TQTabBar::RoundedAbove &&
+ ceData.tabBarData.shape != TQTabBar::RoundedBelow)
return 3; // Leave standard size alone
else
return 1; // Change size for our tabs only