From 2799b41d6b6c3ae28acc2c1daad029d9817fc6ad Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 6 Jun 2014 12:30:33 +0200 Subject: Menu: Don't open disabled submenus Task-number: QTBUG-39384 Change-Id: I5310c6efb0a7045f6f89c6347551a0043d8e0ca6 Reviewed-by: J-P Nurmi --- src/controls/MenuBar.qml | 20 ++++++++++++++++---- src/controls/Private/MenuContentItem.qml | 4 +++- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'src/controls') diff --git a/src/controls/MenuBar.qml b/src/controls/MenuBar.qml index 0fe56ef1..4d577930 100644 --- a/src/controls/MenuBar.qml +++ b/src/controls/MenuBar.qml @@ -174,8 +174,13 @@ MenuBarPrivate { Keys.onLeftPressed: { if (d.openedMenuIndex > 0) { - d.preselectMenuItem = true - d.openedMenuIndex-- + var idx = d.openedMenuIndex - 1 + while (idx >= 0 && !root.menus[idx].enabled) + idx-- + if (idx >= 0) { + d.preselectMenuItem = true + d.openedMenuIndex = idx + } } else { event.accepted = false; } @@ -183,8 +188,13 @@ MenuBarPrivate { Keys.onRightPressed: { if (d.openedMenuIndex !== -1 && d.openedMenuIndex < root.menus.length - 1) { - d.preselectMenuItem = true - d.openedMenuIndex++ + var idx = d.openedMenuIndex + 1 + while (idx < root.menus.length && !root.menus[idx].enabled) + idx++ + if (idx < root.menus.length) { + d.preselectMenuItem = true + d.openedMenuIndex = idx + } } else { event.accepted = false; } @@ -223,6 +233,8 @@ MenuBarPrivate { Connections { target: d onOpenedMenuIndexChanged: { + if (!__menuItem.enabled) + return; if (d.openedMenuIndex === index) { if (__menuItem.__usingDefaultStyle) __menuItem.style = d.style.menuStyle diff --git a/src/controls/Private/MenuContentItem.qml b/src/controls/Private/MenuContentItem.qml index dbbf26a9..669cde2f 100644 --- a/src/controls/Private/MenuContentItem.qml +++ b/src/controls/Private/MenuContentItem.qml @@ -165,7 +165,7 @@ Loader { itemsModel: __menu.items minWidth: __menu.__minimumWidth maxHeight: d.style ? d.style.__maxPopupHeight : 0 - onTriggered: d.triggerAndDismiss(item) + onTriggered: if (item.__menuItem.enabled) d.triggerAndDismiss(item) } Component { @@ -199,6 +199,8 @@ Loader { active: visible function __showSubMenu(immediately) { + if (!__menuItem.enabled) + return; if (immediately) { if (__menu.__currentIndex === __menuItemIndex) { if (__menuItem.__usingDefaultStyle) -- cgit v1.2.1 From a99380b155bf679e240e4d01b70691feebad0d4c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 18 Jun 2014 20:38:18 +0200 Subject: Remove unused BasicButton::__textColor Gets rid of an extra SystemPalette instance that installs an event filter on the application object. Change-Id: Ib7e1fd5634084a2b949bb5b7146fabe89f05be38 Reviewed-by: Gabriel de Dietrich Reviewed-by: Caroline Chao --- src/controls/Private/BasicButton.qml | 4 ---- src/controls/plugins.qmltypes | 2 -- 2 files changed, 6 deletions(-) (limited to 'src/controls') diff --git a/src/controls/Private/BasicButton.qml b/src/controls/Private/BasicButton.qml index 849315e9..f482ad72 100644 --- a/src/controls/Private/BasicButton.qml +++ b/src/controls/Private/BasicButton.qml @@ -125,8 +125,6 @@ Control { */ property string iconName: action ? action.iconName : "" - /*! \internal */ - property color __textColor: syspal.text /*! \internal */ property string __position: "only" /*! \internal */ @@ -218,8 +216,6 @@ Control { /*! \internal */ property bool __effectivePressed: behavior.effectivePressed - SystemPalette { id: syspal } - states: [ State { name: "boundAction" diff --git a/src/controls/plugins.qmltypes b/src/controls/plugins.qmltypes index a9d6e527..d1a56b89 100644 --- a/src/controls/plugins.qmltypes +++ b/src/controls/plugins.qmltypes @@ -1201,7 +1201,6 @@ Module { Property { name: "tooltip"; type: "string" } Property { name: "iconSource"; type: "QUrl" } Property { name: "iconName"; type: "string" } - Property { name: "__textColor"; type: "QColor" } Property { name: "__position"; type: "string" } Property { name: "__iconOverriden"; type: "bool"; isReadonly: true } Property { name: "__action"; type: "QQuickAction"; isPointer: true } @@ -2182,7 +2181,6 @@ Module { Property { name: "tooltip"; type: "string" } Property { name: "iconSource"; type: "QUrl" } Property { name: "iconName"; type: "string" } - Property { name: "__textColor"; type: "QColor" } Property { name: "__position"; type: "string" } Property { name: "__iconOverriden"; type: "bool"; isReadonly: true } Property { name: "__action"; type: "QQuickAction"; isPointer: true } -- cgit v1.2.1 From 9578edd239f4f1e33d2bf5c044b1bf80ab2c595d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 18 Jun 2014 20:49:33 +0200 Subject: Kill unnecessary SystemPalette instances Each SystemPalette instance installs an event filter on the application object, so we should try to avoid these as much as possible. Style already creates an instance that switches between Active and Disabled states based on control's enabled state and is suitable for most use cases. Change-Id: Icdbc793f639a3217ece6b2ded281e2a8beacb742 Reviewed-by: Gabriel de Dietrich Reviewed-by: Caroline Chao --- src/controls/Styles/Base/ButtonStyle.qml | 6 ------ src/controls/Styles/Base/CheckBoxStyle.qml | 5 ----- src/controls/Styles/Base/ComboBoxStyle.qml | 6 +----- src/controls/Styles/Base/GroupBoxStyle.qml | 5 ----- src/controls/Styles/Base/MenuBarStyle.qml | 4 +--- src/controls/Styles/Base/ProgressBarStyle.qml | 5 ----- src/controls/Styles/Base/RadioButtonStyle.qml | 5 ----- src/controls/Styles/Base/ScrollViewStyle.qml | 5 ----- src/controls/Styles/Base/SliderStyle.qml | 5 ----- src/controls/Styles/Base/SpinBoxStyle.qml | 6 ------ src/controls/Styles/Base/TextFieldStyle.qml | 5 ----- src/controls/Styles/Desktop/SpinBoxStyle.qml | 5 ----- src/controls/Styles/Desktop/TableViewStyle.qml | 4 ---- src/controls/Styles/Desktop/TextFieldStyle.qml | 13 +++---------- 14 files changed, 5 insertions(+), 74 deletions(-) (limited to 'src/controls') diff --git a/src/controls/Styles/Base/ButtonStyle.qml b/src/controls/Styles/Base/ButtonStyle.qml index d0299a55..98336964 100644 --- a/src/controls/Styles/Base/ButtonStyle.qml +++ b/src/controls/Styles/Base/ButtonStyle.qml @@ -79,12 +79,6 @@ Style { /*! The \l {QtQuick.Controls::}{Button} attached to this style. */ readonly property Button control: __control - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } - /*! The padding between the background and the label components. */ padding { top: 4 diff --git a/src/controls/Styles/Base/CheckBoxStyle.qml b/src/controls/Styles/Base/CheckBoxStyle.qml index 2dcaa9e9..36eeb78f 100644 --- a/src/controls/Styles/Base/CheckBoxStyle.qml +++ b/src/controls/Styles/Base/CheckBoxStyle.qml @@ -78,11 +78,6 @@ Style { /*! The \l CheckBox attached to this style. */ readonly property CheckBox control: __control - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } /*! This defines the text label. */ property Component label: Item { diff --git a/src/controls/Styles/Base/ComboBoxStyle.qml b/src/controls/Styles/Base/ComboBoxStyle.qml index eed7e7f4..6bf8a391 100644 --- a/src/controls/Styles/Base/ComboBoxStyle.qml +++ b/src/controls/Styles/Base/ComboBoxStyle.qml @@ -69,11 +69,7 @@ Style { \sa Text::renderType */ property int renderType: Text.NativeRendering - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } + /*! The \l ComboBox attached to this style. */ readonly property ComboBox control: __control diff --git a/src/controls/Styles/Base/GroupBoxStyle.qml b/src/controls/Styles/Base/GroupBoxStyle.qml index af8d41b6..e001fb26 100644 --- a/src/controls/Styles/Base/GroupBoxStyle.qml +++ b/src/controls/Styles/Base/GroupBoxStyle.qml @@ -50,11 +50,6 @@ import QtQuick.Controls.Private 1.0 */ Style { - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } /*! The \l GroupBox attached to this style. */ readonly property GroupBox control: __control diff --git a/src/controls/Styles/Base/MenuBarStyle.qml b/src/controls/Styles/Base/MenuBarStyle.qml index 8ab758f5..5c566b3a 100644 --- a/src/controls/Styles/Base/MenuBarStyle.qml +++ b/src/controls/Styles/Base/MenuBarStyle.qml @@ -100,14 +100,12 @@ Style { implicitHeight: text.height + 4 color: styleData.open ? "#49d" : "transparent" - SystemPalette { id: syspal } - Text { id: text text: formatMnemonic(styleData.text, styleData.underlineMnemonic) anchors.centerIn: parent renderType: Text.NativeRendering - color: styleData.open ? "white" : syspal.windowText + color: styleData.open ? "white" : __syspal.windowText } } diff --git a/src/controls/Styles/Base/ProgressBarStyle.qml b/src/controls/Styles/Base/ProgressBarStyle.qml index 0a98beef..ec379884 100644 --- a/src/controls/Styles/Base/ProgressBarStyle.qml +++ b/src/controls/Styles/Base/ProgressBarStyle.qml @@ -111,11 +111,6 @@ import QtQuick.Controls.Private 1.0 Style { id: progressBarStyle - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } /*! The \l ProgressBar attached to this style. */ readonly property ProgressBar control: __control diff --git a/src/controls/Styles/Base/RadioButtonStyle.qml b/src/controls/Styles/Base/RadioButtonStyle.qml index 0f242eb0..bedd3dca 100644 --- a/src/controls/Styles/Base/RadioButtonStyle.qml +++ b/src/controls/Styles/Base/RadioButtonStyle.qml @@ -75,11 +75,6 @@ import QtQuick.Controls.Private 1.0 Style { id: radiobuttonStyle - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } /*! The \l RadioButton attached to this style. */ readonly property RadioButton control: __control diff --git a/src/controls/Styles/Base/ScrollViewStyle.qml b/src/controls/Styles/Base/ScrollViewStyle.qml index d072f82e..8c17e35a 100644 --- a/src/controls/Styles/Base/ScrollViewStyle.qml +++ b/src/controls/Styles/Base/ScrollViewStyle.qml @@ -51,11 +51,6 @@ import QtQuick.Controls.Private 1.0 Style { id: root - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } /*! The \l ScrollView attached to this style. */ readonly property ScrollView control: __control diff --git a/src/controls/Styles/Base/SliderStyle.qml b/src/controls/Styles/Base/SliderStyle.qml index d5109089..1e2750fb 100644 --- a/src/controls/Styles/Base/SliderStyle.qml +++ b/src/controls/Styles/Base/SliderStyle.qml @@ -82,11 +82,6 @@ import QtQuick.Controls.Private 1.0 Style { id: styleitem - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } /*! The \l Slider attached to this style. */ readonly property Slider control: __control diff --git a/src/controls/Styles/Base/SpinBoxStyle.qml b/src/controls/Styles/Base/SpinBoxStyle.qml index caa20abd..c9df4471 100644 --- a/src/controls/Styles/Base/SpinBoxStyle.qml +++ b/src/controls/Styles/Base/SpinBoxStyle.qml @@ -69,12 +69,6 @@ Style { /*! The \l SpinBox attached to this style. */ readonly property SpinBox control: __control - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } - /*! The content margins of the text field. */ padding { top: 1 ; left: Math.round(styleData.contentHeight/2) ; right: Math.max(22, Math.round(styleData.contentHeight)) ; bottom: 0 } /*! \qmlproperty enumeration horizontalAlignment diff --git a/src/controls/Styles/Base/TextFieldStyle.qml b/src/controls/Styles/Base/TextFieldStyle.qml index d999551c..a0bed38d 100644 --- a/src/controls/Styles/Base/TextFieldStyle.qml +++ b/src/controls/Styles/Base/TextFieldStyle.qml @@ -68,11 +68,6 @@ import QtQuick.Controls.Private 1.0 Style { id: style - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } /*! The \l TextField attached to this style. */ readonly property TextField control: __control diff --git a/src/controls/Styles/Desktop/SpinBoxStyle.qml b/src/controls/Styles/Desktop/SpinBoxStyle.qml index ba897bfb..7896c234 100644 --- a/src/controls/Styles/Desktop/SpinBoxStyle.qml +++ b/src/controls/Styles/Desktop/SpinBoxStyle.qml @@ -44,11 +44,6 @@ import QtQuick.Controls.Private 1.0 Style { readonly property SpinBox control: __control - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } - padding { top: control.__panel ? control.__panel.topPadding + (styleitem.style === "mac" ? 2 : 0) : 0 left: control.__panel ? control.__panel.leftPadding : 0 diff --git a/src/controls/Styles/Desktop/TableViewStyle.qml b/src/controls/Styles/Desktop/TableViewStyle.qml index 5ad1f394..60589e5e 100644 --- a/src/controls/Styles/Desktop/TableViewStyle.qml +++ b/src/controls/Styles/Desktop/TableViewStyle.qml @@ -45,10 +45,6 @@ import "." ScrollViewStyle { id: root - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } readonly property TableView control: __control property bool activateItemOnSingleClick: __styleitem.styleHint("activateItemOnSingleClick") property color textColor: __styleitem.textColor diff --git a/src/controls/Styles/Desktop/TextFieldStyle.qml b/src/controls/Styles/Desktop/TextFieldStyle.qml index c7e85ff4..5c623b80 100644 --- a/src/controls/Styles/Desktop/TextFieldStyle.qml +++ b/src/controls/Styles/Desktop/TextFieldStyle.qml @@ -54,17 +54,10 @@ Style { hover: hovered hints: control.styleHints - SystemPalette { - id: syspal - colorGroup: control.enabled ? - SystemPalette.Active : - SystemPalette.Disabled - } - - property color textColor: syspal.text + property color textColor: __syspal.text property color placeholderTextColor: "darkGray" - property color selectionColor: syspal.highlight - property color selectedTextColor: syspal.highlightedText + property color selectionColor: __syspal.highlight + property color selectedTextColor: __syspal.highlightedText property bool rounded: !!hints["rounded"] -- cgit v1.2.1 From 266fab2a8920dc79e52555b81cf1708233c1b60f Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 18 Jun 2014 21:28:33 +0200 Subject: Singleton SystemPalette Each SystemPalette instance installs an event filter on the application object. Avoid this by sharing a single SystemPalette instance. Change-Id: Ica9f8979b33e511c1238add3d689f380d0daa93c Reviewed-by: Gabriel de Dietrich Reviewed-by: Caroline Chao --- src/controls/ApplicationWindow.qml | 4 +- src/controls/ComboBox.qml | 6 +-- src/controls/Private/Style.qml | 6 --- src/controls/Private/SystemPaletteSingleton.qml | 63 ++++++++++++++++++++++++ src/controls/Private/private.pri | 1 + src/controls/Private/qmldir | 1 + src/controls/Styles/Base/ButtonStyle.qml | 2 +- src/controls/Styles/Base/CalendarStyle.qml | 2 +- src/controls/Styles/Base/CheckBoxStyle.qml | 2 +- src/controls/Styles/Base/ComboBoxStyle.qml | 2 +- src/controls/Styles/Base/GroupBoxStyle.qml | 2 +- src/controls/Styles/Base/MenuBarStyle.qml | 2 +- src/controls/Styles/Base/RadioButtonStyle.qml | 2 +- src/controls/Styles/Base/SpinBoxStyle.qml | 6 +-- src/controls/Styles/Base/SwitchStyle.qml | 11 +++-- src/controls/Styles/Base/TabViewStyle.qml | 6 +-- src/controls/Styles/Base/TableViewStyle.qml | 4 +- src/controls/Styles/Base/TextAreaStyle.qml | 8 +-- src/controls/Styles/Base/TextFieldStyle.qml | 6 +-- src/controls/Styles/Desktop/CheckBoxStyle.qml | 2 +- src/controls/Styles/Desktop/MenuStyle.qml | 2 +- src/controls/Styles/Desktop/RadioButtonStyle.qml | 2 +- src/controls/Styles/Desktop/SpinBoxStyle.qml | 8 +-- src/controls/Styles/Desktop/TableViewStyle.qml | 2 +- src/controls/Styles/Desktop/TextAreaStyle.qml | 8 +-- src/controls/Styles/Desktop/TextFieldStyle.qml | 6 +-- 26 files changed, 111 insertions(+), 55 deletions(-) create mode 100644 src/controls/Private/SystemPaletteSingleton.qml (limited to 'src/controls') diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml index fa9225be..240965c4 100644 --- a/src/controls/ApplicationWindow.qml +++ b/src/controls/ApplicationWindow.qml @@ -182,7 +182,7 @@ Window { /*! \internal */ default property alias data: contentArea.data - color: syspal.window + color: SystemPaletteSingleton.window(true) flags: Qt.Window | Qt.WindowFullscreenButtonHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | @@ -190,8 +190,6 @@ Window { // QTBUG-35049: Windows is removing features we didn't ask for, even though Qt::CustomizeWindowHint is not set // Otherwise Qt.Window | Qt.WindowFullscreenButtonHint would be enough - SystemPalette {id: syspal} - Item { id: backgroundItem anchors.fill: parent diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index 07d98876..9cb2a9f4 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -360,9 +360,9 @@ Control { renderType: __style ? __style.renderType : Text.NativeRendering selectByMouse: true - color: __style.__syspal.text - selectionColor: __style.__syspal.highlight - selectedTextColor: __style.__syspal.highlightedText + color: SystemPaletteSingleton.text(enabled) + selectionColor: SystemPaletteSingleton.highlight(enabled) + selectedTextColor: SystemPaletteSingleton.highlightedText(enabled) onAccepted: { var idx = input.find(editText, Qt.MatchFixedString) if (idx > -1) { diff --git a/src/controls/Private/Style.qml b/src/controls/Private/Style.qml index e99db169..53497517 100644 --- a/src/controls/Private/Style.qml +++ b/src/controls/Private/Style.qml @@ -50,10 +50,4 @@ import QtQuick.Controls.Private 1.0 AbstractStyle { /*! The control attached to this style */ readonly property Item control: __control - - /*! \internal */ - property var __syspal: SystemPalette { - colorGroup: control.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } } diff --git a/src/controls/Private/SystemPaletteSingleton.qml b/src/controls/Private/SystemPaletteSingleton.qml new file mode 100644 index 00000000..9354af03 --- /dev/null +++ b/src/controls/Private/SystemPaletteSingleton.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Quick Controls module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +pragma Singleton +import QtQuick 2.2 + +QtObject { + property SystemPalette active: SystemPalette { colorGroup: SystemPalette.Active } + property SystemPalette disabled: SystemPalette { colorGroup: SystemPalette.Disabled } + + function alternateBase(enabled) { return enabled ? active.alternateBase : disabled.alternateBase } + function base(enabled) { return enabled ? active.base : disabled.base } + function button(enabled) { return enabled ? active.button : disabled.button } + function buttonText(enabled) { return enabled ? active.buttonText : disabled.buttonText } + function dark(enabled) { return enabled ? active.dark : disabled.dark } + function highlight(enabled) { return enabled ? active.highlight : disabled.highlight } + function highlightedText(enabled) { return enabled ? active.highlightedText : disabled.highlightedText } + function light(enabled) { return enabled ? active.light : disabled.light } + function mid(enabled) { return enabled ? active.mid : disabled.mid } + function midlight(enabled) { return enabled ? active.midlight : disabled.midlight } + function shadow(enabled) { return enabled ? active.shadow : disabled.shadow } + function text(enabled) { return enabled ? active.text : disabled.text } + function window(enabled) { return enabled ? active.window : disabled.window } + function windowText(enabled) { return enabled ? active.windowText : disabled.windowText } +} diff --git a/src/controls/Private/private.pri b/src/controls/Private/private.pri index f9446854..b530a229 100644 --- a/src/controls/Private/private.pri +++ b/src/controls/Private/private.pri @@ -46,6 +46,7 @@ PRIVATE_QML_FILES += \ $$PWD/StackView.js \ $$PWD/ScrollViewHelper.qml \ $$PWD/ScrollBar.qml \ + $$PWD/SystemPaletteSingleton.qml \ $$PWD/TableViewSelection.qml \ $$PWD/TextSingleton.qml \ $$PWD/FocusFrame.qml \ diff --git a/src/controls/Private/qmldir b/src/controls/Private/qmldir index d31483e3..f2c572f2 100644 --- a/src/controls/Private/qmldir +++ b/src/controls/Private/qmldir @@ -24,4 +24,5 @@ MenuContentScroller 1.0 MenuContentScroller.qml ColumnMenuContent 1.0 ColumnMenuContent.qml ContentItem 1.0 ContentItem.qml HoverButton 1.0 HoverButton.qml +singleton SystemPaletteSingleton 1.0 SystemPaletteSingleton.qml singleton TextSingleton 1.0 TextSingleton.qml diff --git a/src/controls/Styles/Base/ButtonStyle.qml b/src/controls/Styles/Base/ButtonStyle.qml index 98336964..566f93e5 100644 --- a/src/controls/Styles/Base/ButtonStyle.qml +++ b/src/controls/Styles/Base/ButtonStyle.qml @@ -144,7 +144,7 @@ Style { renderType: Text.NativeRendering anchors.verticalCenter: parent.verticalCenter text: control.text - color: __syspal.buttonText + color: SystemPaletteSingleton.buttonText(control.enabled) } } } diff --git a/src/controls/Styles/Base/CalendarStyle.qml b/src/controls/Styles/Base/CalendarStyle.qml index db007812..56978ded 100644 --- a/src/controls/Styles/Base/CalendarStyle.qml +++ b/src/controls/Styles/Base/CalendarStyle.qml @@ -266,7 +266,7 @@ Style { readonly property bool addExtraMargin: control.frameVisible && styleData.selected readonly property color sameMonthDateTextColor: "#444" - readonly property color selectedDateColor: Qt.platform.os === "osx" ? "#3778d0" : __syspal.highlight + readonly property color selectedDateColor: Qt.platform.os === "osx" ? "#3778d0" : SystemPaletteSingleton.highlight(control.enabled) readonly property color selectedDateTextColor: "white" readonly property color differentMonthDateTextColor: "#bbb" readonly property color invalidDateColor: "#dddddd" diff --git a/src/controls/Styles/Base/CheckBoxStyle.qml b/src/controls/Styles/Base/CheckBoxStyle.qml index 36eeb78f..c8592b76 100644 --- a/src/controls/Styles/Base/CheckBoxStyle.qml +++ b/src/controls/Styles/Base/CheckBoxStyle.qml @@ -100,7 +100,7 @@ Style { id: text text: control.text anchors.centerIn: parent - color: __syspal.text + color: SystemPaletteSingleton.text(control.enabled) renderType: Text.NativeRendering } } diff --git a/src/controls/Styles/Base/ComboBoxStyle.qml b/src/controls/Styles/Base/ComboBoxStyle.qml index 6bf8a391..de78dc02 100644 --- a/src/controls/Styles/Base/ComboBoxStyle.qml +++ b/src/controls/Styles/Base/ComboBoxStyle.qml @@ -168,7 +168,7 @@ Style { anchors.verticalCenter: parent.verticalCenter text: control.currentText renderType: cbStyle.renderType - color: __syspal.text + color: SystemPaletteSingleton.text(control.enabled) elide: Text.ElideRight } } diff --git a/src/controls/Styles/Base/GroupBoxStyle.qml b/src/controls/Styles/Base/GroupBoxStyle.qml index e001fb26..545ca07b 100644 --- a/src/controls/Styles/Base/GroupBoxStyle.qml +++ b/src/controls/Styles/Base/GroupBoxStyle.qml @@ -62,7 +62,7 @@ Style { } /*! The title text color. */ - property color textColor: __syspal.text + property color textColor: SystemPaletteSingleton.text(control.enabled) /*! The check box. */ property Component checkbox: Item { diff --git a/src/controls/Styles/Base/MenuBarStyle.qml b/src/controls/Styles/Base/MenuBarStyle.qml index 5c566b3a..cff2b095 100644 --- a/src/controls/Styles/Base/MenuBarStyle.qml +++ b/src/controls/Styles/Base/MenuBarStyle.qml @@ -105,7 +105,7 @@ Style { text: formatMnemonic(styleData.text, styleData.underlineMnemonic) anchors.centerIn: parent renderType: Text.NativeRendering - color: styleData.open ? "white" : __syspal.windowText + color: styleData.open ? "white" : SystemPaletteSingleton.windowText(control.enabled) } } diff --git a/src/controls/Styles/Base/RadioButtonStyle.qml b/src/controls/Styles/Base/RadioButtonStyle.qml index bedd3dca..86b7c816 100644 --- a/src/controls/Styles/Base/RadioButtonStyle.qml +++ b/src/controls/Styles/Base/RadioButtonStyle.qml @@ -99,7 +99,7 @@ Style { id: text text: control.text anchors.centerIn: parent - color: __syspal.text + color: SystemPaletteSingleton.text(control.enabled) renderType: Text.NativeRendering } } diff --git a/src/controls/Styles/Base/SpinBoxStyle.qml b/src/controls/Styles/Base/SpinBoxStyle.qml index c9df4471..ffd30a58 100644 --- a/src/controls/Styles/Base/SpinBoxStyle.qml +++ b/src/controls/Styles/Base/SpinBoxStyle.qml @@ -87,13 +87,13 @@ Style { property int horizontalAlignment: Qt.AlignRight /*! The text color. */ - property color textColor: __syspal.text + property color textColor: SystemPaletteSingleton.text(control.enabled) /*! The text highlight color, used behind selections. */ - property color selectionColor: __syspal.highlight + property color selectionColor: SystemPaletteSingleton.highlight(control.enabled) /*! The highlighted text color, used in selections. */ - property color selectedTextColor: __syspal.highlightedText + property color selectedTextColor: SystemPaletteSingleton.highlightedText(control.enabled) /*! \qmlproperty enumeration renderType diff --git a/src/controls/Styles/Base/SwitchStyle.qml b/src/controls/Styles/Base/SwitchStyle.qml index 01779582..d5c5cf07 100644 --- a/src/controls/Styles/Base/SwitchStyle.qml +++ b/src/controls/Styles/Base/SwitchStyle.qml @@ -80,8 +80,10 @@ Style { implicitWidth: Math.round((parent.parent.width - padding.left - padding.right)/2) implicitHeight: control.height - padding.top - padding.bottom - border.color: control.activeFocus ? Qt.darker(__syspal.highlight, 2) : Qt.darker(__syspal.button, 2) - property color bg: control.activeFocus ? Qt.darker(__syspal.highlight, 1.2) : __syspal.button + border.color: control.activeFocus ? Qt.darker(highlight, 2) : Qt.darker(button, 2) + property color bg: control.activeFocus ? Qt.darker(highlight, 1.2) : button + property color highlight: SystemPaletteSingleton.highlight(control.enabled) + property color button: SystemPaletteSingleton.button(control.enabled) gradient: Gradient { GradientStop {color: Qt.lighter(bg, 1.4) ; position: 0} GradientStop {color: bg ; position: 1} @@ -92,8 +94,9 @@ Style { /*! This property holds the background groove of the switch. */ property Component groove: Rectangle { - property color shadow: control.checked ? Qt.darker(__syspal.highlight, 1.2): "#999" - property color bg: control.checked ? __syspal.highlight:"#bbb" + property color shadow: control.checked ? Qt.darker(highlight, 1.2): "#999" + property color bg: control.checked ? highlight:"#bbb" + property color highlight: SystemPaletteSingleton.highlight(control.enabled) implicitWidth: Math.round(implicitHeight * 3) implicitHeight: Math.max(16, Math.round(TextSingleton.implicitHeight)) diff --git a/src/controls/Styles/Base/TabViewStyle.qml b/src/controls/Styles/Base/TabViewStyle.qml index 42fabfe4..ad1d3856 100644 --- a/src/controls/Styles/Base/TabViewStyle.qml +++ b/src/controls/Styles/Base/TabViewStyle.qml @@ -168,11 +168,7 @@ Style { elide: Text.ElideMiddle renderType: Text.NativeRendering scale: control.tabPosition === Qt.TopEdge ? 1 : -1 - property var __syspal: SystemPalette { - colorGroup: styleData.enabled ? - SystemPalette.Active : SystemPalette.Disabled - } - color: __syspal.text + color: SystemPaletteSingleton.text(styleData.enabled) Rectangle { anchors.centerIn: parent width: textitem.paintedWidth + 6 diff --git a/src/controls/Styles/Base/TableViewStyle.qml b/src/controls/Styles/Base/TableViewStyle.qml index 5dca6631..b59a38ca 100644 --- a/src/controls/Styles/Base/TableViewStyle.qml +++ b/src/controls/Styles/Base/TableViewStyle.qml @@ -58,10 +58,10 @@ ScrollViewStyle { readonly property TableView control: __control /*! The text color. */ - property color textColor: __syspal.text + property color textColor: SystemPaletteSingleton.text(control.enabled) /*! The background color. */ - property color backgroundColor: control.backgroundVisible ? __syspal.base : "transparent" + property color backgroundColor: control.backgroundVisible ? SystemPaletteSingleton.base(control.enabled) : "transparent" /*! The alternate background color. */ property color alternateBackgroundColor: "#f5f5f5" diff --git a/src/controls/Styles/Base/TextAreaStyle.qml b/src/controls/Styles/Base/TextAreaStyle.qml index 7ad5686f..774f5cc6 100644 --- a/src/controls/Styles/Base/TextAreaStyle.qml +++ b/src/controls/Styles/Base/TextAreaStyle.qml @@ -71,16 +71,16 @@ ScrollViewStyle { property font font /*! The text color. */ - property color textColor: __syspal.text + property color textColor: SystemPaletteSingleton.text(control.enabled) /*! The text highlight color, used behind selections. */ - property color selectionColor: __syspal.highlight + property color selectionColor: SystemPaletteSingleton.highlight(control.enabled) /*! The highlighted text color, used in selections. */ - property color selectedTextColor: __syspal.highlightedText + property color selectedTextColor: SystemPaletteSingleton.highlightedText(control.enabled) /*! The background color. */ - property color backgroundColor: control.backgroundVisible ? __syspal.base : "transparent" + property color backgroundColor: control.backgroundVisible ? SystemPaletteSingleton.base(control.enabled) : "transparent" /*! \qmlproperty enumeration renderType diff --git a/src/controls/Styles/Base/TextFieldStyle.qml b/src/controls/Styles/Base/TextFieldStyle.qml index a0bed38d..4fe0d0a9 100644 --- a/src/controls/Styles/Base/TextFieldStyle.qml +++ b/src/controls/Styles/Base/TextFieldStyle.qml @@ -78,13 +78,13 @@ Style { property font font /*! The text color. */ - property color textColor: __syspal.text + property color textColor: SystemPaletteSingleton.text(control.enabled) /*! The text highlight color, used behind selections. */ - property color selectionColor: __syspal.highlight + property color selectionColor: SystemPaletteSingleton.highlight(control.enabled) /*! The highlighted text color, used in selections. */ - property color selectedTextColor: __syspal.highlightedText + property color selectedTextColor: SystemPaletteSingleton.highlightedText(control.enabled) /*! \qmlproperty enumeration renderType diff --git a/src/controls/Styles/Desktop/CheckBoxStyle.qml b/src/controls/Styles/Desktop/CheckBoxStyle.qml index 6bb33663..456e7e4b 100644 --- a/src/controls/Styles/Desktop/CheckBoxStyle.qml +++ b/src/controls/Styles/Desktop/CheckBoxStyle.qml @@ -74,7 +74,7 @@ Style { renderType: Text.NativeRendering elide: Text.ElideRight enabled: control.enabled - color: __syspal.windowText + color: SystemPaletteSingleton.windowText(control.enabled) StyleItem { elementType: "focusrect" anchors.margins: -1 diff --git a/src/controls/Styles/Desktop/MenuStyle.qml b/src/controls/Styles/Desktop/MenuStyle.qml index 4a0d5894..ecd898cf 100644 --- a/src/controls/Styles/Desktop/MenuStyle.qml +++ b/src/controls/Styles/Desktop/MenuStyle.qml @@ -61,7 +61,7 @@ Style { fill: parent margins: pixelMetric("menupanelwidth") } - color: __syspal.window + color: SystemPaletteSingleton.window(control.enabled) } Accessible.role: Accessible.PopupMenu diff --git a/src/controls/Styles/Desktop/RadioButtonStyle.qml b/src/controls/Styles/Desktop/RadioButtonStyle.qml index 49e3cace..cf1d4091 100644 --- a/src/controls/Styles/Desktop/RadioButtonStyle.qml +++ b/src/controls/Styles/Desktop/RadioButtonStyle.qml @@ -77,7 +77,7 @@ Style { renderType: Text.NativeRendering elide: Text.ElideRight enabled: control.enabled - color: __syspal.windowText + color: SystemPaletteSingleton.windowText(control.enabled) StyleItem { elementType: "focusrect" anchors.margins: -1 diff --git a/src/controls/Styles/Desktop/SpinBoxStyle.qml b/src/controls/Styles/Desktop/SpinBoxStyle.qml index 7896c234..36e84cd4 100644 --- a/src/controls/Styles/Desktop/SpinBoxStyle.qml +++ b/src/controls/Styles/Desktop/SpinBoxStyle.qml @@ -63,10 +63,10 @@ Style { property int horizontalAlignment: Qt.platform.os === "osx" ? Qt.AlignRight : Qt.AlignLeft property int verticalAlignment: Qt.AlignVCenter - property color foregroundColor: __syspal.text - property color backgroundColor: __syspal.base - property color selectionColor: __syspal.highlight - property color selectedTextColor: __syspal.highlightedText + property color foregroundColor: SystemPaletteSingleton.text(control.enabled) + property color backgroundColor: SystemPaletteSingleton.base(control.enabled) + property color selectionColor: SystemPaletteSingleton.highlight(control.enabled) + property color selectedTextColor: SystemPaletteSingleton.highlightedText(control.enabled) property int topPadding: edit.anchors.topMargin property int leftPadding: 3 + edit.anchors.leftMargin diff --git a/src/controls/Styles/Desktop/TableViewStyle.qml b/src/controls/Styles/Desktop/TableViewStyle.qml index 60589e5e..605c62d6 100644 --- a/src/controls/Styles/Desktop/TableViewStyle.qml +++ b/src/controls/Styles/Desktop/TableViewStyle.qml @@ -48,7 +48,7 @@ ScrollViewStyle { readonly property TableView control: __control property bool activateItemOnSingleClick: __styleitem.styleHint("activateItemOnSingleClick") property color textColor: __styleitem.textColor - property color backgroundColor: __syspal.base + property color backgroundColor: SystemPaletteSingleton.base(control.enabled) property color highlightedTextColor: __styleitem.highlightedTextColor property StyleItem __styleitem: StyleItem{ diff --git a/src/controls/Styles/Desktop/TextAreaStyle.qml b/src/controls/Styles/Desktop/TextAreaStyle.qml index 46750c1a..9a177303 100644 --- a/src/controls/Styles/Desktop/TextAreaStyle.qml +++ b/src/controls/Styles/Desktop/TextAreaStyle.qml @@ -43,10 +43,10 @@ import QtQuick.Controls.Private 1.0 ScrollViewStyle { property font font: __styleitem.font - property color textColor: __syspal.text - property color selectionColor: __syspal.highlight - property color selectedTextColor: __syspal.highlightedText - property color backgroundColor: control.backgroundVisible ? __syspal.base : "transparent" + property color textColor: SystemPaletteSingleton.text(control.enabled) + property color selectionColor: SystemPaletteSingleton.highlight(control.enabled) + property color selectedTextColor: SystemPaletteSingleton.highlightedText(control.enabled) + property color backgroundColor: control.backgroundVisible ? SystemPaletteSingleton.base(control.enabled) : "transparent" property StyleItem __styleitem: StyleItem{ elementType: "edit" diff --git a/src/controls/Styles/Desktop/TextFieldStyle.qml b/src/controls/Styles/Desktop/TextFieldStyle.qml index 5c623b80..585df03d 100644 --- a/src/controls/Styles/Desktop/TextFieldStyle.qml +++ b/src/controls/Styles/Desktop/TextFieldStyle.qml @@ -54,10 +54,10 @@ Style { hover: hovered hints: control.styleHints - property color textColor: __syspal.text + property color textColor: SystemPaletteSingleton.text(control.enabled) property color placeholderTextColor: "darkGray" - property color selectionColor: __syspal.highlight - property color selectedTextColor: __syspal.highlightedText + property color selectionColor: SystemPaletteSingleton.highlight(control.enabled) + property color selectedTextColor: SystemPaletteSingleton.highlightedText(control.enabled) property bool rounded: !!hints["rounded"] -- cgit v1.2.1 From f433dbf758c5d7159b4b0431f819214c804424d0 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 23 Jun 2014 09:53:26 +0200 Subject: Slider: fix behavior inside a flickable on touch Do not move the handle immediately on press, but delay it until the drag is over the threshold. This makes Slider behave inside a flickable in a sensible way ie. the handle is not prematurely moved when flicking Change-Id: Ie02762717156e75be9db757330a95a3f50451f1a Reviewed-by: Caroline Chao Reviewed-by: Shawn Rutledge --- src/controls/Slider.qml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/controls') diff --git a/src/controls/Slider.qml b/src/controls/Slider.qml index ffea986c..0f7fc033 100644 --- a/src/controls/Slider.qml +++ b/src/controls/Slider.qml @@ -229,18 +229,22 @@ Control { onMouseXChanged: { if (pressed && __horizontal) { var pos = clamp (mouse.x + clickOffset - fakeHandle.width/2) - fakeHandle.x = pos - if (Math.abs(mouse.x - pressX) >= Settings.dragThreshold) + var overThreshold = Math.abs(mouse.x - pressX) >= Settings.dragThreshold + if (overThreshold) preventStealing = true + if (overThreshold || !Settings.hasTouchScreen) + fakeHandle.x = pos } } onMouseYChanged: { if (pressed && !__horizontal) { var pos = clamp (mouse.y + clickOffset- fakeHandle.height/2) - fakeHandle.y = pos - if (Math.abs(mouse.y - pressY) >= Settings.dragThreshold) + var overThreshold = Math.abs(mouse.y - pressY) >= Settings.dragThreshold + if (overThreshold) preventStealing = true + if (overThreshold || !Settings.hasTouchScreen) + fakeHandle.y = pos } } -- cgit v1.2.1 From a780d2ddedb769eba44263ae46684080d7ddc843 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 22 Jun 2014 18:17:40 +0200 Subject: ComboBox: open the popup on release on touch devices This is the common behavior on touch devices, and avoids such problems as opening the popup while trying to flick a ScrollView that contains a ComboBox. Change-Id: I9207bc2c00524fe4cd5a673f4fe505f6db825838 Reviewed-by: Caroline Chao --- src/controls/ComboBox.qml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/controls') diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index 9cb2a9f4..cc949153 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -153,7 +153,7 @@ Control { /*! \qmlproperty bool ComboBox::pressed This property holds whether the button is being pressed. */ - readonly property bool pressed: mouseArea.pressed && mouseArea.containsMouse || popup.__popupVisible + readonly property bool pressed: mouseArea.effectivePressed || popup.__popupVisible /*! \qmlproperty bool ComboBox::hovered @@ -309,12 +309,23 @@ Control { MouseArea { id: mouseArea + property bool overridePressed: false + readonly property bool effectivePressed: (pressed || overridePressed) && containsMouse anchors.fill: parent hoverEnabled: true onPressed: { if (comboBox.activeFocusOnPress) forceActiveFocus() - popup.show() + if (!Settings.hasTouchScreen) + popup.show() + else + overridePressed = true + } + onCanceled: overridePressed = false + onClicked: { + if (Settings.hasTouchScreen) + popup.show() + overridePressed = false } onWheel: { if (wheel.angleDelta.y > 0) { -- cgit v1.2.1 From 7a719d3f5c488cf49e28c579300dfbcc70cefb6a Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Tue, 24 Jun 2014 10:29:58 +0200 Subject: Remove Widgets dependency for QNX Changes.txt says that with Qt 5.2.0 dependency for Widgets have been removed for touch based platforms. But QNX is also a touch based platform and its missing. Change-Id: I140842d4501422537175ac5acb07beebe994f0eb Reviewed-by: J-P Nurmi --- src/controls/Private/private.pri | 2 +- src/controls/Private/qquickcontrolsettings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/controls') diff --git a/src/controls/Private/private.pri b/src/controls/Private/private.pri index b530a229..a9205338 100644 --- a/src/controls/Private/private.pri +++ b/src/controls/Private/private.pri @@ -22,7 +22,7 @@ SOURCES += \ $$PWD/qquickabstractstyle.cpp -!android: !ios: !blackberry: qtHaveModule(widgets) { +!android: !ios: !blackberry: !qnx: qtHaveModule(widgets) { QT += widgets HEADERS += $$PWD/qquickstyleitem_p.h SOURCES += $$PWD/qquickstyleitem.cpp diff --git a/src/controls/Private/qquickcontrolsettings.cpp b/src/controls/Private/qquickcontrolsettings.cpp index e1d0cabb..4ad5cfe2 100644 --- a/src/controls/Private/qquickcontrolsettings.cpp +++ b/src/controls/Private/qquickcontrolsettings.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE static QString defaultStyleName() { //Only enable QStyle support when we are using QApplication -#if !defined(Q_OS_IOS) && !defined(Q_OS_ANDROID) && !defined (Q_OS_BLACKBERRY) +#if !defined(Q_OS_IOS) && !defined(Q_OS_ANDROID) && !defined (Q_OS_BLACKBERRY) && !defined (Q_OS_QNX) if (QCoreApplication::instance()->inherits("QApplication")) return QLatin1String("Desktop"); #endif -- cgit v1.2.1 From b804244af89313fda33106321fcbc508d6a2e884 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 24 Jun 2014 13:13:02 +0200 Subject: Remove QtWidgets dependency for WinRT Change-Id: Ifacceae8690d2ab4dfaed0d5439b9e29804c1943 Reviewed-by: Andrew Knight --- src/controls/Private/private.pri | 2 +- src/controls/Private/qquickcontrolsettings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/controls') diff --git a/src/controls/Private/private.pri b/src/controls/Private/private.pri index a9205338..a1542395 100644 --- a/src/controls/Private/private.pri +++ b/src/controls/Private/private.pri @@ -22,7 +22,7 @@ SOURCES += \ $$PWD/qquickabstractstyle.cpp -!android: !ios: !blackberry: !qnx: qtHaveModule(widgets) { +!android: !ios: !blackberry: !qnx: !winrt: qtHaveModule(widgets) { QT += widgets HEADERS += $$PWD/qquickstyleitem_p.h SOURCES += $$PWD/qquickstyleitem.cpp diff --git a/src/controls/Private/qquickcontrolsettings.cpp b/src/controls/Private/qquickcontrolsettings.cpp index 4ad5cfe2..aea3d141 100644 --- a/src/controls/Private/qquickcontrolsettings.cpp +++ b/src/controls/Private/qquickcontrolsettings.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE static QString defaultStyleName() { //Only enable QStyle support when we are using QApplication -#if !defined(Q_OS_IOS) && !defined(Q_OS_ANDROID) && !defined (Q_OS_BLACKBERRY) && !defined (Q_OS_QNX) +#if !defined(Q_OS_IOS) && !defined(Q_OS_ANDROID) && !defined (Q_OS_BLACKBERRY) && !defined (Q_OS_QNX) && !defined(Q_OS_WINRT) if (QCoreApplication::instance()->inherits("QApplication")) return QLatin1String("Desktop"); #endif -- cgit v1.2.1 From 6b876b21cd23f2af879543edf773dac41b4d0e97 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 24 Jun 2014 13:19:17 +0200 Subject: Cleanup whitespace Change-Id: I9e84ce56e853a18205aa180cef1ee8ff4f2f678c Reviewed-by: Caroline Chao --- src/controls/Private/private.pri | 2 +- src/controls/Private/qquickcontrolsettings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/controls') diff --git a/src/controls/Private/private.pri b/src/controls/Private/private.pri index a1542395..32ad0cf6 100644 --- a/src/controls/Private/private.pri +++ b/src/controls/Private/private.pri @@ -22,7 +22,7 @@ SOURCES += \ $$PWD/qquickabstractstyle.cpp -!android: !ios: !blackberry: !qnx: !winrt: qtHaveModule(widgets) { +!android:!ios:!blackberry:!qnx:!winrt:qtHaveModule(widgets) { QT += widgets HEADERS += $$PWD/qquickstyleitem_p.h SOURCES += $$PWD/qquickstyleitem.cpp diff --git a/src/controls/Private/qquickcontrolsettings.cpp b/src/controls/Private/qquickcontrolsettings.cpp index aea3d141..b7ebc213 100644 --- a/src/controls/Private/qquickcontrolsettings.cpp +++ b/src/controls/Private/qquickcontrolsettings.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE static QString defaultStyleName() { //Only enable QStyle support when we are using QApplication -#if !defined(Q_OS_IOS) && !defined(Q_OS_ANDROID) && !defined (Q_OS_BLACKBERRY) && !defined (Q_OS_QNX) && !defined(Q_OS_WINRT) +#if !defined(Q_OS_IOS) && !defined(Q_OS_ANDROID) && !defined(Q_OS_BLACKBERRY) && !defined(Q_OS_QNX) && !defined(Q_OS_WINRT) if (QCoreApplication::instance()->inherits("QApplication")) return QLatin1String("Desktop"); #endif -- cgit v1.2.1