diff options
Diffstat (limited to 'tdestyles/highcontrast')
| -rw-r--r-- | tdestyles/highcontrast/config/highcontrastconfig.cpp | 4 | ||||
| -rw-r--r-- | tdestyles/highcontrast/config/highcontrastconfig.h | 2 | ||||
| -rw-r--r-- | tdestyles/highcontrast/highcontrast.cpp | 77 | ||||
| -rw-r--r-- | tdestyles/highcontrast/highcontrast.h | 22 |
4 files changed, 49 insertions, 56 deletions
diff --git a/tdestyles/highcontrast/config/highcontrastconfig.cpp b/tdestyles/highcontrast/config/highcontrastconfig.cpp index 8d8df0e79..ce43f45bd 100644 --- a/tdestyles/highcontrast/config/highcontrastconfig.cpp +++ b/tdestyles/highcontrast/config/highcontrastconfig.cpp @@ -33,7 +33,7 @@ DEALINGS IN THE SOFTWARE. #include "highcontrastconfig.h" -extern "C" KDE_EXPORT TQWidget* +extern "C" TDE_EXPORT TQWidget* allocate_tdestyle_config(TQWidget* parent) { return new HighContrastStyleConfig(parent); @@ -57,7 +57,7 @@ HighContrastStyleConfig::HighContrastStyleConfig( "/highcontraststyle/Settings/wideLines", false); wideLinesBox->setChecked(originalWideLinesState); - connect(wideLinesBox, TQT_SIGNAL(toggled(bool)), TQT_SLOT(updateChanged())); + connect(wideLinesBox, TQ_SIGNAL(toggled(bool)), TQ_SLOT(updateChanged())); } HighContrastStyleConfig::~HighContrastStyleConfig() diff --git a/tdestyles/highcontrast/config/highcontrastconfig.h b/tdestyles/highcontrast/config/highcontrastconfig.h index d52a22b47..0f0a5ca09 100644 --- a/tdestyles/highcontrast/config/highcontrastconfig.h +++ b/tdestyles/highcontrast/config/highcontrastconfig.h @@ -31,7 +31,7 @@ class TQCheckBox; class HighContrastStyleConfig: public TQWidget { - Q_OBJECT + TQ_OBJECT public: HighContrastStyleConfig(TQWidget* parent); ~HighContrastStyleConfig(); 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; diff --git a/tdestyles/highcontrast/highcontrast.h b/tdestyles/highcontrast/highcontrast.h index 552526254..688742fb6 100644 --- a/tdestyles/highcontrast/highcontrast.h +++ b/tdestyles/highcontrast/highcontrast.h @@ -48,7 +48,7 @@ class TQPopupMenu; class HighContrastStyle : public TDEStyle { - Q_OBJECT + TQ_OBJECT public: HighContrastStyle(); @@ -69,7 +69,7 @@ class HighContrastStyle : public TDEStyle const TQStyleOption& = TQStyleOption::Default, const TQWidget* widget = 0 ) const; - void drawPrimitive( TQ_PrimitiveElement pe, + void drawPrimitive( PrimitiveElement pe, TQPainter* p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, @@ -78,7 +78,7 @@ class HighContrastStyle : public TDEStyle SFlags flags = Style_Default, const TQStyleOption& = TQStyleOption::Default ) const; - void drawControl( TQ_ControlElement element, + void drawControl( ControlElement element, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, @@ -88,7 +88,7 @@ class HighContrastStyle : public TDEStyle const TQStyleOption& = TQStyleOption::Default, const TQWidget *widget = 0 ) const; - void drawControlMask( TQ_ControlElement element, + void drawControlMask( ControlElement element, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, @@ -96,7 +96,7 @@ class HighContrastStyle : public TDEStyle const TQStyleOption& = TQStyleOption::Default, const TQWidget *widget = 0 ) const; - void drawComplexControl( TQ_ComplexControl control, + void drawComplexControl( ComplexControl control, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, @@ -108,7 +108,7 @@ class HighContrastStyle : public TDEStyle const TQStyleOption& = TQStyleOption::Default, const TQWidget *widget = 0 ) const; - void drawComplexControlMask( TQ_ComplexControl control, + void drawComplexControlMask( ComplexControl control, TQPainter *p, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, @@ -116,7 +116,7 @@ class HighContrastStyle : public TDEStyle const TQStyleOption& = TQStyleOption::Default, const TQWidget *widget = 0 ) const; - TQRect querySubControlMetrics( TQ_ComplexControl control, + TQRect querySubControlMetrics( ComplexControl control, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl subcontrol, @@ -149,7 +149,7 @@ class HighContrastStyle : public TDEStyle TQRect subRect (SubRect subrect, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, const TQWidget * widget) const; - int styleHint(TQ_StyleHint, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, + int styleHint(StyleHint, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQStyleOption & = TQStyleOption::Default, TQStyleHintReturn * = 0, const TQWidget * = 0 ) const; @@ -166,15 +166,11 @@ class HighContrastStyle : public TDEStyle void drawRect (TQPainter* p, TQRect r, int offset = 0, bool filled = true) const; void drawRoundRect (TQPainter* p, TQRect r, int offset = 0, bool filled = true) const; void drawEllipse (TQPainter* p, TQRect r, int offset = 0, bool filled = true) const; - void drawArrow (TQPainter* p, TQRect r, TQ_PrimitiveElement arrow, int offset = 0) const; + void drawArrow (TQPainter* p, TQRect r, PrimitiveElement arrow, int offset = 0) const; int basicLineWidth; // Disable copy constructor and = operator HighContrastStyle( const HighContrastStyle & ); HighContrastStyle& operator=( const HighContrastStyle & ); }; - -// vim: set noet ts=4 sw=4: -// kate: indent-width 4; replace-tabs off; smart-indent on; tab-width 4; - #endif |
