summaryrefslogtreecommitdiffstats
path: root/tdestyles/highcontrast/highcontrast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdestyles/highcontrast/highcontrast.cpp')
-rw-r--r--tdestyles/highcontrast/highcontrast.cpp77
1 files changed, 37 insertions, 40 deletions
diff --git a/tdestyles/highcontrast/highcontrast.cpp b/tdestyles/highcontrast/highcontrast.cpp
index ef20af360..7646d998d 100644
--- a/tdestyles/highcontrast/highcontrast.cpp
+++ b/tdestyles/highcontrast/highcontrast.cpp
@@ -73,7 +73,7 @@ class HighContrastStylePlugin : public TQStylePlugin
}
};
-KDE_Q_EXPORT_PLUGIN (HighContrastStylePlugin)
+TDE_EXPORT_PLUGIN (HighContrastStylePlugin)
// ---------------------------------------------------
@@ -154,14 +154,14 @@ void HighContrastStyle::polish( TQPalette& pal )
void HighContrastStyle::polish (const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr)
{
- if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
+ if (ceData.widgetObjectTypes.contains("TQWidget")) {
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
- if (widget->inherits (TQBUTTON_OBJECT_NAME_STRING)
- || widget->inherits (TQCOMBOBOX_OBJECT_NAME_STRING)
- || widget->inherits (TQSPINWIDGET_OBJECT_NAME_STRING)
- || widget->inherits (TQLINEEDIT_OBJECT_NAME_STRING)
- || widget->inherits (TQTEXTEDIT_OBJECT_NAME_STRING))
+ if (widget->inherits ("TQButton")
+ || widget->inherits ("TQComboBox")
+ || widget->inherits ("TQSpinWidget")
+ || widget->inherits ("TQLineEdit")
+ || widget->inherits ("TQTextEdit"))
{
installObjectEventHandler(ceData, elementFlags, ptr, this);
@@ -181,9 +181,9 @@ void HighContrastStyle::polish (const TQStyleControlElementData &ceData, Control
void HighContrastStyle::unPolish (const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr)
{
- if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) {
+ if (ceData.widgetObjectTypes.contains("TQWidget")) {
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
- if (widget->inherits (TQWIDGET_OBJECT_NAME_STRING) || widget->inherits (TQCOMBOBOX_OBJECT_NAME_STRING) || widget->inherits (TQSPINWIDGET_OBJECT_NAME_STRING) || widget->inherits (TQLINEEDIT_OBJECT_NAME_STRING) || widget->inherits (TQTEXTEDIT_OBJECT_NAME_STRING)) {
+ if (widget->inherits ("TQWidget") || widget->inherits ("TQComboBox") || widget->inherits ("TQSpinWidget") || widget->inherits ("TQLineEdit") || widget->inherits ("TQTextEdit")) {
installObjectEventHandler(ceData, elementFlags, ptr, this);
}
}
@@ -219,12 +219,12 @@ void HighContrastStyle::setColorsByState (TQPainter* p, const TQColorGroup& cg,
if ((flags & Style_Enabled) && (flags & highlight))
{
- p->setPen (TQPen (cg.highlightedText(), basicLineWidth, flags & Style_Enabled ? Qt::SolidLine : Qt::DotLine));
+ p->setPen (TQPen (cg.highlightedText(), basicLineWidth, flags & Style_Enabled ? TQt::SolidLine : TQt::DotLine));
p->setBackgroundColor (cg.highlight());
}
else
{
- p->setPen (TQPen (fg, basicLineWidth, flags & Style_Enabled ? Qt::SolidLine : Qt::DotLine));
+ p->setPen (TQPen (fg, basicLineWidth, flags & Style_Enabled ? TQt::SolidLine : TQt::DotLine));
p->setBackgroundColor (bg);
}
@@ -253,7 +253,7 @@ void HighContrastStyle::drawRoundRect (TQPainter* p, TQRect r, int offset, bool
addOffset (&r3, lineWidth);
p->save();
- p->setPen (Qt::NoPen);
+ p->setPen (TQt::NoPen);
if (filled)
p->fillRect (r3, p->backgroundColor());
p->drawRect (r3);
@@ -286,7 +286,7 @@ void HighContrastStyle::drawEllipse (TQPainter* p, TQRect r, int offset, bool fi
p->drawRoundRect (r, 99, 99);
}
-void HighContrastStyle::drawArrow (TQPainter* p, TQRect r, TQ_PrimitiveElement arrow, int offset) const
+void HighContrastStyle::drawArrow (TQPainter* p, TQRect r, PrimitiveElement arrow, int offset) const
{
p->save();
addOffset (&r, offset);
@@ -337,7 +337,7 @@ void HighContrastStyle::drawArrow (TQPainter* p, TQRect r, TQ_PrimitiveElement a
}
// This function draws primitive elements
-void HighContrastStyle::drawPrimitive (TQ_PrimitiveElement pe,
+void HighContrastStyle::drawPrimitive (PrimitiveElement pe,
TQPainter *p,
const TQStyleControlElementData &ceData,
ControlElementFlags elementFlags,
@@ -371,9 +371,9 @@ void HighContrastStyle::drawPrimitive (TQ_PrimitiveElement pe,
case PE_FocusRect: {
p->save();
p->setBrush (TQBrush ());
- p->setPen (TQPen (cg.highlight(), basicLineWidth, Qt::SolidLine));
+ p->setPen (TQPen (cg.highlight(), basicLineWidth, TQt::SolidLine));
drawRoundRect (p, r, basicLineWidth, false);
- p->setPen (TQPen (cg.highlightedText(), basicLineWidth, Qt::DashLine));
+ p->setPen (TQPen (cg.highlightedText(), basicLineWidth, TQt::DashLine));
drawRoundRect (p, r, basicLineWidth, false);
p->restore();
break;
@@ -472,7 +472,7 @@ void HighContrastStyle::drawPrimitive (TQ_PrimitiveElement pe,
case PE_ProgressBarChunk: {
- p->fillRect (r, Qt::color1);
+ p->fillRect (r, TQt::color1);
break;
}
@@ -506,7 +506,7 @@ void HighContrastStyle::drawPrimitive (TQ_PrimitiveElement pe,
break;
}
case PE_IndicatorMask: {
- p->fillRect (r, Qt::color1);
+ p->fillRect (r, TQt::color1);
break;
}
case PE_CheckMark: {
@@ -535,10 +535,10 @@ void HighContrastStyle::drawPrimitive (TQ_PrimitiveElement pe,
break;
}
case PE_ExclusiveIndicatorMask: {
- p->fillRect (r, Qt::color0);
- p->setBackgroundColor (Qt::color1);
- p->setPen (Qt::NoPen);
- p->setBrush (Qt::color1);
+ p->fillRect (r, TQt::color0);
+ p->setBackgroundColor (TQt::color1);
+ p->setPen (TQt::NoPen);
+ p->setBrush (TQt::color1);
p->drawEllipse (r);
break;
}
@@ -551,7 +551,7 @@ void HighContrastStyle::drawPrimitive (TQ_PrimitiveElement pe,
setColorsButton (p, cg, flags);
p->fillRect (r, p->backgroundColor());
- p->setPen (TQPen (p->pen().color(), 1, Qt::DashLine));
+ p->setPen (TQPen (p->pen().color(), 1, TQt::DashLine));
if (flags & Style_Horizontal)
p->drawLine (r.center().x(), r.top(), r.center().x(), r.bottom());
else
@@ -713,7 +713,7 @@ void HighContrastStyle::drawTDEStylePrimitive (TDEStylePrimitive kpe,
{
setColorsButton (p, cg);
p->fillRect (r, p->backgroundColor());
- p->setBrush (TQBrush (p->pen().color(), Qt::BDiagPattern));
+ p->setBrush (TQBrush (p->pen().color(), TQt::BDiagPattern));
drawRoundRect (p, r);
break;
}
@@ -724,7 +724,7 @@ void HighContrastStyle::drawTDEStylePrimitive (TDEStylePrimitive kpe,
case KPE_SliderGroove: {
setColorsText (p, cg, flags);
TQRect r2 (r);
- if (ceData.widgetObjectTypes.contains(TQSLIDER_OBJECT_NAME_STRING))
+ if (ceData.widgetObjectTypes.contains("TQSlider"))
{
if (ceData.orientation == TQt::Horizontal)
{
@@ -764,7 +764,7 @@ void HighContrastStyle::drawTDEStylePrimitive (TDEStylePrimitive kpe,
// Probably it would be better to add a KPM_ListViewExpander metric
// to the TDEStyle TDEStylePixelMetric enum, and have the TDEStyle
// drawComplexControl handle it.
- TQ_PrimitiveElement direction;
+ PrimitiveElement direction;
if (flags & Style_On) { // Collapsed = On
direction = PE_ArrowRight;
@@ -784,7 +784,7 @@ void HighContrastStyle::drawTDEStylePrimitive (TDEStylePrimitive kpe,
}
-void HighContrastStyle::drawControl (TQ_ControlElement element,
+void HighContrastStyle::drawControl (ControlElement element,
TQPainter *p,
const TQStyleControlElementData &ceData,
ControlElementFlags elementFlags,
@@ -1133,20 +1133,20 @@ void HighContrastStyle::drawControl (TQ_ControlElement element,
// Draw the pixmap
if ( pixmap->depth() == 1 )
- p->setBackgroundMode( Qt::OpaqueMode );
+ p->setBackgroundMode( TQt::OpaqueMode );
int diffw = ( ( w - pixmap->width() ) / 2 )
+ ( ( w - pixmap->width() ) % 2 );
p->drawPixmap( x+diffw, y+itemFrame, *pixmap );
if ( pixmap->depth() == 1 )
- p->setBackgroundMode( Qt::TransparentMode );
+ p->setBackgroundMode( TQt::TransparentMode );
}
}
// Does the menu item have a submenu?
if ( mi->popup() ) {
- TQ_PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight;
+ PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight;
int dim = pixelMetric(PM_MenuButtonIndicator, ceData, elementFlags);
TQRect vr = visualRect( TQRect( x + w - arrowHMargin - 2*itemFrame - dim,
y + h / 2 - dim / 2, dim, dim), r );
@@ -1162,7 +1162,7 @@ void HighContrastStyle::drawControl (TQ_ControlElement element,
}
}
-void HighContrastStyle::drawControlMask (TQ_ControlElement element,
+void HighContrastStyle::drawControlMask (ControlElement element,
TQPainter *p,
const TQStyleControlElementData &ceData,
ControlElementFlags elementFlags,
@@ -1207,7 +1207,7 @@ static TQListViewItem* nextVisibleSibling(TQListViewItem* item)
return sibling;
}
-void HighContrastStyle::drawComplexControl (TQ_ComplexControl control,
+void HighContrastStyle::drawComplexControl (ComplexControl control,
TQPainter *p,
const TQStyleControlElementData &ceData,
ControlElementFlags elementFlags,
@@ -1262,12 +1262,12 @@ void HighContrastStyle::drawComplexControl (TQ_ComplexControl control,
setColorsButton (p, cg, flags);
// Draw arrows if required
if (controls & SC_SpinWidgetDown) {
- TQRect r2 = TQStyle::visualRect (querySubControlMetrics ((TQ_ComplexControl)CC_SpinWidget, ceData, elementFlags, SC_SpinWidgetDown, TQStyleOption::Default, widget), ceData, elementFlags);
+ TQRect r2 = TQStyle::visualRect (querySubControlMetrics ((ComplexControl)CC_SpinWidget, ceData, elementFlags, SC_SpinWidgetDown, TQStyleOption::Default, widget), ceData, elementFlags);
drawRoundRect (p, r2);
drawArrow (p, r2, PE_SpinWidgetDown, 2*basicLineWidth);
}
if (controls & SC_SpinWidgetUp) {
- TQRect r2 = TQStyle::visualRect (querySubControlMetrics ((TQ_ComplexControl)CC_SpinWidget, ceData, elementFlags, SC_SpinWidgetUp, TQStyleOption::Default, widget), ceData, elementFlags);
+ TQRect r2 = TQStyle::visualRect (querySubControlMetrics ((ComplexControl)CC_SpinWidget, ceData, elementFlags, SC_SpinWidgetUp, TQStyleOption::Default, widget), ceData, elementFlags);
drawRoundRect (p, r2);
drawArrow (p, r2, PE_SpinWidgetUp, 2*basicLineWidth);
}
@@ -1490,7 +1490,7 @@ void HighContrastStyle::drawComplexControl (TQ_ComplexControl control,
}
}
-void HighContrastStyle::drawComplexControlMask(TQ_ComplexControl c,
+void HighContrastStyle::drawComplexControlMask(ComplexControl c,
TQPainter *p,
const TQStyleControlElementData &ceData,
const ControlElementFlags elementFlags,
@@ -1535,7 +1535,7 @@ void HighContrastStyle::drawItem( TQPainter *p,
p->restore();
}
-TQRect HighContrastStyle::querySubControlMetrics( TQ_ComplexControl control,
+TQRect HighContrastStyle::querySubControlMetrics( ComplexControl control,
const TQStyleControlElementData &ceData,
ControlElementFlags elementFlags,
SubControl subcontrol,
@@ -1622,7 +1622,7 @@ int HighContrastStyle::pixelMetric(PixelMetric m, const TQStyleControlElementDat
}
case PM_DefaultFrameWidth: {
- if (widget && (ceData.widgetObjectTypes.contains (TQLINEEDIT_OBJECT_NAME_STRING) || ceData.widgetObjectTypes.contains (TQTEXTEDIT_OBJECT_NAME_STRING)))
+ if (widget && (ceData.widgetObjectTypes.contains ("TQLineEdit") || ceData.widgetObjectTypes.contains ("TQTextEdit")))
return 2*basicLineWidth;
else
return basicLineWidth;
@@ -1862,6 +1862,3 @@ int HighContrastStyle::styleHint(StyleHint sh, const TQStyleControlElementData &
return ret;
}
-
-// vim: set noet ts=4 sw=4:
-// kate: indent-width 4; replace-tabs off; smart-indent on; tab-width 4;