Add a humanMoment unit to the various Units

Time in milliseconds equivalent to the theoretical human moment, which can be used
to determine whether how long to wait until the user should be informed of something,
or can be used as the limit for how long something should wait before being
automatically initiated.

Some examples:

- When the user types text in a search field, wait no longer than this duration after
  the user completes typing before starting the search
- When loading data which would commonly arrive rapidly enough to not require interaction,
  wait this long before showing a spinner

This might seem an arbitrary number, but given the psychological effect that three
seconds seems to be what humans consider a moment (and in the case of waiting for
something to happen, a moment is that time when you think "this is taking a bit long,
isn't it?"), the idea is to postpone for just before such a conceptual moment. The reason
for the two seconds, rather than three, is to function as a middle ground: Not long enough
that the user would think that something has taken too long, for also not so fast as to
happen too soon.

See also
https://www.psychologytoday.com/blog/all-about-addiction/201101/tick-tock-tick-hugs-and-life-in-3-second-intervals
(the actual paper is hidden behind an academic paywall and consequently not readily
available to us, so the source will have to be the blog entry above)

see also https://invent.kde.org/frameworks/kirigami/-/merge_requests/268
This commit is contained in:
Dan Leinir Turthra Jensen 2021-03-31 14:18:49 +01:00
parent fb16e8eb20
commit 8a35f83c4b
4 changed files with 101 additions and 0 deletions

View File

@ -268,4 +268,9 @@ int Units::veryLongDuration() const
return m_longDuration * 2;
}
int Units::humanMoment() const
{
return 2000;
}
#include "moc_units.cpp"

View File

@ -131,6 +131,36 @@ class Units : public QObject
*/
Q_PROPERTY(int veryLongDuration READ veryLongDuration NOTIFY durationChanged)
/**
* Time in milliseconds equivalent to the theoretical human moment, which can be used
* to determine whether how long to wait until the user should be informed of something,
* or can be used as the limit for how long something should wait before being
* automatically initiated.
*
* Some examples:
*
* - When the user types text in a search field, wait no longer than this duration after
* the user completes typing before starting the search
* - When loading data which would commonly arrive rapidly enough to not require interaction,
* wait this long before showing a spinner
*
* This might seem an arbitrary number, but given the psychological effect that three
* seconds seems to be what humans consider a moment (and in the case of waiting for
* something to happen, a moment is that time when you think "this is taking a bit long,
* isn't it?"), the idea is to postpone for just before such a conceptual moment. The reason
* for the two seconds, rather than three, is to function as a middle ground: Not long enough
* that the user would think that something has taken too long, for also not so fast as to
* happen too soon.
*
* See also
* https://www.psychologytoday.com/blog/all-about-addiction/201101/tick-tock-tick-hugs-and-life-in-3-second-intervals
* (the actual paper is hidden behind an academic paywall and consequently not readily
* available to us, so the source will have to be the blog entry above)
*
* @since 5.81
*/
Q_PROPERTY(int humanMoment READ humanMoment CONSTANT)
public:
/// @cond INTERNAL_DOCS
@ -198,6 +228,12 @@ public:
* @since 5.78
*/
int veryShortDuration() const;
/**
* @return Duration for very long wait times
* @since 5.81
*/
int humanMoment() const;
/// @endcond
/**

View File

@ -117,6 +117,36 @@ QtObject {
*/
property int toolTipDelay: 700
/**
* Time in milliseconds equivalent to the theoretical human moment, which can be used
* to determine whether how long to wait until the user should be informed of something,
* or can be used as the limit for how long something should wait before being
* automatically initiated.
*
* Some examples:
*
* - When the user types text in a search field, wait no longer than this duration after
* the user completes typing before starting the search
* - When loading data which would commonly arrive rapidly enough to not require interaction,
* wait this long before showing a spinner
*
* This might seem an arbitrary number, but given the psychological effect that three
* seconds seems to be what humans consider a moment (and in the case of waiting for
* something to happen, a moment is that time when you think "this is taking a bit long,
* isn't it?"), the idea is to postpone for just before such a conceptual moment. The reason
* for the two seconds, rather than three, is to function as a middle ground: Not long enough
* that the user would think that something has taken too long, for also not so fast as to
* happen too soon.
*
* See also
* https://www.psychologytoday.com/blog/all-about-addiction/201101/tick-tock-tick-hugs-and-life-in-3-second-intervals
* (the actual paper is hidden behind an academic paywall and consequently not readily
* available to us, so the source will have to be the blog entry above)
*
* @since 5.81
*/
property int humanMoment: 2000
/**
* metrics used by the default font
*/

View File

@ -110,6 +110,36 @@ QtObject {
*/
property int toolTipDelay: Settings.tabletMode ? Qt.styleHints.mousePressAndHoldInterval : 700
/**
* Time in milliseconds equivalent to the theoretical human moment, which can be used
* to determine whether how long to wait until the user should be informed of something,
* or can be used as the limit for how long something should wait before being
* automatically initiated.
*
* Some examples:
*
* - When the user types text in a search field, wait no longer than this duration after
* the user completes typing before starting the search
* - When loading data which would commonly arrive rapidly enough to not require interaction,
* wait this long before showing a spinner
*
* This might seem an arbitrary number, but given the psychological effect that three
* seconds seems to be what humans consider a moment (and in the case of waiting for
* something to happen, a moment is that time when you think "this is taking a bit long,
* isn't it?"), the idea is to postpone for just before such a conceptual moment. The reason
* for the two seconds, rather than three, is to function as a middle ground: Not long enough
* that the user would think that something has taken too long, for also not so fast as to
* happen too soon.
*
* See also
* https://www.psychologytoday.com/blog/all-about-addiction/201101/tick-tock-tick-hugs-and-life-in-3-second-intervals
* (the actual paper is hidden behind an academic paywall and consequently not readily
* available to us, so the source will have to be the blog entry above)
*
* @since 5.81
*/
property int humanMoment: 2000
/**
* metrics used by the default font
*/