summaryrefslogtreecommitdiffstats
path: root/style/lipstik.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-17 15:08:23 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-17 15:08:23 -0500
commit001fa24363bf5761d76794f28844c5d3fdccec64 (patch)
tree5504b5b6afb4a2141d45f1374b3006259776744b /style/lipstik.cpp
parent8e1d13677231dbaef4cdd985df209e2e1ca51ac3 (diff)
downloadtde-style-lipstik-001fa24363bf5761d76794f28844c5d3fdccec64.tar.gz
tde-style-lipstik-001fa24363bf5761d76794f28844c5d3fdccec64.zip
Do not use direct widget access when drawing tabs and popup menus
Diffstat (limited to 'style/lipstik.cpp')
-rw-r--r--style/lipstik.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/style/lipstik.cpp b/style/lipstik.cpp
index 4ba5deb..46dc294 100644
--- a/style/lipstik.cpp
+++ b/style/lipstik.cpp
@@ -2619,24 +2619,19 @@ void LipstikStyle::drawControl(ControlElement element,
// TABS
// ----
case CE_TabBarTab: {
- const TQTabBar * tb = (const TQTabBar *) widget;
bool cornerWidget = false;
- if( ::tqqt_cast<TQTabWidget*>(tb->parent()) ) {
- const TQTabWidget *tw = (const TQTabWidget*)tb->parent();
- // is there a corner widget in the (top) left edge?
- TQWidget *cw = tw->cornerWidget(TQt::TopLeft);
- if(cw)
- cornerWidget = true;
+ if (!ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].widgetObjectTypes.isEmpty()) {
+ cornerWidget = true;
}
- TQTabBar::Shape tbs = tb->shape();
+ TQTabBar::Shape tbs = ceData.tabBarData.shape;
bool selected = false;
if (flags & Style_Selected) selected = true;
TabPosition pos;
- if (tb->count() == 1) {
+ if (ceData.tabBarData.tabCount == 1) {
pos = Single;
- } else if ((tb->indexOf(opt.tab()->identifier()) == 0)) {
+ } else if ((ceData.tabBarData.identIndexMap[opt.tab()->identifier()] == 0)) {
pos = First;
- } else if (tb->indexOf(opt.tab()->identifier()) == tb->count() - 1) {
+ } else if (ceData.tabBarData.identIndexMap[opt.tab()->identifier()] == ceData.tabBarData.tabCount - 1) {
pos = Last;
} else {
pos = Middle;
@@ -2831,7 +2826,6 @@ void LipstikStyle::drawControl(ControlElement element,
// POPUPMENU ITEM (highlighted on mouseover)
// ------------------------------------------
case CE_PopupMenuItem: {
- const TQPopupMenu *popupmenu = static_cast< const TQPopupMenu * >( widget );
TQMenuItem *mi = opt.menuItem();
if ( !mi )
@@ -2846,7 +2840,7 @@ void LipstikStyle::drawControl(ControlElement element,
int tab = opt.tabWidth();
int checkcol = opt.maxIconWidth();
bool enabled = mi->isEnabled();
- bool checkable = popupmenu->isCheckable();
+ bool checkable = (elementFlags & CEF_IsCheckable);
bool active = flags & Style_Active;
bool etchtext = styleHint( SH_EtchDisabledText, ceData, elementFlags );
bool reverse = TQApplication::reverseLayout();
@@ -3748,9 +3742,8 @@ int LipstikStyle::pixelMetric(PixelMetric m, TQStyleControlElementData ceData, C
// 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 4;