summaryrefslogtreecommitdiffstats
path: root/style/eventfilter.cpp
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2016-04-04 19:46:56 +0200
committerSlávek Banko <[email protected]>2016-04-04 19:46:56 +0200
commit18d1b57c9c5dc49139552decf66ee87f697cb308 (patch)
tree347afa3bf349ca48c4ce8f6d4487753836895142 /style/eventfilter.cpp
parent3af7196c106fb887db114b01f14c0f9975368bb4 (diff)
downloadtde-style-baghira-18d1b57c9c5dc49139552decf66ee87f697cb308.tar.gz
tde-style-baghira-18d1b57c9c5dc49139552decf66ee87f697cb308.zip
Convert TDEStyle::eventFilter to objectEventHandler
Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'style/eventfilter.cpp')
-rw-r--r--style/eventfilter.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/style/eventfilter.cpp b/style/eventfilter.cpp
index 4d1eb4b..8200ba1 100644
--- a/style/eventfilter.cpp
+++ b/style/eventfilter.cpp
@@ -4,8 +4,20 @@
#include <X11/extensions/XTest.h>
#include <fixx11h.h>
-bool LiquidStyle::eventFilter( TQObject *obj, TQEvent *ev )
+bool LiquidStyle::objectEventHandler( const TQStyleControlElementData &ceData,
+ ControlElementFlags elementFlags,
+ void* source,
+ TQEvent *ev )
{
+ if (TDEStyle::objectEventHandler(ceData, elementFlags, source, ev)) {
+ return true;
+ }
+
+ if (!ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) {
+ return false;
+ }
+ TQObject* obj = reinterpret_cast<TQObject*>(source);
+
// tqWarning("%s, %s <- %s, %s: %d", obj->className(), obj->name(), obj->parent() ? obj->parent()->className() : "none", obj->parent()?obj->parent()->name():"none",ev->type());
switch (ev->type())
{
@@ -179,8 +191,6 @@ bool LiquidStyle::eventFilter( TQObject *obj, TQEvent *ev )
TQButton * btn = ( TQButton * ) obj;
bool isStatusChild = btn->parent() && ( btn->parent() ->inherits( "TQStatusBar" ) || btn->parent() ->inherits( "KonqFrameStatusBar" ) );
bool isRadio = obj->inherits( "TQRadioButton" );
- const TQStyleControlElementData &ceData = populateControlElementDataFromWidget(btn, TQStyleOption());
- ControlElementFlags elementFlags = getControlElementFlagsForObject(btn, TQStyleOption());
btn->erase();
TQPainter p;
p.begin( btn );
@@ -342,8 +352,6 @@ bool LiquidStyle::eventFilter( TQObject *obj, TQEvent *ev )
{
bool isStatusChild = btn->parent() && ( btn->parent() ->inherits( "TQStatusBar" ) || btn->parent() ->inherits( "KonqFrameStatusBar" ) );
bool isRadio = obj->inherits( "TQRadioButton" );
- const TQStyleControlElementData &ceData = populateControlElementDataFromWidget(btn, TQStyleOption());
- ControlElementFlags elementFlags = getControlElementFlagsForObject(btn, TQStyleOption());
highlightWidget = btn;
TQFontMetrics fm = btn->fontMetrics();
TQSize lsz = fm.size( ShowPrefix, btn->text() );
@@ -489,8 +497,6 @@ bool LiquidStyle::eventFilter( TQObject *obj, TQEvent *ev )
{
bool isRadio = obj->inherits( "TQRadioButton" );
bool isStatusChild = btn->parent() && ( btn->parent() ->inherits( "TQStatusBar" ) || btn->parent() ->inherits( "KonqFrameStatusBar" ) );
- const TQStyleControlElementData &ceData = populateControlElementDataFromWidget(btn, TQStyleOption());
- ControlElementFlags elementFlags = getControlElementFlagsForObject(btn, TQStyleOption());
highlightWidget = NULL;
TQFontMetrics fm = btn->fontMetrics();
TQSize lsz = fm.size( ShowPrefix, btn->text() );