Use the styles default delay for tooltips
This makes them less annoying when scrolling or accessing the popup menu. See also #860
This commit is contained in:
parent
750c64f323
commit
6f77a1fe9d
7 changed files with 32 additions and 1 deletions
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
#include "NhekoGlobalObject.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDesktopServices>
|
||||
#include <QStyle>
|
||||
#include <QUrl>
|
||||
#include <QWindow>
|
||||
|
||||
|
|
@ -75,6 +77,12 @@ Nheko::theme() const
|
|||
return Theme(UserSettings::instance()->theme());
|
||||
}
|
||||
|
||||
int
|
||||
Nheko::tooltipDelay() const
|
||||
{
|
||||
return QApplication::style()->styleHint(QStyle::StyleHint::SH_ToolTip_WakeUpDelay);
|
||||
}
|
||||
|
||||
void
|
||||
Nheko::openLink(QString link) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class Nheko : public QObject
|
|||
Q_PROPERTY(int paddingSmall READ paddingSmall CONSTANT)
|
||||
Q_PROPERTY(int paddingMedium READ paddingMedium CONSTANT)
|
||||
Q_PROPERTY(int paddingLarge READ paddingLarge CONSTANT)
|
||||
Q_PROPERTY(int tooltipDelay READ tooltipDelay CONSTANT)
|
||||
|
||||
Q_PROPERTY(UserProfile *currentUser READ currentUser NOTIFY profileChanged)
|
||||
|
||||
|
|
@ -39,6 +40,9 @@ public:
|
|||
int paddingSmall() const { return 4; }
|
||||
int paddingMedium() const { return 8; }
|
||||
int paddingLarge() const { return 20; }
|
||||
|
||||
int tooltipDelay() const;
|
||||
|
||||
UserProfile *currentUser() const;
|
||||
|
||||
Q_INVOKABLE QFont monospaceFont() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue