From e8a52bbe65f83f629996fa67f3dc543608a00847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 16 Dec 2014 08:27:11 +0100 Subject: [PATCH] [aurorae] Use mousePressAndHoldInterval from StyleHints --- clients/aurorae/src/decorationoptions.cpp | 7 +++++++ clients/aurorae/src/decorationoptions.h | 3 +++ clients/aurorae/src/qml/MenuButton.qml | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/clients/aurorae/src/decorationoptions.cpp b/clients/aurorae/src/decorationoptions.cpp index 0dc5f1f301..f7b8de5b33 100644 --- a/clients/aurorae/src/decorationoptions.cpp +++ b/clients/aurorae/src/decorationoptions.cpp @@ -19,6 +19,8 @@ along with this program. If not, see . #include #include #include +#include +#include namespace KWin { @@ -193,6 +195,11 @@ void DecorationOptions::slotActiveChanged() emit fontChanged(); } +int DecorationOptions::mousePressAndHoldInterval() const +{ + return QGuiApplication::styleHints()->mousePressAndHoldInterval(); +} + Borders::Borders(QObject *parent) : QObject(parent) , m_left(0) diff --git a/clients/aurorae/src/decorationoptions.h b/clients/aurorae/src/decorationoptions.h index 5fc1f974a5..6606b39eb7 100644 --- a/clients/aurorae/src/decorationoptions.h +++ b/clients/aurorae/src/decorationoptions.h @@ -173,6 +173,7 @@ class DecorationOptions : public QObject * The buttons to be positioned on the right side of the titlebar from left to right. **/ Q_PROPERTY(QList titleButtonsRight READ titleButtonsRight NOTIFY titleButtonsChanged) + Q_PROPERTY(int mousePressAndHoldInterval READ mousePressAndHoldInterval CONSTANT) public: enum BorderSize { BorderNone, ///< No borders except title @@ -228,6 +229,8 @@ public: KDecoration2::Decoration *decoration() const; void setDecoration(KDecoration2::Decoration *decoration); + int mousePressAndHoldInterval() const; + Q_SIGNALS: void colorsChanged(); void fontChanged(); diff --git a/clients/aurorae/src/qml/MenuButton.qml b/clients/aurorae/src/qml/MenuButton.qml index bd56f50922..2e7254265b 100644 --- a/clients/aurorae/src/qml/MenuButton.qml +++ b/clients/aurorae/src/qml/MenuButton.qml @@ -26,9 +26,13 @@ DecorationButton { icon: decoration.client.icon anchors.fill: parent } + DecorationOptions { + id: options + deco: decoration + } Timer { id: timer - interval: 150 + interval: options.mousePressAndHoldInterval repeat: false onTriggered: decoration.requestShowWindowMenu() }