diff options
author | BogDan Vatra <bogdan@kde.org> | 2013-10-25 16:34:33 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-25 18:11:51 +0200 |
commit | 9b9c63c27d6f9945d0b662a4a931750d775e1955 (patch) | |
tree | 03ec9491a61a1e29ce05d4d65ab75f80de63df0b /src/widgets/styles/qandroidstyle.cpp | |
parent | 746f7a5b28d92d962ae261c52da4d750ea3b50f0 (diff) |
Android: Fix the QSlider handler position.
Change-Id: I300f187a94d6c2b6b385c5a129150344f6b805ea
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/widgets/styles/qandroidstyle.cpp')
-rw-r--r-- | src/widgets/styles/qandroidstyle.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/widgets/styles/qandroidstyle.cpp b/src/widgets/styles/qandroidstyle.cpp index afd6c3024c..9595e49f40 100644 --- a/src/widgets/styles/qandroidstyle.cpp +++ b/src/widgets/styles/qandroidstyle.cpp @@ -696,7 +696,10 @@ int QAndroidStyle::styleHint(QStyle::StyleHint hint, const QStyleOption *option, { switch (hint) { case SH_Slider_AbsoluteSetButtons: - return 1; + return Qt::LeftButton; + + case SH_Slider_PageSetButtons: + return 0; case SH_RequestSoftwareInputPanel: return RSIP_OnMouseClick; @@ -1776,9 +1779,9 @@ QRect QAndroidStyle::AndroidSeekBarControl::subControlRect(const QStyleOptionCom drawable = static_cast<const QAndroidStyle::AndroidStateDrawable *>(m_seekBarThumb)->bestAndroidStateMatch(option); QRect r(option->rect); - double factor = double(styleOption->sliderPosition/(styleOption->maximum-styleOption->minimum)); - int pos=(double(option->rect.width()*factor - drawable->size().width()) / 2); - r.setX(r.x()+pos); + double factor = double(styleOption->sliderPosition) / (styleOption->maximum - styleOption->minimum); + int pos = option->rect.width() * factor - double(drawable->size().width() / 2); + r.setX(r.x() + pos); r.setSize(drawable->size()); return r; } |