Minor syntatical cleanup, no functional changes

pull/1/head
Timothy Pearson 10 years ago
parent 0ea8899390
commit ef83a78fa7

@ -235,15 +235,9 @@ static void adjust(TQRect &r, int dx1, int dy1, int dx2, int dy2)
inline bool isSpecialHover(TQWidget *w)
{
return w && (
#if 0x039999 >= 0x030200
::tqqt_cast<TQRadioButton *>(w) ||
::tqqt_cast<TQCheckBox *>(w) ||
#endif
::tqqt_cast<TQScrollBar *>(w) ||
#if defined TDE_VERSION && TDE_VERSION >= 0x30400 && TDE_VERSION < 0x30500
::tqqt_cast<TQToolButton *>(w) ||
#endif
::tqqt_cast<TQHeader *>(w) ||
::tqqt_cast<TQSpinWidget *>(w) ||
::tqqt_cast<TQComboBox *>(w) ||
@ -1230,11 +1224,11 @@ void QtCurveStyle::applicationPolish(const TQStyleControlElementData &ceData, Co
{
TQMetaObject *meta=(TQMetaObject *)metaObject();
#ifdef USE_QT4
#warning Qt4 does not allow the metaobject classname to be set (skipping)
#else // USE_QT4
#ifdef USE_QT4
#warning Qt4 does not allow the metaobject classname to be set (skipping)
#else // USE_QT4
meta->classname="HighContrastStyle";
#endif // USE_QT4
#endif // USE_QT4
}
if(opts.scrollbarType==SCROLLBAR_NEXT)
@ -1533,7 +1527,9 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
((TQHBox *)widget)->setLineWidth(0);
if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::tqqt_cast<const TQPopupMenu *>(widget))
{
installObjectEventHandler(ceData, elementFlags, ptr, this);
}
#if 0
if(opts.menubarHiding && ::tqqt_cast<TQMainWindow *>(widget) && static_cast<TQMainWindow *>(widget)->menuBar())
@ -1561,10 +1557,8 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
if(framelessGroupBoxCheckBox || enableFilter)
{
#if 0x039999 >= 0x030200
if(!isFormWidget(widget))
widget->setMouseTracking(true);
#endif
if(framelessGroupBoxCheckBox)
{
TQFont fnt(ceData.font);
@ -1591,9 +1585,6 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
if(enableFilter)
{
installObjectEventHandler(ceData, elementFlags, ptr, this);
#if defined TDE_VERSION && TDE_VERSION >= 0x30400 && TDE_VERSION < 0x30500
widget->setMouseTracking(true);
#endif
}
}
else if (::tqqt_cast<TQButton *>(widget) || ceData.widgetObjectTypes.contains("TQToolBarExtensionWidget"))
@ -1618,10 +1609,12 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
widget->setMouseTracking(true);
if(((TQComboBox *)widget)->listBox())
{
((TQComboBox *)widget)->listBox()->installEventFilter(this);
// FIXME
// installObjectEventHandler(ceData, elementFlags, ptr, this);
}
}
else if(::tqqt_cast<TQMenuBar *>(widget))
{
if(NoBackground!=widget->backgroundMode())
@ -1860,7 +1853,9 @@ void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElem
itsKhtmlWidgets.remove(widget);
if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::tqqt_cast<const TQPopupMenu *>(widget))
{
removeObjectEventHandler(ceData, elementFlags, ptr, this);
}
#if 0
if(opts.menubarHiding && ::tqqt_cast<TQMainWindow *>(widget) && static_cast<TQMainWindow *>(widget)->menuBar())
@ -1872,9 +1867,7 @@ void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElem
if (::tqqt_cast<TQRadioButton *>(widget) || ::tqqt_cast<TQCheckBox *>(widget))
{
#if 0x039999 >= 0x030200
widget->setMouseTracking(false);
#endif
removeObjectEventHandler(ceData, elementFlags, ptr, this);
}
else if (::tqqt_cast<TQHeader *>(widget) || ::tqqt_cast<TQTabBar *>(widget) || ::tqqt_cast<TQSpinWidget *>(widget) /*||
@ -1894,9 +1887,6 @@ void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElem
if(NoBackground!=widget->backgroundMode()) // && onToolBar(widget))
widget->setBackgroundMode(PaletteButton);
removeObjectEventHandler(ceData, elementFlags, ptr, this);
#if defined TDE_VERSION && TDE_VERSION >= 0x30400 && TDE_VERSION < 0x30500
widget->setMouseTracking(false);
#endif
}
else if (::tqqt_cast<TQComboBox *>(widget))
{
@ -1905,10 +1895,12 @@ void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElem
removeObjectEventHandler(ceData, elementFlags, ptr, this);
widget->setMouseTracking(false);
if(((TQComboBox *)widget)->listBox())
{
((TQComboBox *)widget)->listBox()->removeEventFilter(this);
// FIXME
// removeObjectEventHandler(ceData, elementFlags, ptr, this);
}
}
else if (::tqqt_cast<TQToolBar *>(widget) || ::tqqt_cast<TQPopupMenu *>(widget))
{
if(NoBackground!=widget->backgroundMode())
@ -2079,9 +2071,11 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
if(!::tqqt_cast<TQLineEdit*>(object) && !::tqqt_cast<TQTextEdit*>(object) &&
!(DO_EFFECT && ::tqqt_cast<TQComboBox*>(object)))
{
return false; // Now draw the contents
}
}
}
else if (NO_FRAME(opts.groupBox) && TQEvent::Move==event->type() && isCheckBoxOfGroupBox(object))
{
TQCheckBox *cb=static_cast<TQCheckBox *>(TQT_TQWIDGET(object));
@ -2105,10 +2099,14 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
TQColor col(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : ceData.palette.active().background());
if(APPEARANCE_STRIPED==opts.menuBgndAppearance)
{
painter.drawTiledPixmap(ceData.rect, *createStripePixmap(col, false));
}
else
{
drawBevelGradientReal(col, &painter, ceData.rect, GT_HORIZ==opts.menuBgndGrad, false,
opts.menuBgndAppearance, WIDGET_OTHER);
}
return false;
}
else if (object->inherits("TDEToolBarSeparator"))
@ -2119,13 +2117,19 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
{
TQPainter painter(frame);
if (TQFrame::VLine==frame->frameShape())
{
drawPrimitive(PE_DockWindowSeparator, &painter, TQStyleControlElementData(), CEF_None, frame->rect(),
frame->colorGroup(), Style_Horizontal);
}
else if (TQFrame::HLine==frame->frameShape())
{
drawPrimitive(PE_DockWindowSeparator, &painter, TQStyleControlElementData(), CEF_None, frame->rect(),
frame->colorGroup());
}
else
{
return false;
}
return true; // been drawn!
}
}
@ -2140,11 +2144,15 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
if(tb && (TQTabBar::RoundedBelow == tb->shape() ||
TQTabBar::TriangularBelow == tb->shape()))
{
r.addCoords(0, 0, 0, -tbHeight);
}
else
{
r.addCoords(0, tbHeight, 0, 0);
drawPrimitive(PE_PanelTabWidget, &painter, TQStyleControlElementData(), CEF_None, r, ceData.colorGroup,
Style_Horizontal|Style_Enabled);
}
return true;
}
}
@ -2216,7 +2224,7 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
{
const TQColor &col(((TQWidget *)object)->palette().active().color(TQColorGroup::Foreground));
// If we're relouring the menubar text, check to see if menubar palette has changed, if so set back to
// If we're recolouring the menubar text, check to see if menubar palette has changed, if so set back to
// our values. This fixes opera - which seems to change the widgets palette after it is polished.
if((opts.customMenuTextColor && col!=opts.customMenuNormTextColor) ||
( (SHADE_BLEND_SELECTED==opts.shadeMenubars || SHADE_SELECTED==opts.shadeMenubars ||
@ -2317,7 +2325,7 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
break;
}
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
if(opts.fixParentlessDialogs && ::tqqt_cast<TQDialog *>(object))
{
TQDialog *dlg=(TQDialog *)object;
@ -2390,7 +2398,7 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
}
return false;
}
#endif
#endif
// Track show events for progress bars
if (opts.animatedProgress && ::tqqt_cast<TQProgressBar*>(object))
@ -2413,10 +2421,10 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
(((TQListBox *)object)->parentWidget() &&
::tqqt_cast<TQComboBox *>(((TQListBox *)object)->parentWidget())))
((TQComboBox *)(((TQListBox *)object)->parentWidget()))->repaint(false);
// else if(::tqqt_cast<TQFrame *>(object) &&
// (TQFrame::Box==((TQFrame *)object)->frameShape() || TQFrame::Panel==((TQFrame *)object)->frameShape() ||
// TQFrame::WinPanel==((TQFrame *)object)->frameShape()))
// ((TQFrame *)object)->setFrameShape(TQFrame::StyledPanel);
// else if(::tqqt_cast<TQFrame *>(object) &&
// (TQFrame::Box==((TQFrame *)object)->frameShape() || TQFrame::Panel==((TQFrame *)object)->frameShape() ||
// TQFrame::WinPanel==((TQFrame *)object)->frameShape()))
// ((TQFrame *)object)->setFrameShape(TQFrame::StyledPanel);
break;
case TQEvent::Enter:
if(object->isWidgetType())
@ -3203,10 +3211,6 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
flags=((flags|Style_Down)^Style_Down)| Style_Sunken;
flags|=Style_Enabled;
#if defined TQTC_TQT_ONLY || !defined TDE_VERSION
#if defined TDE_VERSION && TDE_VERSION >= 0x30400 && TDE_VERSION < 0x30500
if(HOVER_KICKER==itsHover && itsHoverWidget) // && itsHoverWidget==p->device())
flags|=Style_MouseOver;
#endif
itsFormMode=itsIsTransKicker;
#endif
drawLightBevel(p, r, cg, flags|Style_Horizontal, ROUNDED_ALL,
@ -4877,7 +4881,6 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
}
break;
}
#if 0x039999 >= 0x030200
case CE_TabBarLabel:
{
if (data.isDefault())
@ -4939,7 +4942,6 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
}
break;
}
#endif
case CE_PushButtonLabel: // Taken from Highcolor and Plastik...
{
int x, y, w, h, arrowOffset=DO_EFFECT ? 1 : 0;
@ -5458,21 +5460,15 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
const TQCheckBox *checkbox((const TQCheckBox *)widget);
if(flags&Style_MouseOver && opts.crHighlight &&
#if 0x039999 >= 0x030200
HOVER_CHECK==itsHover && itsHoverWidget && itsHoverWidget==widget &&
#endif
!isFormWidget(widget))
{
#if 0x039999 >= 0x030200
TQRect cr(checkbox->rect());
TQRegion r(TQRect(cr.x(), cr.y(), visualRect(subRect(SR_CheckBoxFocusRect, ceData, elementFlags, widget),
ceData, elementFlags).width()+
pixelMetric(PM_IndicatorWidth, ceData, elementFlags)+4,
cr.height()));
#else
TQRegion r(ceData.rect);
#endif
r-=visualRect(subRect(SR_CheckBoxIndicator, ceData, elementFlags, widget), ceData, elementFlags);
p->setClipRegion(r);
drawBevelGradient(shade(cg.background(), TO_FACTOR(opts.crHighlight)), p, checkbox->rect(), true,
@ -5502,21 +5498,15 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
const TQRadioButton *radiobutton((const TQRadioButton *)widget);
if(flags&Style_MouseOver && opts.crHighlight &&
#if 0x039999 >= 0x030200
HOVER_RADIO==itsHover && itsHoverWidget && itsHoverWidget==widget &&
#endif
!isFormWidget(widget))
{
#if 0x039999 >= 0x030200
TQRect rb(radiobutton->rect());
TQRegion r(TQRect(rb.x(), rb.y(),
visualRect(subRect(SR_RadioButtonFocusRect, ceData, elementFlags, widget),
ceData, elementFlags).width()+
pixelMetric(PM_ExclusiveIndicatorWidth, ceData, elementFlags)+4,
rb.height()));
#else
TQRegion r(ceData.rect);
#endif
r-=visualRect(subRect(SR_RadioButtonIndicator, ceData, elementFlags, widget), ceData, elementFlags);
p->setClipRegion(r);
drawBevelGradient(shade(cg.background(), TO_FACTOR(opts.crHighlight)), p, ceData.rect, true,
@ -6803,7 +6793,6 @@ int QtCurveStyle::pixelMetric(PixelMetric metric, const TQStyleControlElementDat
return 7;
case PM_ButtonMargin:
return 3;
#if 0x039999 >= 0x030200
case PM_TabBarTabShiftVertical:
{
return (ceData.widgetObjectTypes.contains(TQTABBAR_OBJECT_NAME_STRING))
@ -6814,7 +6803,6 @@ int QtCurveStyle::pixelMetric(PixelMetric metric, const TQStyleControlElementDat
}
case PM_TabBarTabShiftHorizontal:
return 0;
#endif
case PM_ButtonShiftHorizontal:
case PM_ButtonShiftVertical:
return 1;
@ -8215,7 +8203,6 @@ bool QtCurveStyle::redrawHoverWidget(const TQPoint &pos)
const TQStyleControlElementData &ceData = populateControlElementDataFromWidget(itsHoverWidget, TQStyleOption());
ControlElementFlags elementFlags = getControlElementFlagsForObject(itsHoverWidget, TQStyleOption());
#if 0x039999 >= 0x030200
//
// TQt>=3.2 sets the sensitive part of a check/radio to the image + label -> anything else
// is not sensitive. But, the widget can ocupy a larger area - and this whole area will
@ -8248,7 +8235,6 @@ bool QtCurveStyle::redrawHoverWidget(const TQPoint &pos)
}
else
{
#endif
TQScrollBar *sb(::tqqt_cast<TQScrollBar *>(itsHoverWidget));
if(sb) // So, are we over add button, sub button, slider, or none?
@ -8296,16 +8282,6 @@ bool QtCurveStyle::redrawHoverWidget(const TQPoint &pos)
}
else
{
#if defined TDE_VERSION && TDE_VERSION >= 0x30400 && TDE_VERSION < 0x30500
TQToolButton *tb(::tqqt_cast<TQToolButton *>(itsHoverWidget));
if(tb)
{
itsHover=APP_KICKER==itsThemedApp ? HOVER_KICKER : HOVER_NONE;
return HOVER_KICKER==itsHover;
}
else
#endif
{
TQHeader *hd(::tqqt_cast<TQHeader *>(itsHoverWidget));
@ -8425,10 +8401,8 @@ bool QtCurveStyle::redrawHoverWidget(const TQPoint &pos)
}
}
}
#if 0x039999 >= 0x030200
}
}
#endif
return false;
}

Loading…
Cancel
Save