summaryrefslogtreecommitdiffstats
path: root/kstyles/highcontrast
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-16 16:02:16 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-16 16:02:16 -0500
commit2ed8f9ade70bd38a541d7e62e02962a1311aabb5 (patch)
treee369c4e00f3e1b2b112c3282293290d9dc6441a1 /kstyles/highcontrast
parenta151a4d477b5f9948ada98155ea9bcca7973748f (diff)
downloadtdelibs-2ed8f9ade70bd38a541d7e62e02962a1311aabb5.tar.gz
tdelibs-2ed8f9ade70bd38a541d7e62e02962a1311aabb5.zip
Use internal Qt hover widget drawing
Diffstat (limited to 'kstyles/highcontrast')
-rw-r--r--kstyles/highcontrast/highcontrast.cpp53
-rw-r--r--kstyles/highcontrast/highcontrast.h2
2 files changed, 0 insertions, 55 deletions
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<TQObject*>(source);
-
- TQWidget* widget = dynamic_cast<TQWidget*>(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<TQWidget*>(widget->parent());
- while (widgetparent
- && ! widgetparent->inherits (TQCOMBOBOX_OBJECT_NAME_STRING)
- && ! widgetparent->inherits (TQSPINWIDGET_OBJECT_NAME_STRING))
- {
- widgetparent = dynamic_cast<TQWidget*>(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;