From a13dce3d471c77474ce4b0f6bae115a015139229 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 30 Dec 2016 12:09:02 +0100 Subject: Material: fix ComboBox drop indicator size on high-DPI qtdeclarative commit f8c53e88 (Fix high-DPI image and svg providers) changed the way high-DPI image providers work. For images using an image provider, we must now set the source size to get the desired device pixel ratio... The same was done for other indicators in qqc2 commit ca87ab8. Change-Id: I31f24786a6d3d3d06c3255864ed443cf8852a8de Task-number: QTBUG-57800 Reviewed-by: Mitch Curtis --- src/imports/controls/material/ComboBox.qml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 15987ebc..a0fdef66 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -74,6 +74,8 @@ T.ComboBox { x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding y: control.topPadding + (control.availableHeight - height) / 2 source: "image://material/drop-indicator/" + (control.enabled ? control.Material.foreground : control.Material.hintTextColor) + sourceSize.width: width + sourceSize.height: height } contentItem: Text { -- cgit v1.2.3 From fc083796ad8b02bf9d995ee22b6d60090e1e284d Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Fri, 30 Dec 2016 20:03:31 +0300 Subject: Implement QQuickDialogButtonBox::standardButton(StandardButton) Change-Id: I25935a069127a48c00dae951bc77665be6a429e1 Reviewed-by: J-P Nurmi --- src/quicktemplates2/qquickdialogbuttonbox.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickdialogbuttonbox.cpp b/src/quicktemplates2/qquickdialogbuttonbox.cpp index 10603d58..1e7a5fd7 100644 --- a/src/quicktemplates2/qquickdialogbuttonbox.cpp +++ b/src/quicktemplates2/qquickdialogbuttonbox.cpp @@ -500,7 +500,17 @@ void QQuickDialogButtonBox::setStandardButtons(QPlatformDialogHelper::StandardBu */ QQuickAbstractButton *QQuickDialogButtonBox::standardButton(QPlatformDialogHelper::StandardButton button) const { - Q_UNUSED(button); + Q_D(const QQuickDialogButtonBox); + if (Q_UNLIKELY(!(d->standardButtons & button))) + return nullptr; + for (int i = 0, n = count(); i < n; ++i) { + QQuickAbstractButton *btn = qobject_cast(d->itemAt(i)); + if (Q_LIKELY(btn)) { + QQuickDialogButtonBoxAttached *attached = qobject_cast(qmlAttachedPropertiesObject(btn, false)); + if (attached && QQuickDialogButtonBoxAttachedPrivate::get(attached)->standardButton == button) + return btn; + } + } return nullptr; } -- cgit v1.2.3 From 6f7852a307c7ebbdb3b6efa00cbf7626b072bbc1 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 6 Jan 2017 14:35:21 +0100 Subject: Switch(Delegate): fix handle snapping When Switch is released, nextCheckState() gets called to set the appropriate check state depending on the handle position. If the check state does not change, it must force a position update to avoid that the handle is left somewhere in the middle. Task-number: QTBUG-57944 Change-Id: I872160dafaa7dbf676b026fcc6ba0d0507a91a05 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickswitch.cpp | 8 ++++++-- src/quicktemplates2/qquickswitchdelegate.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickswitch.cpp b/src/quicktemplates2/qquickswitch.cpp index fa08a1d8..5e3d6418 100644 --- a/src/quicktemplates2/qquickswitch.cpp +++ b/src/quicktemplates2/qquickswitch.cpp @@ -186,10 +186,14 @@ void QQuickSwitch::mirrorChange() void QQuickSwitch::nextCheckState() { Q_D(QQuickSwitch); - if (keepMouseGrab()) + if (keepMouseGrab()) { setChecked(d->position > 0.5); - else + // the checked state might not change => force a position update to + // avoid that the handle is left somewhere in the middle (QTBUG-57944) + checkStateSet(); + } else { QQuickAbstractButton::nextCheckState(); + } } void QQuickSwitch::checkStateSet() diff --git a/src/quicktemplates2/qquickswitchdelegate.cpp b/src/quicktemplates2/qquickswitchdelegate.cpp index 81e282d9..e659b927 100644 --- a/src/quicktemplates2/qquickswitchdelegate.cpp +++ b/src/quicktemplates2/qquickswitchdelegate.cpp @@ -191,10 +191,14 @@ void QQuickSwitchDelegate::mirrorChange() void QQuickSwitchDelegate::nextCheckState() { Q_D(QQuickSwitchDelegate); - if (keepMouseGrab()) + if (keepMouseGrab()) { setChecked(d->position > 0.5); - else + // the checked state might not change => force a position update to + // avoid that the handle is left somewhere in the middle (QTBUG-57944) + checkStateSet(); + } else { QQuickItemDelegate::nextCheckState(); + } } void QQuickSwitchDelegate::checkStateSet() -- cgit v1.2.3