From 7bcedaa7972f1ee23f57c76e6964b53a01b59ccd Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 17 Oct 2012 15:06:17 -0500 Subject: Do not use direct widget access when drawing tabs and popup menus --- styles/dotnet/dotnet.cpp | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'styles/dotnet/dotnet.cpp') 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 -- cgit v1.2.1