[aurorae] Use mousePressAndHoldInterval from StyleHints

icc-effect-5.14.5
Martin Gräßlin 2014-12-16 08:27:11 +01:00
parent 74b65fcd00
commit e8a52bbe65
3 changed files with 15 additions and 1 deletions

View File

@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KDecoration2/DecorationSettings> #include <KDecoration2/DecorationSettings>
#include <KConfigGroup> #include <KConfigGroup>
#include <KSharedConfig> #include <KSharedConfig>
#include <QGuiApplication>
#include <QStyleHints>
namespace KWin namespace KWin
{ {
@ -193,6 +195,11 @@ void DecorationOptions::slotActiveChanged()
emit fontChanged(); emit fontChanged();
} }
int DecorationOptions::mousePressAndHoldInterval() const
{
return QGuiApplication::styleHints()->mousePressAndHoldInterval();
}
Borders::Borders(QObject *parent) Borders::Borders(QObject *parent)
: QObject(parent) : QObject(parent)
, m_left(0) , m_left(0)

View File

@ -173,6 +173,7 @@ class DecorationOptions : public QObject
* The buttons to be positioned on the right side of the titlebar from left to right. * The buttons to be positioned on the right side of the titlebar from left to right.
**/ **/
Q_PROPERTY(QList<int> titleButtonsRight READ titleButtonsRight NOTIFY titleButtonsChanged) Q_PROPERTY(QList<int> titleButtonsRight READ titleButtonsRight NOTIFY titleButtonsChanged)
Q_PROPERTY(int mousePressAndHoldInterval READ mousePressAndHoldInterval CONSTANT)
public: public:
enum BorderSize { enum BorderSize {
BorderNone, ///< No borders except title BorderNone, ///< No borders except title
@ -228,6 +229,8 @@ public:
KDecoration2::Decoration *decoration() const; KDecoration2::Decoration *decoration() const;
void setDecoration(KDecoration2::Decoration *decoration); void setDecoration(KDecoration2::Decoration *decoration);
int mousePressAndHoldInterval() const;
Q_SIGNALS: Q_SIGNALS:
void colorsChanged(); void colorsChanged();
void fontChanged(); void fontChanged();

View File

@ -26,9 +26,13 @@ DecorationButton {
icon: decoration.client.icon icon: decoration.client.icon
anchors.fill: parent anchors.fill: parent
} }
DecorationOptions {
id: options
deco: decoration
}
Timer { Timer {
id: timer id: timer
interval: 150 interval: options.mousePressAndHoldInterval
repeat: false repeat: false
onTriggered: decoration.requestShowWindowMenu() onTriggered: decoration.requestShowWindowMenu()
} }