From 2ed8f9ade70bd38a541d7e62e02962a1311aabb5 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 16 Oct 2012 16:02:16 -0500 Subject: Use internal Qt hover widget drawing --- kstyles/highcontrast/highcontrast.cpp | 53 ----------------------------------- kstyles/highcontrast/highcontrast.h | 2 -- 2 files changed, 55 deletions(-) (limited to 'kstyles/highcontrast') diff --git a/kstyles/highcontrast/highcontrast.cpp b/kstyles/highcontrast/highcontrast.cpp index 543b71d0f..7b6ed4a9e 100644 --- a/kstyles/highcontrast/highcontrast.cpp +++ b/kstyles/highcontrast/highcontrast.cpp @@ -118,7 +118,6 @@ HighContrastStyle::HighContrastStyle() TQSettings settings; settings.beginGroup("/highcontraststyle/Settings/"); bool useWideLines = settings.readBoolEntry("wideLines", false); - hoverWidget = 0L; basicLineWidth = useWideLines ? 4 : 2; } @@ -665,9 +664,6 @@ void HighContrastStyle::drawKStylePrimitive (KStylePrimitive kpe, const TQStyleOption &opt, const TQWidget* widget ) const { - if ( widget == hoverWidget ) - flags |= Style_MouseOver; - switch ( kpe ) { // TOOLBAR HANDLE @@ -760,9 +756,6 @@ void HighContrastStyle::drawControl (TQ_ControlElement element, const TQStyleOption& opt, const TQWidget *widget ) const { - if ( widget == hoverWidget ) - flags |= Style_MouseOver; - switch (element) { // TABS @@ -1213,9 +1206,6 @@ void HighContrastStyle::drawComplexControl (TQ_ComplexControl control, const TQStyleOption& opt, const TQWidget *widget ) const { - if ( widget == hoverWidget ) - flags |= Style_MouseOver; - switch(control) { // COMBOBOX @@ -1830,49 +1820,6 @@ TQRect HighContrastStyle::subRect (SubRect subrect, const TQStyleControlElementD bool HighContrastStyle::objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *event ) { - if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) { - TQObject* object = reinterpret_cast(source); - - TQWidget* widget = dynamic_cast(object); - if (widget) - { - // Handle hover effects. - if (event->type() == TQEvent::Enter - && (widget->inherits (TQBUTTON_OBJECT_NAME_STRING) - || widget->inherits (TQCOMBOBOX_OBJECT_NAME_STRING) - || widget->inherits (TQSPINWIDGET_OBJECT_NAME_STRING))) - { - hoverWidget = widget; - widget->repaint (false); - } - else if (event->type() == TQEvent::Leave - && (widget->inherits (TQBUTTON_OBJECT_NAME_STRING) - || widget->inherits (TQCOMBOBOX_OBJECT_NAME_STRING) - || widget->inherits (TQSPINWIDGET_OBJECT_NAME_STRING))) - { - if (TQT_BASE_OBJECT(object) == TQT_BASE_OBJECT(hoverWidget)) - hoverWidget = 0L; - widget->repaint (false); - } - // Make sure the focus rectangle is shown correctly. - else if (event->type() == TQEvent::FocusIn || event->type() == TQEvent::FocusOut) - { - TQWidget* widgetparent = dynamic_cast(widget->parent()); - while (widgetparent - && ! widgetparent->inherits (TQCOMBOBOX_OBJECT_NAME_STRING) - && ! widgetparent->inherits (TQSPINWIDGET_OBJECT_NAME_STRING)) - { - widgetparent = dynamic_cast(widgetparent->parent()); - } - - if (widgetparent) - widgetparent->repaint (false); - else - widget->repaint (false); - } - } - } - return KStyle::objectEventHandler (ceData, elementFlags, source, event); } diff --git a/kstyles/highcontrast/highcontrast.h b/kstyles/highcontrast/highcontrast.h index 509d6552a..56470993a 100644 --- a/kstyles/highcontrast/highcontrast.h +++ b/kstyles/highcontrast/highcontrast.h @@ -152,8 +152,6 @@ class HighContrastStyle : public KStyle protected: virtual bool objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ); - TQWidget *hoverWidget; - private: void setColorsNormal (TQPainter* p, const TQColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const; void setColorsButton (TQPainter* p, const TQColorGroup& cg, int flags = Style_Enabled, int highlight = Style_Down|Style_MouseOver) const; -- cgit v1.2.1