diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-07-12 09:54:50 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-18 08:18:46 +0200 |
commit | fc3207dfe1b615a856b6ad8eef22a8774e4a17f4 (patch) | |
tree | b4ad3d890ad8064cbdd2bceaf69274bcdcf360ad /src/gui/kernel/qplatformtheme.cpp | |
parent | 26318a8cb2115e0fddb119b203217a52dc8e98a2 (diff) |
Mirror potentially themeable style hints in QPlatformTheme.
Currently, most of the QStyleHint-values are potentially
configureable by the user in certain desktop environments.
Add them to the QPlatformTheme and query the theme first.
Keep the values in QPlatformIntegration such that simple
integrations that do not implement themes are not forced
to implement them to change the values.
Change-Id: I15742a5968df0ad5d7398cceae640dc7e541da52
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/gui/kernel/qplatformtheme.cpp')
-rw-r--r-- | src/gui/kernel/qplatformtheme.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index d1ca8b740f..14336ab42b 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -63,6 +63,30 @@ QT_BEGIN_NAMESPACE This enum describes the available theme hints. + \value CursorFlashTime (int) Cursor flash time in ms, overriding + QPlatformIntegration::styleHint. + + \value KeyboardInputInterval (int) Keyboard input interval in ms, overriding + QPlatformIntegration::styleHint. + + \value MouseDoubleClickInterval (int) Mouse double click interval in ms, + overriding QPlatformIntegration::styleHint. + + \value StartDragDistance (int) Start drag distance, + overriding QPlatformIntegration::styleHint. + + \value StartDragTime (int) Start drag time in ms,, + overriding QPlatformIntegration::styleHint. + + \value KeyboardAutoRepeatRate (int) Keyboard auto repeat rate, + overriding QPlatformIntegration::styleHint. + + \value PasswordMaskDelay (int) Pass word mask delay in ms,, + overriding QPlatformIntegration::styleHint. + + \value StartDragVelocity (int) Velocity of a drag, + overriding QPlatformIntegration::styleHint. + \value TextCursorWidth (int) Determines the width of the text cursor. \value DropShadow (bool) Determines whether the drop shadow effect for @@ -139,7 +163,28 @@ const QFont *QPlatformTheme::font(Font type) const QVariant QPlatformTheme::themeHint(ThemeHint hint) const { + return QPlatformTheme::defaultThemeHint(hint); +} + +QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) +{ switch (hint) { + case QPlatformTheme::CursorFlashTime: + return QVariant(1000); + case QPlatformTheme::KeyboardInputInterval: + return QVariant(400); + case QPlatformTheme::KeyboardAutoRepeatRate: + return QVariant(30); + case QPlatformTheme::MouseDoubleClickInterval: + return QVariant(400); + case QPlatformTheme::StartDragDistance: + return QVariant(10); + case QPlatformTheme::StartDragTime: + return QVariant(500); + case QPlatformTheme::PasswordMaskDelay: + return QVariant(int(0)); + case QPlatformTheme::StartDragVelocity: + return QVariant(int(0)); // no limit case QPlatformTheme::UseFullScreenForPopupMenu: return QVariant(false); case QPlatformTheme::WindowAutoPlacement: |