[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 <KConfigGroup>
#include <KSharedConfig>
#include <QGuiApplication>
#include <QStyleHints>
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)

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.
**/
Q_PROPERTY(QList<int> 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();

View File

@ -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()
}