[aurorae] Use mousePressAndHoldInterval from StyleHints
parent
74b65fcd00
commit
e8a52bbe65
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue