From 100a40e71a3f796a93675f9940c42ebe6429740e Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 22 Jul 2023 23:31:08 +0900 Subject: [PATCH] Updated to version 0.5.2 from https://store.kde.org/p/1081202. Code available under GPL2 license Signed-off-by: Michele Calgaro --- ChangeLog | 6 ++++++ src/configdialogimpl.h | 2 +- src/kcmkommando.cpp | 2 +- src/kommando.cpp | 13 +++++++++++++ src/kommando.h | 4 +++- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e044dfa..ac92577 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +21.08.2007 Kommando v0.5.2: + -clicking with the middle mousebutton excutes commands + +16.11.2006 Kommando v0.5.1: + -added a "add menu from kmenu" feature (again a patch by Sergio) + 14.11.2006 Kommando v0.5.0: -added context sensitive menus -running as kded module (huge thanks to Sergio Cambra) diff --git a/src/configdialogimpl.h b/src/configdialogimpl.h index 9149f26..ce5c397 100644 --- a/src/configdialogimpl.h +++ b/src/configdialogimpl.h @@ -38,7 +38,7 @@ class KShortcut; /** * @short Application Main Window * @author Daniel Stöckel - * @version 0.5.0 + * @version 0.5.2 */ class ConfigDialogImpl : public ConfigDialog diff --git a/src/kcmkommando.cpp b/src/kcmkommando.cpp index 50fb4e4..e3ef742 100644 --- a/src/kcmkommando.cpp +++ b/src/kcmkommando.cpp @@ -33,7 +33,7 @@ static const char description[] = I18N_NOOP("A wheelmenu for KDE powerusers"); -static const char version[] = "0.5.0"; +static const char version[] = "0.5.2"; typedef KGenericFactory kommandoFactory; K_EXPORT_COMPONENT_FACTORY( kcm_kommando, kommandoFactory("kcmkommando")) diff --git a/src/kommando.cpp b/src/kommando.cpp index 6996d1b..e4abda2 100644 --- a/src/kommando.cpp +++ b/src/kommando.cpp @@ -279,4 +279,17 @@ void Kommando::selectButton( int num ) actMenu->selectButton(num); } +void Kommando::mousePressEvent(QMouseEvent* evt) +{ + middleMouseButtonState = (evt->button() == Qt::MidButton); +} + +void Kommando::mouseReleaseEvent(QMouseEvent* evt) +{ + if(middleMouseButtonState && (evt->button() == Qt::MidButton)){ + middleMouseButtonState = false; + slotNavClick(); + } +} + #include "kommando.moc" diff --git a/src/kommando.h b/src/kommando.h index 65f5849..8d3d629 100644 --- a/src/kommando.h +++ b/src/kommando.h @@ -65,6 +65,7 @@ class Kommando : public QWidget Menu* actMenu; QPtrList mTopLevelMenus; RoundButton navbutton; + bool middleMouseButtonState; int oldNavbuttonIconType; //holds whether the icon should be changed KPixmap mScreenshot; @@ -73,7 +74,8 @@ class Kommando : public QWidget virtual void windowActivationChange ( bool oldActive ); virtual void wheelEvent (QWheelEvent * evt); virtual void keyPressEvent(QKeyEvent* evt); - + virtual void mousePressEvent(QMouseEvent* evt); + virtual void mouseReleaseEvent(QMouseEvent* evt); protected slots: virtual void slotOnClick();