mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
mobileshell: Use pointer for haptics
This commit is contained in:
parent
7d3bf39750
commit
7aaa6f4cd2
2 changed files with 7 additions and 5 deletions
|
|
@ -19,7 +19,6 @@
|
|||
#include <QDBusPendingReply>
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
#include <QFeedbackHapticsEffect>
|
||||
#include <QFile>
|
||||
#include <QProcess>
|
||||
|
||||
|
|
@ -29,6 +28,7 @@ ShellUtil::ShellUtil(QObject *parent)
|
|||
: QObject{parent}
|
||||
, m_localeConfig{KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::SimpleConfig)}
|
||||
, m_launchingApp{nullptr}
|
||||
, m_hapticsEffect{std::make_unique<QFeedbackHapticsEffect>()}
|
||||
{
|
||||
m_localeConfigWatcher = KConfigWatcher::create(m_localeConfig);
|
||||
|
||||
|
|
@ -137,9 +137,8 @@ void ShellUtil::clearLaunchingApp()
|
|||
void ShellUtil::buttonVibrate()
|
||||
{
|
||||
if (MobileShellSettings::self()->vibrationsEnabled()) {
|
||||
QFeedbackHapticsEffect rumble;
|
||||
rumble.setDuration(MobileShellSettings::self()->vibrationDuration());
|
||||
rumble.setIntensity(MobileShellSettings::self()->vibrationIntensity());
|
||||
rumble.start();
|
||||
m_hapticsEffect->setDuration(MobileShellSettings::self()->vibrationDuration());
|
||||
m_hapticsEffect->setIntensity(MobileShellSettings::self()->vibrationIntensity());
|
||||
m_hapticsEffect->start();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QFeedbackHapticsEffect>
|
||||
#include <QObject>
|
||||
#include <QQuickItem>
|
||||
|
||||
|
|
@ -98,4 +99,6 @@ private:
|
|||
|
||||
KIO::ApplicationLauncherJob *m_launchingApp;
|
||||
QVector<qint64> m_launchingAppPids;
|
||||
|
||||
std::unique_ptr<QFeedbackHapticsEffect> m_hapticsEffect;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue