diff options
Diffstat (limited to 'src/imports/controls')
307 files changed, 4462 insertions, 3514 deletions
diff --git a/src/imports/controls/AbstractButton.qml b/src/imports/controls/AbstractButton.qml index 2ff1b82c..f3dda0af 100644 --- a/src/imports/controls/AbstractButton.qml +++ b/src/imports/controls/AbstractButton.qml @@ -34,15 +34,14 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T T.AbstractButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - (contentItem ? contentItem.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem ? contentItem.y + contentItem.baselineOffset : 0 + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) } diff --git a/src/imports/controls/Action.qml b/src/imports/controls/Action.qml index 0ba5822f..fe86213a 100644 --- a/src/imports/controls/Action.qml +++ b/src/imports/controls/Action.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T T.Action { } diff --git a/src/imports/controls/ActionGroup.qml b/src/imports/controls/ActionGroup.qml index a8c49d8b..ae8772d6 100644 --- a/src/imports/controls/ActionGroup.qml +++ b/src/imports/controls/ActionGroup.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T T.ActionGroup { } diff --git a/src/imports/controls/ApplicationWindow.qml b/src/imports/controls/ApplicationWindow.qml index 84b618e1..4ad97082 100644 --- a/src/imports/controls/ApplicationWindow.qml +++ b/src/imports/controls/ApplicationWindow.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.3 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.ApplicationWindow { id: window diff --git a/src/imports/controls/BusyIndicator.qml b/src/imports/controls/BusyIndicator.qml index bde5fa7c..a79e2620 100644 --- a/src/imports/controls/BusyIndicator.qml +++ b/src/imports/controls/BusyIndicator.qml @@ -34,16 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.BusyIndicator { id: control - implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding - implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/Button.qml b/src/imports/controls/Button.qml index 7039dfc9..4132e326 100644 --- a/src/imports/controls/Button.qml +++ b/src/imports/controls/Button.qml @@ -34,23 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.Button { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 - leftPadding: padding + 2 - rightPadding: padding + 2 + horizontalPadding: padding + 2 spacing: 6 icon.width: 24 diff --git a/src/imports/controls/ButtonGroup.qml b/src/imports/controls/ButtonGroup.qml index 4e8ae893..50d3b840 100644 --- a/src/imports/controls/ButtonGroup.qml +++ b/src/imports/controls/ButtonGroup.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T T.ButtonGroup { } diff --git a/src/imports/controls/CheckBox.qml b/src/imports/controls/CheckBox.qml index 136c9b36..be4e62a6 100644 --- a/src/imports/controls/CheckBox.qml +++ b/src/imports/controls/CheckBox.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 T.CheckBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/CheckDelegate.qml b/src/imports/controls/CheckDelegate.qml index 087c9d75..3e58ffbb 100644 --- a/src/imports/controls/CheckDelegate.qml +++ b/src/imports/controls/CheckDelegate.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 T.CheckDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 12 spacing: 12 diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index 2bb26967..5cef9e55 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.3 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.ComboBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) diff --git a/src/imports/controls/Container.qml b/src/imports/controls/Container.qml index e7cf8a2a..1f30de42 100644 --- a/src/imports/controls/Container.qml +++ b/src/imports/controls/Container.qml @@ -34,14 +34,14 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T T.Container { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - (contentItem ? contentItem.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) } diff --git a/src/imports/controls/Control.qml b/src/imports/controls/Control.qml index 5728da0a..ff1c0b08 100644 --- a/src/imports/controls/Control.qml +++ b/src/imports/controls/Control.qml @@ -34,14 +34,14 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T T.Control { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - (contentItem ? contentItem.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) } diff --git a/src/imports/controls/DelayButton.qml b/src/imports/controls/DelayButton.qml index b34caed6..024ebcfe 100644 --- a/src/imports/controls/DelayButton.qml +++ b/src/imports/controls/DelayButton.qml @@ -34,23 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.DelayButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 - leftPadding: padding + 2 - rightPadding: padding + 2 + horizontalPadding: padding + 2 transition: Transition { NumberAnimation { diff --git a/src/imports/controls/Dial.qml b/src/imports/controls/Dial.qml index f4132611..37a9edbe 100644 --- a/src/imports/controls/Dial.qml +++ b/src/imports/controls/Dial.qml @@ -34,20 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.Dial { id: control - implicitWidth: 184 - implicitHeight: 184 + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) || 184 // ### remove 184 in Qt 6 + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) || 184 // ### remove 184 in Qt 6 background: DialImpl { - width: control.availableWidth - height: control.availableHeight + implicitWidth: 184 + implicitHeight: 184 color: control.visualFocus ? control.palette.highlight : control.palette.dark progress: control.position opacity: control.enabled ? 1 : 0.3 diff --git a/src/imports/controls/Dialog.qml b/src/imports/controls/Dialog.qml index 913e23f1..5f8d74c4 100644 --- a/src/imports/controls/Dialog.qml +++ b/src/imports/controls/Dialog.qml @@ -34,25 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 T.Dialog { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - header && header.visible ? header.implicitWidth : 0, - footer && footer.visible ? footer.implicitWidth : 0, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (header && header.visible ? header.implicitHeight + spacing : 0) - + (footer && footer.visible ? footer.implicitHeight + spacing : 0) - + (contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0)) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) padding: 12 diff --git a/src/imports/controls/DialogButtonBox.qml b/src/imports/controls/DialogButtonBox.qml index 3189967d..aa0353c0 100644 --- a/src/imports/controls/DialogButtonBox.qml +++ b/src/imports/controls/DialogButtonBox.qml @@ -34,16 +34,16 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T T.DialogButtonBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + (control.count === 1 ? contentWidth * 2 : contentWidth) + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) spacing: 1 padding: 12 @@ -54,9 +54,6 @@ T.DialogButtonBox { } contentItem: ListView { - implicitWidth: control.count === 1 ? 200 : contentWidth - implicitHeight: 40 - model: control.contentModel spacing: control.spacing orientation: ListView.Horizontal diff --git a/src/imports/controls/Drawer.qml b/src/imports/controls/Drawer.qml index dbafbd92..0b882f90 100644 --- a/src/imports/controls/Drawer.qml +++ b/src/imports/controls/Drawer.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.Drawer { id: control parent: T.Overlay.overlay - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: control.edge === Qt.BottomEdge leftPadding: control.edge === Qt.RightEdge diff --git a/src/imports/controls/Frame.qml b/src/imports/controls/Frame.qml index 7c8a4db7..9ada5273 100644 --- a/src/imports/controls/Frame.qml +++ b/src/imports/controls/Frame.qml @@ -34,19 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.Frame { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 12 diff --git a/src/imports/controls/GroupBox.qml b/src/imports/controls/GroupBox.qml index 2985c02e..e16148bc 100644 --- a/src/imports/controls/GroupBox.qml +++ b/src/imports/controls/GroupBox.qml @@ -34,25 +34,23 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.GroupBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - label ? label.implicitWidth + leftPadding + rightPadding : 0, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitLabelWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) spacing: 6 padding: 12 - topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0) + topPadding: padding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0) label: Text { x: control.leftPadding diff --git a/src/imports/controls/ItemDelegate.qml b/src/imports/controls/ItemDelegate.qml index 6367bc86..a7cc499d 100644 --- a/src/imports/controls/ItemDelegate.qml +++ b/src/imports/controls/ItemDelegate.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.ItemDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 12 spacing: 8 diff --git a/src/imports/controls/Label.qml b/src/imports/controls/Label.qml index aa02918f..6c3c05d4 100644 --- a/src/imports/controls/Label.qml +++ b/src/imports/controls/Label.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.Label { id: control diff --git a/src/imports/controls/Menu.qml b/src/imports/controls/Menu.qml index 0545b9a1..cebca827 100644 --- a/src/imports/controls/Menu.qml +++ b/src/imports/controls/Menu.qml @@ -34,19 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T -import QtQuick.Window 2.11 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T +import QtQuick.Window 2.12 T.Menu { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) margins: 0 overlap: 1 diff --git a/src/imports/controls/MenuBar.qml b/src/imports/controls/MenuBar.qml index 058c8736..9e145b6a 100644 --- a/src/imports/controls/MenuBar.qml +++ b/src/imports/controls/MenuBar.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 T.MenuBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) delegate: MenuBarItem { } diff --git a/src/imports/controls/MenuBarItem.qml b/src/imports/controls/MenuBarItem.qml index 02e3ac43..e1ba4a41 100644 --- a/src/imports/controls/MenuBarItem.qml +++ b/src/imports/controls/MenuBarItem.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 T.MenuBarItem { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 6 padding: 6 diff --git a/src/imports/controls/MenuItem.qml b/src/imports/controls/MenuItem.qml index 90a19f57..7af280a3 100644 --- a/src/imports/controls/MenuItem.qml +++ b/src/imports/controls/MenuItem.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.MenuItem { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/MenuSeparator.qml b/src/imports/controls/MenuSeparator.qml index ac47e32c..43c421a3 100644 --- a/src/imports/controls/MenuSeparator.qml +++ b/src/imports/controls/MenuSeparator.qml @@ -34,20 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.MenuSeparator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 2 - topPadding: padding + 4 - bottomPadding: padding + 4 + verticalPadding: padding + 4 contentItem: Rectangle { implicitWidth: 188 diff --git a/src/imports/controls/Page.qml b/src/imports/controls/Page.qml index 23377368..844f44d1 100644 --- a/src/imports/controls/Page.qml +++ b/src/imports/controls/Page.qml @@ -34,25 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.Page { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding, - header && header.visible ? header.implicitWidth : 0, - footer && footer.visible ? footer.implicitWidth : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding - + (header && header.visible ? header.implicitHeight + spacing : 0) - + (footer && footer.visible ? footer.implicitHeight + spacing : 0)) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) background: Rectangle { color: control.palette.window diff --git a/src/imports/controls/PageIndicator.qml b/src/imports/controls/PageIndicator.qml index 9d048002..6985919b 100644 --- a/src/imports/controls/PageIndicator.qml +++ b/src/imports/controls/PageIndicator.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.PageIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/Pane.qml b/src/imports/controls/Pane.qml index 7517e2f2..ee715c86 100644 --- a/src/imports/controls/Pane.qml +++ b/src/imports/controls/Pane.qml @@ -34,19 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.Pane { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 12 diff --git a/src/imports/controls/Popup.qml b/src/imports/controls/Popup.qml index 7ea706ed..13de88a3 100644 --- a/src/imports/controls/Popup.qml +++ b/src/imports/controls/Popup.qml @@ -34,21 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.Popup { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 12 diff --git a/src/imports/controls/ProgressBar.qml b/src/imports/controls/ProgressBar.qml index d91bcd57..c6b773ce 100644 --- a/src/imports/controls/ProgressBar.qml +++ b/src/imports/controls/ProgressBar.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 T.ProgressBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) contentItem: ProgressBarImpl { implicitHeight: 6 diff --git a/src/imports/controls/RadioButton.qml b/src/imports/controls/RadioButton.qml index d95d2a7b..02251239 100644 --- a/src/imports/controls/RadioButton.qml +++ b/src/imports/controls/RadioButton.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.RadioButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/RadioDelegate.qml b/src/imports/controls/RadioDelegate.qml index 556d678f..3846cd34 100644 --- a/src/imports/controls/RadioDelegate.qml +++ b/src/imports/controls/RadioDelegate.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.RadioDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 12 spacing: 12 diff --git a/src/imports/controls/RangeSlider.qml b/src/imports/controls/RangeSlider.qml index f2c9266e..6de74a9f 100644 --- a/src/imports/controls/RangeSlider.qml +++ b/src/imports/controls/RangeSlider.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.RangeSlider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(first.handle ? first.handle.implicitWidth : 0, - second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(first.handle ? first.handle.implicitHeight : 0, - second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + first.implicitHandleWidth + leftPadding + rightPadding, + second.implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + first.implicitHandleHeight + topPadding + bottomPadding, + second.implicitHandleHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/RoundButton.qml b/src/imports/controls/RoundButton.qml index 9692b9de..11649094 100644 --- a/src/imports/controls/RoundButton.qml +++ b/src/imports/controls/RoundButton.qml @@ -34,19 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.RoundButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/ScrollBar.qml b/src/imports/controls/ScrollBar.qml index 2f8826bf..c16b4356 100644 --- a/src/imports/controls/ScrollBar.qml +++ b/src/imports/controls/ScrollBar.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.ScrollBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 2 visible: control.policy !== T.ScrollBar.AlwaysOff diff --git a/src/imports/controls/ScrollIndicator.qml b/src/imports/controls/ScrollIndicator.qml index 6616d6c6..96099bf1 100644 --- a/src/imports/controls/ScrollIndicator.qml +++ b/src/imports/controls/ScrollIndicator.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.ScrollIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 2 diff --git a/src/imports/controls/ScrollView.qml b/src/imports/controls/ScrollView.qml index 725a50a9..57299575 100644 --- a/src/imports/controls/ScrollView.qml +++ b/src/imports/controls/ScrollView.qml @@ -34,19 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.ScrollView { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : -1) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : -1) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) ScrollBar.vertical: ScrollBar { parent: control diff --git a/src/imports/controls/Slider.qml b/src/imports/controls/Slider.qml index 9d4942c9..3d95cae9 100644 --- a/src/imports/controls/Slider.qml +++ b/src/imports/controls/Slider.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.Slider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitHandleHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/SpinBox.qml b/src/imports/controls/SpinBox.qml index 51d635a6..14a6ea52 100644 --- a/src/imports/controls/SpinBox.qml +++ b/src/imports/controls/SpinBox.qml @@ -34,23 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.SpinBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentItem.implicitWidth + 2 * padding + - (up.indicator ? up.indicator.implicitWidth : 0) + - (down.indicator ? down.indicator.implicitWidth : 0)) - implicitHeight: Math.max(contentItem.implicitHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, - up.indicator ? up.indicator.implicitHeight : 0, - down.indicator ? down.indicator.implicitHeight : 0) - baselineOffset: contentItem.y + contentItem.baselineOffset + up.implicitIndicatorWidth + + down.implicitIndicatorWidth) + implicitHeight: Math.max(implicitContentHeight + topPadding + bottomPadding, + implicitBackgroundHeight, + up.implicitIndicatorHeight, + down.implicitIndicatorHeight) padding: 6 leftPadding: padding + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0)) diff --git a/src/imports/controls/StackView.qml b/src/imports/controls/StackView.qml index cc4e1472..5da0c541 100644 --- a/src/imports/controls/StackView.qml +++ b/src/imports/controls/StackView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Templates 2.5 as T T.StackView { id: control diff --git a/src/imports/controls/SwipeDelegate.qml b/src/imports/controls/SwipeDelegate.qml index 4f2c9ee1..146c357b 100644 --- a/src/imports/controls/SwipeDelegate.qml +++ b/src/imports/controls/SwipeDelegate.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.SwipeDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 12 spacing: 12 diff --git a/src/imports/controls/SwipeView.qml b/src/imports/controls/SwipeView.qml index 827c9cd6..9665b5ca 100644 --- a/src/imports/controls/SwipeView.qml +++ b/src/imports/controls/SwipeView.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Templates 2.5 as T T.SwipeView { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) contentItem: ListView { model: control.contentModel diff --git a/src/imports/controls/Switch.qml b/src/imports/controls/Switch.qml index 30da70f4..e7987385 100644 --- a/src/imports/controls/Switch.qml +++ b/src/imports/controls/Switch.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 T.Switch { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/SwitchDelegate.qml b/src/imports/controls/SwitchDelegate.qml index 21a11491..4d4602e8 100644 --- a/src/imports/controls/SwitchDelegate.qml +++ b/src/imports/controls/SwitchDelegate.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 T.SwitchDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 12 spacing: 12 diff --git a/src/imports/controls/TabBar.qml b/src/imports/controls/TabBar.qml index d95d7f39..eb4c0ae2 100644 --- a/src/imports/controls/TabBar.qml +++ b/src/imports/controls/TabBar.qml @@ -34,15 +34,15 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T T.TabBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) spacing: 1 diff --git a/src/imports/controls/TabButton.qml b/src/imports/controls/TabButton.qml index 964f4e1f..b6a6317c 100644 --- a/src/imports/controls/TabButton.qml +++ b/src/imports/controls/TabButton.qml @@ -34,19 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.TabButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/TextArea.qml b/src/imports/controls/TextArea.qml index 86dc7cbf..ff252bba 100644 --- a/src/imports/controls/TextArea.qml +++ b/src/imports/controls/TextArea.qml @@ -34,25 +34,26 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.TextArea { id: control implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, - background ? background.implicitWidth : 0, + implicitBackgroundWidth + leftInset + rightInset, placeholder.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, + implicitBackgroundHeight + topInset + bottomInset, placeholder.implicitHeight + topPadding + bottomPadding) padding: 6 leftPadding: padding + 4 color: control.palette.text + placeholderTextColor: Color.transparent(control.color, 0.5) selectionColor: control.palette.highlight selectedTextColor: control.palette.highlightedText @@ -65,8 +66,7 @@ T.TextArea { text: control.placeholderText font: control.font - opacity: 0.5 - color: control.color + color: control.placeholderTextColor verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight diff --git a/src/imports/controls/TextField.qml b/src/imports/controls/TextField.qml index d9b0046d..aa57da81 100644 --- a/src/imports/controls/TextField.qml +++ b/src/imports/controls/TextField.qml @@ -34,19 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.TextField { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0) - || contentWidth + leftPadding + rightPadding - implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, + implicitWidth: implicitBackgroundWidth + leftInset + rightInset + || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding, placeholder.implicitHeight + topPadding + bottomPadding) padding: 6 @@ -55,6 +54,7 @@ T.TextField { color: control.palette.text selectionColor: control.palette.highlight selectedTextColor: control.palette.highlightedText + placeholderTextColor: Color.transparent(control.color, 0.5) verticalAlignment: TextInput.AlignVCenter PlaceholderText { @@ -66,8 +66,7 @@ T.TextField { text: control.placeholderText font: control.font - opacity: 0.5 - color: control.color + color: control.placeholderTextColor verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight diff --git a/src/imports/controls/ToolBar.qml b/src/imports/controls/ToolBar.qml index ba6684b9..1e73c0d6 100644 --- a/src/imports/controls/ToolBar.qml +++ b/src/imports/controls/ToolBar.qml @@ -34,19 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.ToolBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) background: Rectangle { implicitHeight: 40 diff --git a/src/imports/controls/ToolButton.qml b/src/imports/controls/ToolButton.qml index 371d1546..1c5b4662 100644 --- a/src/imports/controls/ToolButton.qml +++ b/src/imports/controls/ToolButton.qml @@ -34,19 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.ToolButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/ToolSeparator.qml b/src/imports/controls/ToolSeparator.qml index 306ca575..f2de5aa9 100644 --- a/src/imports/controls/ToolSeparator.qml +++ b/src/imports/controls/ToolSeparator.qml @@ -34,20 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.ToolSeparator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: vertical ? 6 : 2 - topPadding: vertical ? 2 : 6 - bottomPadding: vertical ? 2 : 6 + verticalPadding: vertical ? 2 : 6 contentItem: Rectangle { implicitWidth: vertical ? 1 : 30 diff --git a/src/imports/controls/ToolTip.qml b/src/imports/controls/ToolTip.qml index 46f7f577..e3af2ade 100644 --- a/src/imports/controls/ToolTip.qml +++ b/src/imports/controls/ToolTip.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.ToolTip { id: control @@ -45,10 +45,10 @@ T.ToolTip { x: parent ? (parent.width - implicitWidth) / 2 : 0 y: -implicitHeight - 3 - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) margins: 6 padding: 6 diff --git a/src/imports/controls/Tumbler.qml b/src/imports/controls/Tumbler.qml index b9cb51a1..0229dcf3 100644 --- a/src/imports/controls/Tumbler.qml +++ b/src/imports/controls/Tumbler.qml @@ -34,15 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T T.Tumbler { id: control - implicitWidth: 60 - implicitHeight: 200 + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) || 60 // ### remove 60 in Qt 6 + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) || 200 // ### remove 200 in Qt 6 delegate: Text { text: modelData @@ -54,6 +57,8 @@ T.Tumbler { } contentItem: TumblerView { + implicitWidth: 60 + implicitHeight: 200 model: control.model delegate: control.delegate path: Path { diff --git a/src/imports/controls/controls.pri b/src/imports/controls/controls.pri index 7840f6bf..675fcf39 100644 --- a/src/imports/controls/controls.pri +++ b/src/imports/controls/controls.pri @@ -12,7 +12,7 @@ SOURCES += \ $$PWD/qquickdefaultstyle.cpp \ $$PWD/qquickdefaulttheme.cpp -QML_CONTROLS = \ +QML_FILES += \ $$PWD/AbstractButton.qml \ $$PWD/Action.qml \ $$PWD/ActionGroup.qml \ @@ -67,5 +67,3 @@ QML_CONTROLS = \ $$PWD/ToolSeparator.qml \ $$PWD/ToolTip.qml \ $$PWD/Tumbler.qml - -!qtquickcompiler: QML_FILES += $$QML_CONTROLS diff --git a/src/imports/controls/controls.pro b/src/imports/controls/controls.pro index 6bbbe0d4..db0d14ae 100644 --- a/src/imports/controls/controls.pro +++ b/src/imports/controls/controls.pro @@ -1,6 +1,6 @@ TARGET = qtquickcontrols2plugin TARGETPATH = QtQuick/Controls.2 -IMPORT_VERSION = 2.4 +IMPORT_VERSION = 2.5 QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private @@ -11,7 +11,7 @@ include(controls.pri) OTHER_FILES += \ qmldir \ - $$QML_CONTROLS + $$QML_FILES SOURCES += \ $$PWD/qtquickcontrols2plugin.cpp @@ -22,15 +22,7 @@ RESOURCES += \ !static: qtConfig(quick-designer): include(designer/designer.pri) include(doc/doc.pri) -qtquickcompiler { - qmlfiles.prefix = /qt-project.org/imports/QtQuick/Controls.2 - qmlfiles.files += $$QML_CONTROLS - RESOURCES += qmlfiles -} else:!static { - CONFIG += qmlcache -} - -CONFIG += no_cxx_module +CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler load(qml_plugin) requires(qtConfig(quickcontrols2-default)) diff --git a/src/imports/controls/dependencies.json b/src/imports/controls/dependencies.json index 485db225..78029004 100644 --- a/src/imports/controls/dependencies.json +++ b/src/imports/controls/dependencies.json @@ -12,6 +12,6 @@ { "name": "QtQuick.Templates", "type": "module", - "version": "2.4" + "version": "2.5" } ] diff --git a/src/imports/controls/designer/designer.pri b/src/imports/controls/designer/designer.pri index 5be660c2..6ae9d5bb 100644 --- a/src/imports/controls/designer/designer.pri +++ b/src/imports/controls/designer/designer.pri @@ -1,7 +1,7 @@ -QML_FILES += \ +AUX_QML_FILES += \ $$PWD/qtquickcontrols2.metainfo -QML_FILES += \ +AUX_QML_FILES += \ $$PWD/AbstractButtonSection.qml \ $$PWD/BusyIndicatorSpecifics.qml \ $$PWD/ButtonSection.qml \ @@ -47,5 +47,5 @@ QML_FILES += \ $$PWD/ToolSeparatorSpecifics.qml \ $$PWD/TumblerSpecifics.qml -QML_FILES += \ +AUX_QML_FILES += \ $$PWD/images/*.png diff --git a/src/imports/controls/doc/images/qtquickcontrols2-control.png b/src/imports/controls/doc/images/qtquickcontrols2-control.png Binary files differindex 26babc9f..71840a49 100644 --- a/src/imports/controls/doc/images/qtquickcontrols2-control.png +++ b/src/imports/controls/doc/images/qtquickcontrols2-control.png diff --git a/src/imports/controls/doc/images/qtquickcontrols2-control.svg b/src/imports/controls/doc/images/qtquickcontrols2-control.svg index b0ffae7c..4b2057d1 100644 --- a/src/imports/controls/doc/images/qtquickcontrols2-control.svg +++ b/src/imports/controls/doc/images/qtquickcontrols2-control.svg @@ -9,16 +9,16 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="679.31317" - height="357.84125" - viewBox="0 0 679.31314 357.84124" + width="760" + height="580" + viewBox="0 0 759.99997 579.99999" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.3 (2405546, 2018-03-11)" sodipodi:docname="qtquickcontrols2-control.svg" - inkscape:export-filename="/home/mitch/Dropbox/qtquickcontrols2-control.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> + inkscape:export-filename="/home/jpnurmi/Projects/qt-dev/qtquickcontrols2/src/imports/controls/doc/images/qtquickcontrols2-control.png" + inkscape:export-xdpi="192" + inkscape:export-ydpi="192"> <defs id="defs4"> <marker @@ -31,9 +31,9 @@ inkscape:isstock="true"> <path id="path4327" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(0.8,0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -46,9 +46,9 @@ inkscape:isstock="true"> <path id="path4318" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(-0.8,-0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -61,8 +61,8 @@ inkscape:isstock="true"> <path id="path4191" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" transform="matrix(0.4,0,0,0.4,4,0)" inkscape:connector-curvature="0" /> </marker> @@ -78,7 +78,7 @@ id="path4212" style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" - transform="scale(-0.6,-0.6)" + transform="scale(-0.6)" inkscape:connector-curvature="0" /> </marker> <marker @@ -92,9 +92,9 @@ <path inkscape:connector-curvature="0" id="path4318-4" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(-0.8,-0.8)" /> + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> </marker> <marker inkscape:stockid="TriangleOutL" @@ -107,9 +107,9 @@ <path inkscape:connector-curvature="0" id="path4327-1" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(0.8,0.8)" /> + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> </marker> <marker inkscape:stockid="TriangleInL" @@ -121,9 +121,9 @@ inkscape:isstock="true"> <path id="path4318-9" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(-0.8,-0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -136,9 +136,9 @@ inkscape:isstock="true"> <path id="path4327-5" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(0.8,0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -151,9 +151,9 @@ inkscape:isstock="true"> <path id="path4318-2" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(-0.8,-0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -166,11 +166,371 @@ inkscape:isstock="true"> <path id="path4327-2" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(0.8,0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-9-6" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-2-2" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-1-1" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-2-7" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-2-5" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4318-4-7" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-1" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-8" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-96" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-4" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-9-6-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-2-2-7" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-1-1-6" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-2-7-8" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-2-5-6" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4318-4-7-2" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-4-8" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1-9" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-2-5-6-9" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4318-4-7-2-6" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-4-8-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1-9-8" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-1-7" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-8-9" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-96-7" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-4-4" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-2-5-6-9-1" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4318-4-7-2-6-7" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-4-8-4-0" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1-9-8-6" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-1-9" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-8-3" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-96-3" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-4-46" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-2-5-6-9-5" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4318-4-7-2-6-6" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-4-8-4-1" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1-9-8-7" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-1-9-7" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-8-3-7" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-96-3-2" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-4-46-3" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-2-5-6-9-5-8" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4318-4-7-2-6-6-1" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-4-8-4-1-3" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1-9-8-7-6" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> </defs> <sodipodi:namedview id="base" @@ -179,16 +539,16 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="2.8" - inkscape:cx="370.99138" - inkscape:cy="234.56612" + inkscape:zoom="1.4142136" + inkscape:cx="138.75529" + inkscape:cy="425.28174" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" - inkscape:window-width="3742" - inkscape:window-height="2124" - inkscape:window-x="98" - inkscape:window-y="36" + inkscape:window-width="3840" + inkscape:window-height="2031" + inkscape:window-x="0" + inkscape:window-y="55" inkscape:window-maximized="1" fit-margin-top="0" fit-margin-left="0" @@ -203,7 +563,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> @@ -211,88 +571,63 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(91.482322,-255.11685)"> + transform="translate(91.482322,-32.9581)"> <rect - style="fill:#cccccc;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.05102265;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" id="rect4136" - width="564.41473" - height="248.82799" - x="-30.289024" - y="321.69858" /> + width="518.94897" + height="298.94897" + x="29.043194" + y="193.48361" /> + <rect + style="fill:#ffd5d5;fill-opacity:1;stroke:none;stroke-width:0.83021182;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4136-3" + width="440" + height="220" + x="68.517685" + y="232.9581" /> <flowRoot xml:space="preserve" id="flowRoot4138" - style="font-style:normal;font-weight:normal;font-size:15.41801071px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(1.1690183,0,0,1.1690183,19.800223,-141.31953)"><flowRegion - id="flowRegion4140"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(1.1690183,0,0,1.1690183,115.80023,-231.31953)"><flowRegion + id="flowRegion4140" + style="fill:#ff2a2a"><rect id="rect4142" width="129.78784" height="31.668232" x="-34.519978" y="400.22751" - style="font-size:15.41801071px;fill:#000000" /></flowRegion><flowPara + style="font-size:15.41801071px;fill:#ff2a2a" /></flowRegion><flowPara id="flowPara4144" - style="font-size:20.55734825px;fill:#000000">Background</flowPara><flowPara - id="flowPara4146" /></flowRoot> <rect - style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:27.60000038;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.58381503" + style="font-size:20.55734825px;line-height:1.25;fill:#ff2a2a">Background</flowPara><flowPara + id="flowPara4146" + style="font-size:20.55734825px;line-height:1.25;fill:#ff2a2a">Â </flowPara></flowRoot> <rect + style="fill:#d7e3f4;fill-opacity:1;stroke:none;stroke-width:22.32431984;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.58381503" id="rect4148" - width="464.22452" - height="165.94499" - x="18.895706" - y="364.74274" /> + width="360" + height="140" + x="108.51768" + y="272.95813" /> <flowRoot xml:space="preserve" id="flowRoot4138-6" - style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,144.03104,146.23557)"><flowRegion - id="flowRegion4140-6"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,184.57261,41.294224)"><flowRegion + id="flowRegion4140-6" + style="fill:#0055d4"><rect id="rect4142-6" width="334.36047" height="80.812172" x="42.426407" y="481.62601" - style="font-size:40px;fill:#000000" /></flowRegion><flowPara - id="flowPara4146-6">Content item</flowPara></flowRoot> <path - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.04880464;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL);marker-end:url(#TriangleOutL)" - d="m 27.018805,516.90108 0,-133.62042" - id="path4179" - inkscape:connector-curvature="0" /> - <path - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.93839902;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2);marker-end:url(#TriangleOutL-9)" - d="m 26.776662,538.68728 451.028788,0" - id="path4179-7" - inkscape:connector-curvature="0" /> - <flowRoot - xml:space="preserve" - id="flowRoot4138-6-2" - style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,10.003309,144.31674)"><flowRegion - id="flowRegion4140-6-6"><rect - id="rect4142-6-1" - width="117.17769" - height="101.01524" - x="42.426407" - y="481.62601" - style="font-size:20px;fill:#000000" /></flowRegion><flowPara - id="flowPara9732" - style="font-size:17.5px;fill:#000000">Available height</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot4138-6-2-7" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,10.811464,253.07573)"><flowRegion - id="flowRegion4140-6-6-4"><rect - id="rect4142-6-1-4" - width="252.53812" - height="61.619293" - x="42.426407" - y="481.62601" - style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;fill:#000000" - id="flowPara10048">Available width</flowPara></flowRoot> <flowRoot + style="font-size:40px;fill:#0055d4" /></flowRegion><flowPara + id="flowPara4146-6" + style="font-size:40px;line-height:1.25;fill:#0055d4">Content item</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-1" - style="font-style:normal;font-weight:normal;font-size:25px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,210.99354,300.96896)"><flowRegion + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,247.75903,220.21488)"><flowRegion id="flowRegion4140-6-9"><rect id="rect4142-6-0" width="270.72089" @@ -301,21 +636,21 @@ y="481.62601" style="font-size:25px;fill:#000000" /></flowRegion><flowPara id="flowPara4146-6-2" - style="font-size:17.5px">Width</flowPara></flowRoot> <path - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.90119678;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-3);marker-end:url(#TriangleOutL-0)" - d="m -26.522148,583.27143 557.292688,0" + style="font-size:17.5px;line-height:1.25">Width</flowPara></flowRoot> <path + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.93053311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-3);marker-end:url(#TriangleOutL-0)" + d="M 33.168982,505.52033 H 543.32948" id="path4179-8" inkscape:connector-curvature="0" /> <path - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.9011969;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9);marker-end:url(#TriangleOutL-1)" - d="m -43.461661,566.30584 0,-239.7552" + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9);marker-end:url(#TriangleOutL-1)" + d="M 16.517683,487.33858 V 198.57762" id="path4179-9" inkscape:connector-curvature="0" /> <flowRoot xml:space="preserve" id="flowRoot4138-6-1-7" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,-112.00353,150.83655)"><flowRegion + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,-50.003525,47.195824)"><flowRegion id="flowRegion4140-6-9-7"><rect id="rect4142-6-0-5" width="270.72089" @@ -324,11 +659,11 @@ y="481.62601" style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara id="flowPara4146-6-2-9" - style="font-size:17.5px;fill:#000000">Height</flowPara></flowRoot> <flowRoot + style="font-size:17.5px;line-height:1.25;fill:#000000">Height</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-3" - style="font-style:normal;font-weight:normal;font-size:60px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,156.72375,-24.786365)"><flowRegion + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,206.65956,-144.78636)"><flowRegion id="flowRegion4140-6-67"><rect id="rect4142-6-5" width="334.36047" @@ -336,57 +671,266 @@ x="42.426407" y="481.62601" style="font-size:60px;fill:#000000" /></flowRegion><flowPara - id="flowPara4146-6-3">Control</flowPara></flowRoot> <flowRoot + style="font-size:60px;line-height:1.25" + id="flowPara14323">Popup</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,186.57489,257.45801)"><flowRegion - id="flowRegion4140-6-6-4-6"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,41.217752,149.93493)"><flowRegion + id="flowRegion4140-6-6-4-6" + style="text-align:center;text-anchor:middle;fill:#0055d4"><rect id="rect4142-6-1-4-2" width="252.53812" height="61.619293" x="42.426407" y="481.62601" - style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;fill:#000000" - id="flowPara10048-9">Bottom padding</flowPara></flowRoot> <flowRoot + style="font-size:17.5px;text-align:center;text-anchor:middle;fill:#0055d4" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#0055d4" + id="flowPara10048-9">Bottom</flowPara><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#0055d4" + id="flowPara5290">padding</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5-1" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,193.9747,48.798368)"><flowRegion - id="flowRegion4140-6-6-4-6-2"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,384.82399,-69.046412)"><flowRegion + id="flowRegion4140-6-6-4-6-2" + style="fill:#0055d4"><rect id="rect4142-6-1-4-2-7" - width="252.53812" - height="61.619293" + width="71.826065" + height="43.785866" x="42.426407" y="481.62601" - style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;fill:#000000" - id="flowPara10048-9-0">Top padding</flowPara></flowRoot> <flowRoot + style="font-size:17.5px;fill:#0055d4" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#0055d4" + id="flowPara10048-9-0">Top</flowPara><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#0055d4" + id="flowPara4830">padding</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5-9" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,457.80767,148.11921)"><flowRegion - id="flowRegion4140-6-6-4-6-3"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,458.14041,-0.80935844)"><flowRegion + id="flowRegion4140-6-6-4-6-3" + style="fill:#0055d4"><rect id="rect4142-6-1-4-2-6" width="81.109558" height="93.762154" x="42.426407" y="481.62601" - style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000" + style="font-size:17.5px;fill:#0055d4" /></flowRegion><flowPara + style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#0055d4" id="flowPara4386">Right padding</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5-9-2" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,-54.735211,151.06168)"><flowRegion - id="flowRegion4140-6-6-4-6-3-5"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,19.173452,87.133114)"><flowRegion + id="flowRegion4140-6-6-4-6-3-5" + style="fill:#0055d4"><rect id="rect4142-6-1-4-2-6-4" width="81.109558" height="93.762154" x="42.426407" y="481.62601" + style="font-size:17.5px;fill:#0055d4" /></flowRegion><flowPara + style="font-size:17.02554321px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#0055d4" + id="flowPara4386-0">Left padding</flowPara></flowRoot> <path + style="fill:#ff2a2a;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:0.87824047;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9-6);marker-end:url(#TriangleOutL-1-1)" + d="M 72.916183,227.96278 V 198.98852" + id="path4179-9-8" + inkscape:connector-curvature="0" /> + <path + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:0.87323481;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-5);marker-end:url(#TriangleOutL-9-4)" + d="M 34.529058,238.58445 H 63.562954" + id="path4179-7-8" + inkscape:connector-curvature="0" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-1-5" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,47.895402,-88.000508)"><flowRegion + id="flowRegion4140-6-6-4-6-2-9" + style="fill:#ff2a2a"><rect + id="rect4142-6-1-4-2-7-7" + width="66.476036" + height="55.080368" + x="42.426407" + y="481.62601" + style="font-size:17.5px;fill:#ff2a2a" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#ff2a2a" + id="flowPara11237">Top inset</flowPara></flowRoot> <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-9-2-3" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,0.4414194,-43.952242)"><flowRegion + id="flowRegion4140-6-6-4-6-3-5-8" + style="fill:#ff2a2a"><rect + id="rect4142-6-1-4-2-6-4-8" + width="75.759529" + height="93.167732" + x="42.426407" + y="481.62601" + style="font-size:17.5px;fill:#ff2a2a" /></flowRegion><flowPara + style="font-size:17.02554321px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#ff2a2a" + id="flowPara4386-0-3">Left inset</flowPara></flowRoot> <path + style="fill:#0055d4;fill-rule:evenodd;stroke:#0055d4;stroke-width:0.97500122;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-1);marker-end:url(#TriangleOutL-96)" + d="M 462.28757,267.38769 V 199.50991" + id="path4179-3" + inkscape:connector-curvature="0" /> + <path + style="fill:#ff2a2a;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:0.87794411;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9-6-4);marker-end:url(#TriangleOutL-1-1-6)" + d="M 504.22784,486.94146 V 457.98675" + id="path4179-9-8-9" + inkscape:connector-curvature="0" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-1-5-0" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,424.36985,170.98794)"><flowRegion + id="flowRegion4140-6-6-4-6-2-9-6" + style="fill:#ff2a2a"><rect + id="rect4142-6-1-4-2-7-7-8" + width="91.442841" + height="44.974762" + x="42.426407" + y="481.62601" + style="font-size:17.5px;fill:#ff2a2a" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#ff2a2a" + id="flowPara11237-7">Bottom inset</flowPara></flowRoot> <path + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:0.87314719;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-5-6);marker-end:url(#TriangleOutL-9-4-8)" + d="M 513.47562,448.6218 H 542.5037" + id="path4179-7-8-6" + inkscape:connector-curvature="0" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-9-2-3-0" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,479.24023,126.32002)"><flowRegion + id="flowRegion4140-6-6-4-6-3-5-8-7" + style="fill:#ff2a2a"><rect + id="rect4142-6-1-4-2-6-4-8-0" + width="75.759529" + height="93.167732" + x="42.426407" + y="481.62601" + style="font-size:17.5px;fill:#ff2a2a" /></flowRegion><flowPara + style="font-size:17.02554321px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#ff2a2a" + id="flowPara3807">Right inset</flowPara></flowRoot> <path + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.05938387;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-5-6-9);marker-end:url(#TriangleOutL-9-4-8-4)" + d="m 474.52523,278.31524 h 66.93934" + id="path4179-7-8-6-0" + inkscape:connector-curvature="0" /> + <path + style="fill:#0055d4;fill-rule:evenodd;stroke:#0055d4;stroke-width:0.97513783;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-1-7);marker-end:url(#TriangleOutL-96-7)" + d="M 114.58911,486.37854 V 418.48175" + id="path4179-3-9" + inkscape:connector-curvature="0" /> + <path + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.05900466;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-5-6-9-1);marker-end:url(#TriangleOutL-9-4-8-4-0)" + d="M 35.582232,406.88667 H 102.47366" + id="path4179-7-8-6-0-0" + inkscape:connector-curvature="0" /> + <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.38;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4136-9" + width="638.62036" + height="418.6203" + x="-30.792475" + y="133.64795" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-3-8" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,192.12072,-213.92909)"><flowRegion + id="flowRegion4140-6-67-1"><rect + id="rect4142-6-5-6" + width="334.36047" + height="80.812172" + x="42.426407" + y="481.62601" + style="font-size:60px;fill:#000000" /></flowRegion><flowPara + style="font-size:60px;line-height:1.25" + id="flowPara14323-3">Window</flowPara></flowRoot> <path + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.83036995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-1-9);marker-end:url(#TriangleOutL-96-3)" + d="M 16.507747,188.209 V 138.97553" + id="path4179-3-1" + inkscape:connector-curvature="0" /> + <path + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.90094262;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-5-6-9-5);marker-end:url(#TriangleOutL-9-4-8-4-1)" + d="m 553.67227,505.52244 h 48.41379" + id="path4179-7-8-6-0-2" + inkscape:connector-curvature="0" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-1-2" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,-53.285062,-138.90295)"><flowRegion + id="flowRegion4140-6-6-4-6-2-92" + style="fill:#000000"><rect + id="rect4142-6-1-4-2-7-8" + width="71.826065" + height="43.785866" + x="42.426407" + y="481.62601" + style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#000000" + id="flowPara10048-9-0-1">Top</flowPara><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#000000" + id="flowPara4830-2">margin</flowPara></flowRoot> <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-1-2-4" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,530.78767,225.71855)"><flowRegion + id="flowRegion4140-6-6-4-6-2-92-7" + style="fill:#000000"><rect + id="rect4142-6-1-4-2-7-8-8" + width="71.826065" + height="43.785866" + x="42.426407" + y="481.62601" + style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#000000" + id="flowPara10048-9-0-1-6">Right</flowPara><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#000000" + id="flowPara4830-2-3">margin</flowPara></flowRoot> <path + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.83036995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-1-9-7);marker-end:url(#TriangleOutL-96-3-2)" + d="M 16.459117,546.78218 V 497.54871" + id="path4179-3-1-7" + inkscape:connector-curvature="0" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-1-2-2" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,-0.06072146,225.50386)"><flowRegion + id="flowRegion4140-6-6-4-6-2-92-5" + style="fill:#000000"><rect + id="rect4142-6-1-4-2-7-8-3" + width="71.826065" + height="43.785866" + x="42.426407" + y="481.62601" + style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#000000" + id="flowPara10048-9-0-1-7">Bottom</flowPara><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#000000" + id="flowPara4830-2-6">margin</flowPara></flowRoot> <path + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89733517;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-5-6-9-5-8);marker-end:url(#TriangleOutL-9-4-8-4-1-3)" + d="M -25.075855,505.54405 H 22.951007" + id="path4179-7-8-6-0-2-4" + inkscape:connector-curvature="0" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-1-2-2-0" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,-55.529842,180.17847)"><flowRegion + id="flowRegion4140-6-6-4-6-2-92-5-3" + style="fill:#000000"><rect + id="rect4142-6-1-4-2-7-8-3-5" + width="71.826065" + height="43.785866" + x="42.426407" + y="481.62601" style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.02554321px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000" - id="flowPara4386-0">Left padding</flowPara></flowRoot> </g> + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#000000" + id="flowPara10048-9-0-1-7-8">Left</flowPara><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#000000" + id="flowPara4830-2-6-5">margin</flowPara></flowRoot> </g> </svg> diff --git a/src/imports/controls/doc/images/qtquickcontrols2-dial-inputMode.svgz b/src/imports/controls/doc/images/qtquickcontrols2-dial-inputMode.svgz Binary files differnew file mode 100644 index 00000000..005ab7b3 --- /dev/null +++ b/src/imports/controls/doc/images/qtquickcontrols2-dial-inputMode.svgz diff --git a/src/imports/controls/doc/images/qtquickcontrols2-dial-inputmode.png b/src/imports/controls/doc/images/qtquickcontrols2-dial-inputmode.png Binary files differnew file mode 100644 index 00000000..27694ee3 --- /dev/null +++ b/src/imports/controls/doc/images/qtquickcontrols2-dial-inputmode.png diff --git a/src/imports/controls/doc/images/qtquickcontrols2-material-variant-dense.png b/src/imports/controls/doc/images/qtquickcontrols2-material-variant-dense.png Binary files differnew file mode 100644 index 00000000..02f39b78 --- /dev/null +++ b/src/imports/controls/doc/images/qtquickcontrols2-material-variant-dense.png diff --git a/src/imports/controls/doc/images/qtquickcontrols2-material-variant-normal.png b/src/imports/controls/doc/images/qtquickcontrols2-material-variant-normal.png Binary files differnew file mode 100644 index 00000000..c1e366c5 --- /dev/null +++ b/src/imports/controls/doc/images/qtquickcontrols2-material-variant-normal.png diff --git a/src/imports/controls/doc/images/qtquickcontrols2-popup.png b/src/imports/controls/doc/images/qtquickcontrols2-popup.png Binary files differindex a0bc3d8c..01d65709 100644 --- a/src/imports/controls/doc/images/qtquickcontrols2-popup.png +++ b/src/imports/controls/doc/images/qtquickcontrols2-popup.png diff --git a/src/imports/controls/doc/images/qtquickcontrols2-popup.svg b/src/imports/controls/doc/images/qtquickcontrols2-popup.svg index 91bde0c5..e39f3dce 100644 --- a/src/imports/controls/doc/images/qtquickcontrols2-popup.svg +++ b/src/imports/controls/doc/images/qtquickcontrols2-popup.svg @@ -9,15 +9,16 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="817.22076" - height="605.42444" - viewBox="0 0 766.14443 567.58541" + width="640" + height="420" + viewBox="0 0 639.99997 419.99999" id="svg2" version="1.1" - inkscape:version="0.92.1 r15371" - sodipodi:docname="qtquickcontrols2-popup.svg" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="qtquickcontrols2-control.svg" + inkscape:export-filename="/home/jpnurmi/Projects/qt-dev/qtquickcontrols2/src/imports/controls/doc/images/qtquickcontrols2-control.png" + inkscape:export-xdpi="192" + inkscape:export-ydpi="192"> <defs id="defs4"> <marker @@ -175,13 +176,13 @@ orient="auto" refY="0" refX="0" - id="TriangleInL-7" + id="TriangleInL-9-6" style="overflow:visible" inkscape:isstock="true"> <path - id="path4318-5" + id="path4318-2-2" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> @@ -190,13 +191,13 @@ orient="auto" refY="0" refX="0" - id="TriangleOutL-4" + id="TriangleOutL-1-1" style="overflow:visible" inkscape:isstock="true"> <path - id="path4327-17" + id="path4327-2-7" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> @@ -205,13 +206,43 @@ orient="auto" refY="0" refX="0" - id="TriangleInL-7-1" + id="TriangleInL-2-5" style="overflow:visible" inkscape:isstock="true"> <path - id="path4318-5-2" + inkscape:connector-curvature="0" + id="path4318-4-7" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-1" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-8" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> @@ -220,13 +251,43 @@ orient="auto" refY="0" refX="0" - id="TriangleOutL-4-3" + id="TriangleOutL-96" style="overflow:visible" inkscape:isstock="true"> <path - id="path4327-17-4" + id="path4327-4" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-9-6-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-2-2-7" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-1-1-6" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-2-7-8" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> @@ -235,14 +296,14 @@ orient="auto" refY="0" refX="0" - id="TriangleInL-2-4" + id="TriangleInL-2-5-6" style="overflow:visible" inkscape:isstock="true"> <path inkscape:connector-curvature="0" - id="path4318-4-7" + id="path4318-4-7-2" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" transform="scale(-0.8)" /> </marker> <marker @@ -250,14 +311,14 @@ orient="auto" refY="0" refX="0" - id="TriangleOutL-9-3" + id="TriangleOutL-9-4-8" style="overflow:visible" inkscape:isstock="true"> <path inkscape:connector-curvature="0" - id="path4327-1-1" + id="path4327-1-1-9" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:1.00000003pt;stroke-opacity:1" transform="scale(0.8)" /> </marker> <marker @@ -265,13 +326,43 @@ orient="auto" refY="0" refX="0" - id="TriangleInL-7-1-4" + id="TriangleInL-2-5-6-9" style="overflow:visible" inkscape:isstock="true"> <path - id="path4318-5-2-3" + inkscape:connector-curvature="0" + id="path4318-4-7-2-6" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-4-8-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1-9-8" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-1-7" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-8-9" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> @@ -280,13 +371,13 @@ orient="auto" refY="0" refX="0" - id="TriangleOutL-4-3-5" + id="TriangleOutL-96-7" style="overflow:visible" inkscape:isstock="true"> <path - id="path4327-17-4-6" + id="path4327-4-4" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> @@ -295,14 +386,14 @@ orient="auto" refY="0" refX="0" - id="TriangleInL-2-4-7" + id="TriangleInL-2-5-6-9-1" style="overflow:visible" inkscape:isstock="true"> <path inkscape:connector-curvature="0" - id="path4318-4-7-4" + id="path4318-4-7-2-6-7" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" transform="scale(-0.8)" /> </marker> <marker @@ -310,14 +401,14 @@ orient="auto" refY="0" refX="0" - id="TriangleOutL-9-3-6" + id="TriangleOutL-9-4-8-4-0" style="overflow:visible" inkscape:isstock="true"> <path inkscape:connector-curvature="0" - id="path4327-1-1-5" + id="path4327-1-1-9-8-6" d="M 5.77,0 -2.88,5 V -5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.00000003pt;stroke-opacity:1" transform="scale(0.8)" /> </marker> </defs> @@ -328,21 +419,21 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1" - inkscape:cx="433.56809" - inkscape:cy="282.4206" + inkscape:zoom="2.8284271" + inkscape:cx="328.65009" + inkscape:cy="205.42326" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" - inkscape:window-width="1920" - inkscape:window-height="1137" - inkscape:window-x="-8" - inkscape:window-y="-8" + inkscape:window-width="3840" + inkscape:window-height="2031" + inkscape:window-x="0" + inkscape:window-y="55" inkscape:window-maximized="1" - fit-margin-top="1" - fit-margin-left="1" - fit-margin-right="1" - fit-margin-bottom="1" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" units="px" /> <metadata id="metadata7"> @@ -360,312 +451,262 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(117.89629,-192.1482)"> + transform="translate(91.482322,-192.9581)"> <rect - style="fill:#cccccc;fill-opacity:1;stroke:#000000;stroke-width:1.21129668;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.05102265;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" id="rect4136" - width="564.20264" - height="365.80341" - x="-21.075951" - y="321.69159" /> + width="518.94897" + height="298.94897" + x="-30.956812" + y="253.48361" /> + <rect + style="fill:#ffd5d5;fill-opacity:1;stroke:none;stroke-width:0.83021182;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4136-3" + width="440" + height="220" + x="8.5176783" + y="292.9581" /> <flowRoot xml:space="preserve" id="flowRoot4138" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(1.1690183,0,0,1.1690183,28.907253,-141.43255)"><flowRegion - id="flowRegion4140"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(1.1690183,0,0,1.1690183,55.80022,-171.31953)"><flowRegion + id="flowRegion4140" + style="fill:#ff2a2a"><rect id="rect4142" width="129.78784" height="31.668232" x="-34.519978" y="400.22751" - style="font-size:15.41801071px;fill:#000000" /></flowRegion><flowPara + style="font-size:15.41801071px;fill:#ff2a2a" /></flowRegion><flowPara + id="flowPara4144" + style="font-size:20.55734825px;line-height:1.25;fill:#ff2a2a">Background</flowPara><flowPara id="flowPara4146" - style="font-size:19.24691807px;line-height:1.25">Background</flowPara></flowRoot> <rect - style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:32.28859329;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.58381503" + style="font-size:20.55734825px;line-height:1.25;fill:#ff2a2a">Â </flowPara></flowRoot> <rect + style="fill:#d7e3f4;fill-opacity:1;stroke:none;stroke-width:22.32431984;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.58381503" id="rect4148" - width="432.17508" - height="243.95665" - x="44.027798" - y="384.97104" /> + width="360" + height="140" + x="48.517677" + y="332.95813" /> <flowRoot xml:space="preserve" id="flowRoot4138-6" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-size:37.45019655px;" - transform="matrix(0.6007979,0,0,0.6007979,156.36974,204.3766)"><flowRegion + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,124.5726,101.29422)"><flowRegion id="flowRegion4140-6" - style="font-size:37.45019655px;"><rect + style="fill:#0055d4"><rect id="rect4142-6" width="334.36047" height="80.812172" x="42.426407" y="481.62601" - style="font-size:37.45019655px;fill:#000000;" /></flowRegion><flowPara + style="font-size:40px;fill:#0055d4" /></flowRegion><flowPara id="flowPara4146-6" - style="font-size:37.45019655px;line-height:1.25;">Content item</flowPara></flowRoot> <g - id="g8534" - transform="translate(3.75)"> - <path - sodipodi:nodetypes="cc" - inkscape:connector-curvature="0" - id="path4179" - d="M 53.000835,594.60056 V 394.41764" - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.04880464;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL);marker-end:url(#TriangleOutL)" /> - <flowRoot - transform="matrix(0.6007979,0,0,0.6007979,35.985339,191.89348)" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - id="flowRoot4138-6-2" - xml:space="preserve"><flowRegion - id="flowRegion4140-6-6"><rect - style="font-size:20px;fill:#000000" - y="481.62601" - x="42.426407" - height="101.01524" - width="117.17769" - id="rect4142-6-1" /></flowRegion><flowPara - style="font-size:17.5px;line-height:1.25;fill:#000000" - id="flowPara9732">Available height</flowPara></flowRoot> </g> - <g - id="g8545"> - <path - sodipodi:nodetypes="cc" - inkscape:connector-curvature="0" - id="path4179-7" - d="M 56.564013,608.03247 H 464.47744" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.91225624;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2);marker-end:url(#TriangleOutL-9)" /> - </g> + style="font-size:40px;line-height:1.25;fill:#0055d4">Content item</flowPara></flowRoot> <flowRoot + xml:space="preserve" + id="flowRoot4138-6-1" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,187.75902,280.21488)"><flowRegion + id="flowRegion4140-6-9"><rect + id="rect4142-6-0" + width="270.72089" + height="68.690361" + x="42.426407" + y="481.62601" + style="font-size:25px;fill:#000000" /></flowRegion><flowPara + id="flowPara4146-6-2" + style="font-size:17.5px;line-height:1.25">Width</flowPara></flowRoot> <path + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.93053311;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-3);marker-end:url(#TriangleOutL-0)" + d="M -26.831023,563.52033 H 483.32947" + id="path4179-8" + inkscape:connector-curvature="0" /> + <path + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9);marker-end:url(#TriangleOutL-1)" + d="M -41.482322,547.33858 V 258.57762" + id="path4179-9" + inkscape:connector-curvature="0" /> <flowRoot xml:space="preserve" - id="flowRoot4138-6-2-7" + id="flowRoot4138-6-1-7" style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.5748758,0,0,0.59339159,197.89365,327.81679)"><flowRegion - id="flowRegion4140-6-6-4"><rect - id="rect4142-6-1-4" - width="252.53812" - height="61.619293" + transform="matrix(0.6007979,0,0,0.6007979,-110.00353,107.19582)"><flowRegion + id="flowRegion4140-6-9-7"><rect + id="rect4142-6-0-5" + width="270.72089" + height="68.690361" x="42.426407" y="481.62601" style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;line-height:1.25;fill:#000000" - id="flowPara10048">Available width</flowPara></flowRoot> <g - id="g7654" - transform="translate(0,118.125)"> - <flowRoot - transform="matrix(0.6007979,0,0,0.6007979,220.10057,300.85594)" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - id="flowRoot4138-6-1" - xml:space="preserve"><flowRegion - id="flowRegion4140-6-9"><rect - style="font-size:25px;fill:#000000" - y="481.62601" - x="42.426407" - height="68.690361" - width="270.72089" - id="rect4142-6-0" /></flowRegion><flowPara - style="font-size:17.5px;line-height:1.25" - id="flowPara4146-6-2">Width</flowPara></flowRoot> <path - inkscape:connector-curvature="0" - id="path4179-8" - d="M -17.415118,583.15841 H 539.87757" - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.90119678;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-3);marker-end:url(#TriangleOutL-0)" /> - </g> - <g - id="g7868"> - <path - sodipodi:nodetypes="cc" - inkscape:connector-curvature="0" - id="path4179-9" - d="M -34.354631,681.50532 V 326.43762" - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.9011969;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9);marker-end:url(#TriangleOutL-1)" /> - <flowRoot - transform="matrix(0.6007979,0,0,0.6007979,-102.8965,207.92708)" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - id="flowRoot4138-6-1-7" - xml:space="preserve"><flowRegion - id="flowRegion4140-6-9-7"><rect - style="font-size:17.5px;fill:#000000" - y="481.62601" - x="42.426407" - height="68.690361" - width="270.72089" - id="rect4142-6-0-5" /></flowRegion><flowPara - style="font-size:17.5px;line-height:1.25;fill:#000000" - id="flowPara4146-6-2-9">Height</flowPara></flowRoot> </g> - <flowRoot + id="flowPara4146-6-2-9" + style="font-size:17.5px;line-height:1.25;fill:#000000">Height</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-3" - style="font-style:normal;font-weight:normal;font-size:54.09472656px;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,189.12753,-15.52439)"><flowRegion - id="flowRegion4140-6-67" - style="font-size:54.09472656px"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,138.50125,-84.786365)"><flowRegion + id="flowRegion4140-6-67"><rect id="rect4142-6-5" width="334.36047" height="80.812172" x="42.426407" y="481.62601" - style="font-size:54.09472656px;fill:#000000" /></flowRegion><flowPara + style="font-size:60px;fill:#000000" /></flowRegion><flowPara id="flowPara4146-6-3" - style="font-size:54.09472656px;line-height:1.25">Popup</flowPara></flowRoot> <flowRoot + style="font-size:60px;line-height:1.25">Control</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,193.38009,362.34499)"><flowRegion - id="flowRegion4140-6-6-4-6"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,-18.782253,209.93493)"><flowRegion + id="flowRegion4140-6-6-4-6" + style="text-align:center;text-anchor:middle;fill:#0055d4"><rect id="rect4142-6-1-4-2" width="252.53812" height="61.619293" x="42.426407" y="481.62601" - style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;line-height:1.25;fill:#000000" - id="flowPara10048-9">Bottom padding</flowPara></flowRoot> <flowRoot + style="font-size:17.5px;text-align:center;text-anchor:middle;fill:#0055d4" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#0055d4" + id="flowPara10048-9">Bottom</flowPara><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#0055d4" + id="flowPara5290">padding</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5-1" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,203.99672,59.935343)"><flowRegion - id="flowRegion4140-6-6-4-6-2"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,324.82398,-9.0464154)"><flowRegion + id="flowRegion4140-6-6-4-6-2" + style="fill:#0055d4"><rect id="rect4142-6-1-4-2-7" - width="252.53812" - height="61.619293" + width="71.826065" + height="43.785866" x="42.426407" y="481.62601" - style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;line-height:1.25;fill:#000000" - id="flowPara10048-9-0">Top padding</flowPara></flowRoot> <flowRoot + style="font-size:17.5px;fill:#0055d4" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#0055d4" + id="flowPara10048-9-0">Top</flowPara><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#0055d4" + id="flowPara4830">padding</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5-9" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,459.4147,204.33375)"><flowRegion - id="flowRegion4140-6-6-4-6-3"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,398.1404,59.190638)"><flowRegion + id="flowRegion4140-6-6-4-6-3" + style="fill:#0055d4"><rect id="rect4142-6-1-4-2-6" width="81.109558" height="93.762154" x="42.426407" y="481.62601" - style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000" + style="font-size:17.5px;fill:#0055d4" /></flowRegion><flowPara + style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#0055d4" id="flowPara4386">Right padding</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5-9-2" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,-38.128181,202.36202)"><flowRegion - id="flowRegion4140-6-6-4-6-3-5"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,-40.826553,147.13311)"><flowRegion + id="flowRegion4140-6-6-4-6-3-5" + style="fill:#0055d4"><rect id="rect4142-6-1-4-2-6-4" width="81.109558" height="93.762154" x="42.426407" y="481.62601" - style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.02554321px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000" - id="flowPara4386-0">Left padding</flowPara></flowRoot> <rect - style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.09440184;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4757" - width="763.17505" - height="514.7428" - x="-116.41159" - y="243.5061" /> + style="font-size:17.5px;fill:#0055d4" /></flowRegion><flowPara + style="font-size:17.02554321px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#0055d4" + id="flowPara4386-0">Left padding</flowPara></flowRoot> <path + style="fill:#ff2a2a;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:0.87824047;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9-6);marker-end:url(#TriangleOutL-1-1)" + d="M 12.916178,287.96278 V 258.98852" + id="path4179-9-8" + inkscape:connector-curvature="0" /> + <path + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:0.87323481;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-5);marker-end:url(#TriangleOutL-9-4)" + d="M -25.470947,298.58445 H 3.5629489" + id="path4179-7-8" + inkscape:connector-curvature="0" /> <flowRoot xml:space="preserve" - id="flowRoot4138-6-3-4" - style="font-style:normal;font-weight:normal;font-size:59.99999619px;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,175.59116,-90.52439)"><flowRegion - id="flowRegion4140-6-67-2" - style="font-size:59.99999619px"><rect - id="rect4142-6-5-4" - width="334.36047" - height="80.812172" + id="flowRoot4138-6-2-7-5-1-5" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,-12.104603,-28.000512)"><flowRegion + id="flowRegion4140-6-6-4-6-2-9" + style="fill:#ff2a2a"><rect + id="rect4142-6-1-4-2-7-7" + width="66.476036" + height="55.080368" x="42.426407" y="481.62601" - style="font-size:59.99999619px;fill:#000000" /></flowRegion><flowPara - id="flowPara4146-6-3-0" - style="font-size:54.09472656px;line-height:1.25">Window</flowPara></flowRoot> <g - id="g5624" - transform="translate(0,116.25)"> - <path - sodipodi:nodetypes="cc" - inkscape:connector-curvature="0" - id="path4179-98" - d="M 562.38606,632.48202 V 575.7366" - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.04880464;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-7);marker-end:url(#TriangleOutL-4)" /> - <flowRoot - transform="matrix(0.6007979,0,0,0.6007979,549.95467,303.47098)" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - id="flowRoot4138-6-2-7-5-9-1" - xml:space="preserve"><flowRegion - id="flowRegion4140-6-6-4-6-3-2"><rect - style="font-size:17.5px;fill:#000000" - y="481.62601" - x="42.426407" - height="93.762154" - width="81.109558" - id="rect4142-6-1-4-2-6-9" /></flowRegion><flowPara - id="flowPara5598" - style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000">Bottom margin</flowPara></flowRoot> </g> - <g - id="g5669" - transform="translate(-9.0164,-96.197039)"> - <path - sodipodi:nodetypes="cc" - inkscape:connector-curvature="0" - id="path4179-98-8" - d="M 571.40246,409.73194 V 352.98652" - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.04880464;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-7-1);marker-end:url(#TriangleOutL-4-3)" /> - <flowRoot - transform="matrix(0.6007979,0,0,0.6007979,558.97106,80.720903)" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - id="flowRoot4138-6-2-7-5-9-1-8" - xml:space="preserve"><flowRegion - id="flowRegion4140-6-6-4-6-3-2-8"><rect - style="font-size:17.5px;fill:#000000" - y="481.62601" - x="42.426407" - height="93.762154" - width="81.109558" - id="rect4142-6-1-4-2-6-9-2" /></flowRegion><flowPara - id="flowPara5598-6" - style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000">Top margin</flowPara></flowRoot> </g> - <g - id="g7367" - transform="translate(32.877167,129.04286)"> - <path - transform="translate(-32.87717,-4.3906312)" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.93839908;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-4);marker-end:url(#TriangleOutL-9-3)" - d="m 558.40434,364.18736 h 70.4038" - id="path4179-7-5" - inkscape:connector-curvature="0" - sodipodi:nodetypes="cc" /> - <flowRoot - transform="matrix(0.6007979,0,0,0.6007979,510.85405,81.658403)" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - id="flowRoot4138-6-2-7-5-9-1-8-0" - xml:space="preserve"><flowRegion - id="flowRegion4140-6-6-4-6-3-2-8-5"><rect - style="font-size:17.5px;fill:#000000" - y="481.62601" - x="42.426407" - height="93.762154" - width="81.109558" - id="rect4142-6-1-4-2-6-9-2-6" /></flowRegion><flowPara - id="flowPara5598-6-1" - style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000">Right margin</flowPara></flowRoot> </g> + style="font-size:17.5px;fill:#ff2a2a" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#ff2a2a" + id="flowPara11237">Top inset</flowPara></flowRoot> <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-9-2-3" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,-59.558586,16.047754)"><flowRegion + id="flowRegion4140-6-6-4-6-3-5-8" + style="fill:#ff2a2a"><rect + id="rect4142-6-1-4-2-6-4-8" + width="75.759529" + height="93.167732" + x="42.426407" + y="481.62601" + style="font-size:17.5px;fill:#ff2a2a" /></flowRegion><flowPara + style="font-size:17.02554321px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#ff2a2a" + id="flowPara4386-0-3">Left inset</flowPara></flowRoot> <path + style="fill:#0055d4;fill-rule:evenodd;stroke:#0055d4;stroke-width:0.97500122;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-1);marker-end:url(#TriangleOutL-96)" + d="M 402.28756,327.38769 V 259.50991" + id="path4179-3" + inkscape:connector-curvature="0" /> <path - sodipodi:nodetypes="cc" - inkscape:connector-curvature="0" - id="path4179-7-5-2" - d="m -96.90814,305.30865 h 70.4038" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.93839908;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-4-7);marker-end:url(#TriangleOutL-9-3-6)" /> + style="fill:#ff2a2a;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:0.87794411;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9-6-4);marker-end:url(#TriangleOutL-1-1-6)" + d="M 444.22783,546.94146 V 517.98675" + id="path4179-9-8-9" + inkscape:connector-curvature="0" /> <flowRoot xml:space="preserve" - id="flowRoot4138-6-2-7-5-9-1-8-0-4" - style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,-111.58126,-21.57968)"><flowRegion - id="flowRegion4140-6-6-4-6-3-2-8-5-3"><rect - id="rect4142-6-1-4-2-6-9-2-6-0" - width="81.109558" - height="93.762154" + id="flowRoot4138-6-2-7-5-1-5-0" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,364.36984,230.98794)"><flowRegion + id="flowRegion4140-6-6-4-6-2-9-6" + style="fill:#ff2a2a"><rect + id="rect4142-6-1-4-2-7-7-8" + width="91.442841" + height="44.974762" x="42.426407" y="481.62601" - style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000" - id="flowPara5598-6-1-4">Left margin</flowPara></flowRoot> </g> + style="font-size:17.5px;fill:#ff2a2a" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;text-align:center;text-anchor:middle;fill:#ff2a2a" + id="flowPara11237-7">Bottom inset</flowPara></flowRoot> <path + style="fill:#ff2a2a;fill-opacity:1;fill-rule:evenodd;stroke:#ff2a2a;stroke-width:0.87314719;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-5-6);marker-end:url(#TriangleOutL-9-4-8)" + d="m 453.47561,508.6218 h 29.02808" + id="path4179-7-8-6" + inkscape:connector-curvature="0" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-9-2-3-0" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,419.24022,186.32002)"><flowRegion + id="flowRegion4140-6-6-4-6-3-5-8-7" + style="fill:#ff2a2a"><rect + id="rect4142-6-1-4-2-6-4-8-0" + width="75.759529" + height="93.167732" + x="42.426407" + y="481.62601" + style="font-size:17.5px;fill:#ff2a2a" /></flowRegion><flowPara + style="font-size:17.02554321px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#ff2a2a" + id="flowPara3807">Right inset</flowPara></flowRoot> <path + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.05938387;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-5-6-9);marker-end:url(#TriangleOutL-9-4-8-4)" + d="m 414.52522,338.31524 h 66.93934" + id="path4179-7-8-6-0" + inkscape:connector-curvature="0" /> + <path + style="fill:#0055d4;fill-rule:evenodd;stroke:#0055d4;stroke-width:0.97513783;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-1-7);marker-end:url(#TriangleOutL-96-7)" + d="M 54.589106,546.37854 V 478.48175" + id="path4179-3-9" + inkscape:connector-curvature="0" /> + <path + style="fill:#0055d4;fill-opacity:1;fill-rule:evenodd;stroke:#0055d4;stroke-width:1.05900466;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-5-6-9-1);marker-end:url(#TriangleOutL-9-4-8-4-0)" + d="M -24.417773,466.88667 H 42.473651" + id="path4179-7-8-6-0-0" + inkscape:connector-curvature="0" /> + </g> </svg> diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-material-variant.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-material-variant.qml new file mode 100644 index 00000000..fc2be179 --- /dev/null +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-material-variant.qml @@ -0,0 +1,212 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.11 +import QtQuick.Controls 2.4 +import QtQuick.Controls.Material 2.4 +import QtQuick.Layouts 1.3 + +Pane { + implicitWidth: 400 + implicitHeight: 600 + padding: 10 + + readonly property color measurementColor: "darkorange" + readonly property int barLeftMargin: 10 + readonly property int textTopMargin: 12 + + Component { + id: measurementComponent + + Rectangle { + color: measurementColor + width: 1 + height: parent.height + + Rectangle { + width: 5 + height: 1 + color: measurementColor + anchors.horizontalCenter: parent.horizontalCenter + } + + Rectangle { + width: 5 + height: 1 + color: measurementColor + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + } + + Text { + x: 8 + text: parent.height + height: parent.height + color: measurementColor + verticalAlignment: Text.AlignVCenter + } + } + } + + ColumnLayout { + anchors.fill: parent + spacing: 20 + + ColumnLayout { + spacing: textTopMargin + + Button { + id: button + text: qsTr("Button") + + Loader { + sourceComponent: measurementComponent + height: parent.height + anchors.left: parent.right + anchors.leftMargin: barLeftMargin + } + + } + Text { + text: "Roboto " + button.font.pixelSize + color: measurementColor + } + } + + ColumnLayout { + spacing: textTopMargin + + ItemDelegate { + id: itemDelegate + text: qsTr("ItemDelegate") + + Loader { + sourceComponent: measurementComponent + height: parent.height + anchors.left: parent.right + anchors.leftMargin: barLeftMargin + } + + } + Text { + text: "Roboto " + itemDelegate.font.pixelSize + color: measurementColor + } + } + + ColumnLayout { + spacing: textTopMargin + + CheckDelegate { + id: checkDelegate + text: qsTr("CheckDelegate") + + Loader { + sourceComponent: measurementComponent + height: parent.height + anchors.left: parent.right + anchors.leftMargin: barLeftMargin + } + + } + Text { + text: "Roboto " + checkDelegate.font.pixelSize + color: measurementColor + } + } + + ColumnLayout { + spacing: textTopMargin + + RadioDelegate { + id: radioDelegate + text: qsTr("RadioDelegate") + + Loader { + sourceComponent: measurementComponent + height: parent.height + anchors.left: parent.right + anchors.leftMargin: barLeftMargin + } + + } + Text { + text: "Roboto " + radioDelegate.font.pixelSize + color: measurementColor + } + } + + ColumnLayout { + spacing: textTopMargin + + ComboBox { + id: comboBox + model: [ qsTr("ComboBox") ] + + Loader { + sourceComponent: measurementComponent + height: parent.height + anchors.left: parent.right + anchors.leftMargin: barLeftMargin + } + + } + Text { + text: "Roboto " + comboBox.font.pixelSize + color: measurementColor + } + } + + ColumnLayout { + spacing: textTopMargin + + Item { + implicitWidth: groupBox.implicitWidth + implicitHeight: groupBox.implicitHeight + + GroupBox { + id: groupBox + title: qsTr("GroupBox") + } + Loader { + sourceComponent: measurementComponent + height: parent.height + anchors.left: parent.right + anchors.leftMargin: barLeftMargin + } + } + Text { + text: "Roboto " + groupBox.font.pixelSize + color: measurementColor + } + } + + Item { + Layout.fillHeight: true + } + } +} diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-popup.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-popup.qml new file mode 100644 index 00000000..593058c6 --- /dev/null +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-popup.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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 The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.5 + +Item { +//! [centerIn] +ApplicationWindow { + id: window + // ... + + Pane { + // ... + + Popup { + anchors.centerIn: Overlay.overlay + } + } +} +//! [centerIn] +} diff --git a/src/imports/controls/doc/src/includes/qquickdial.qdocinc b/src/imports/controls/doc/src/includes/qquickdial.qdocinc new file mode 100644 index 00000000..3370b3d8 --- /dev/null +++ b/src/imports/controls/doc/src/includes/qquickdial.qdocinc @@ -0,0 +1,13 @@ +//! [inputMode] +Dial supports three \l {inputMode}{input modes}: \c Dial.Circular, +\c Dial.Horizontal and \c Dial.Vertical. The circular input mode operates on an +absolute input system, where the position of the cursor within the dial +directly reflects its value. The horizontal and vertical input modes use a +relative input system, where changes in the cursor's position are "added" to +the value of the dial. + +The following image illustrates the directions in which the various input modes +track movement: + +\image qtquickcontrols2-dial-inputmode.png +//! [inputMode] diff --git a/src/imports/controls/doc/src/includes/qquickmaterialstyle.qdocinc b/src/imports/controls/doc/src/includes/qquickmaterialstyle.qdocinc index c5d94279..72c97bb6 100644 --- a/src/imports/controls/doc/src/includes/qquickmaterialstyle.qdocinc +++ b/src/imports/controls/doc/src/includes/qquickmaterialstyle.qdocinc @@ -8,6 +8,14 @@ \li Specifies the default \l {material-theme-attached-prop}{Material theme}. The value can be one of the available themes, for example \c "Dark". \row + \li \c Variant + \li Specifies the Material variant. The Material Design has two + variants: a normal variant designed for touch devices, and a dense + variant for desktop. The dense variant uses smaller sizes for + controls and their fonts. + + The value can be \c "Normal" or \c "Dense". + \row \li \c Accent \li Specifies the default \l {material-accent-attached-prop}{Material accent color}. The value can be any \l {colorbasictypedocs}{color}, but it is recommended to use @@ -40,6 +48,14 @@ \li Specifies the default \l {material-theme-attached-prop}{Material theme}. The value can be one of the available themes, for example \c "Dark". \row + \li \c QT_QUICK_CONTROLS_MATERIAL_VARIANT + \li Specifies the Material variant. The Material Design has two + variants: a normal variant designed for touch devices, and a dense + variant for desktop. The dense variant uses smaller sizes for + controls and their fonts. + + The value can be \c "Normal" or \c "Dense". + \row \li \c QT_QUICK_CONTROLS_MATERIAL_ACCENT \li Specifies the default \l {material-accent-attached-prop}{Material accent color}. The value can be any \l {colorbasictypedocs}{color}, but it is recommended to use diff --git a/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc index 7954bf68..f24f82a9 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc @@ -31,7 +31,7 @@ The Imagine Style is based on configurable image assets. \l{detailed-desc-imagine}{More...} - \styleimport {QtQuick.Controls.Imagine 2.4} {Qt 5.10} + \styleimport {QtQuick.Controls.Imagine 2.5} {Qt 5.10} \section1 Attached Properties diff --git a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc index 87b170c2..8e3a12e7 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc @@ -46,7 +46,7 @@ application using the following import statement in your \c {.qml} file: \code - import QtQuick.Controls 2.4 + import QtQuick.Controls 2.5 \endcode The \l{Qt Quick Controls 2 C++ Classes}{C++ classes} can be included into @@ -116,6 +116,11 @@ \li 2.4 \li 1.0 \row + \li 5.12 + \li 2.12 + \li 2.5 + \li 1.0 + \row \li ... \li ... \li ... diff --git a/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc index 71de6104..60cd586d 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc @@ -67,6 +67,16 @@ The dial is rotated by clicking and dragging, with the handle indicating the value of the dial. + For applications where fast input is important, the circular + \l {Dial::inputMode}{input mode} is useful, as clicking on the dial will + move it directly to that position. + + For applications where precise input is important, the horizontal and + vertical input modes are recommended, as these allow small adjustments to + be made relative to where the dial is clicked. These modes are also better + for dials where large jumps in values could be unsafe, such as a dial that + controls audio volume. + \b {See also} \l {Tumbler Control}. \section1 TextArea Control diff --git a/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc index d0bcf63a..fa7874e5 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc @@ -32,7 +32,7 @@ The Material Style is based on the Google Material Design Guidelines. \l{detailed-desc-material}{More...} - \styleimport {QtQuick.Controls.Material 2.4} {Qt 5.7} + \styleimport {QtQuick.Controls.Material 2.5} {Qt 5.7} \section1 Attached Properties @@ -222,6 +222,33 @@ \b {See also} \l {Default Style}, \l {Universal Style} + \section2 Variants + + The Material style also supports a dense variant, where controls like + buttons and delegates are smaller in height and use smaller font sizes. + It is recommended to use the dense variant on desktop platforms, where + a mouse and keyboard allow more precise and flexible user interaction. + + To use the dense variant, either set the + \c QT_QUICK_CONTROLS_MATERIAL_VARIANT environment variable to \c Dense, + or specify \c Variant=Dense in the + \l {Qt Quick Controls 2 Configuration File}{qtquickcontrols2.conf} file. + The default value in both cases is \c Normal. + + The following images illustrate the differences between some of the + controls when using the normal and dense variants: + + \table + \row + \li + \image qtquickcontrols2-material-variant-normal.png + \li + \image qtquickcontrols2-material-variant-dense.png + \endtable + + Note that the heights shown above may vary based on differences in fonts + across platforms. + \section1 Attached Property Documentation \styleproperty {Material.accent} {color} {material-accent-attached-prop} diff --git a/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc index d4576617..6ebe2fe9 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \qmlmodule QtQuick.Controls 2.4 + \qmlmodule QtQuick.Controls 2.5 \title Qt Quick Controls 2 QML Types \ingroup qmlmodules \brief Provides QML types for user interfaces (Qt Quick Controls 2). @@ -39,7 +39,7 @@ using the following import statement in your .qml file: \badcode - import QtQuick.Controls 2.4 + import QtQuick.Controls 2.5 \endcode \section1 QML Types diff --git a/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc index abd027e4..80bf9ef7 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc @@ -32,7 +32,7 @@ The Universal Style is based on the Microsoft Universal Design Guidelines. \l {detailed-desc-universal}{More...} - \styleimport {QtQuick.Controls.Universal 2.4} {Qt 5.7} + \styleimport {QtQuick.Controls.Universal 2.5} {Qt 5.7} \section1 Attached Properties diff --git a/src/imports/controls/fusion/ApplicationWindow.qml b/src/imports/controls/fusion/ApplicationWindow.qml index 570d84b4..6abe832f 100644 --- a/src/imports/controls/fusion/ApplicationWindow.qml +++ b/src/imports/controls/fusion/ApplicationWindow.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.2 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.ApplicationWindow { id: window diff --git a/src/imports/controls/fusion/BusyIndicator.qml b/src/imports/controls/fusion/BusyIndicator.qml index cba5fc2e..7afff2df 100644 --- a/src/imports/controls/fusion/BusyIndicator.qml +++ b/src/imports/controls/fusion/BusyIndicator.qml @@ -34,18 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.BusyIndicator { id: control - implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding - implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/fusion/Button.qml b/src/imports/controls/fusion/Button.qml index d33544ae..ca6d81a9 100644 --- a/src/imports/controls/fusion/Button.qml +++ b/src/imports/controls/fusion/Button.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Button { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 4 spacing: 6 diff --git a/src/imports/controls/fusion/ButtonPanel.qml b/src/imports/controls/fusion/ButtonPanel.qml index b1672bf0..fc1af2de 100644 --- a/src/imports/controls/fusion/ButtonPanel.qml +++ b/src/imports/controls/fusion/ButtonPanel.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 Rectangle { id: panel diff --git a/src/imports/controls/fusion/CheckBox.qml b/src/imports/controls/fusion/CheckBox.qml index 4a10238d..9b9dba18 100644 --- a/src/imports/controls/fusion/CheckBox.qml +++ b/src/imports/controls/fusion/CheckBox.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.CheckBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/CheckDelegate.qml b/src/imports/controls/fusion/CheckDelegate.qml index 9c6b97ff..40f68164 100644 --- a/src/imports/controls/fusion/CheckDelegate.qml +++ b/src/imports/controls/fusion/CheckDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.CheckDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/CheckIndicator.qml b/src/imports/controls/fusion/CheckIndicator.qml index 5a5837ae..8c49e6b2 100644 --- a/src/imports/controls/fusion/CheckIndicator.qml +++ b/src/imports/controls/fusion/CheckIndicator.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 Rectangle { id: indicator diff --git a/src/imports/controls/fusion/ComboBox.qml b/src/imports/controls/fusion/ComboBox.qml index bc232759..cafbdb02 100644 --- a/src/imports/controls/fusion/ComboBox.qml +++ b/src/imports/controls/fusion/ComboBox.qml @@ -34,23 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.3 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.ComboBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) diff --git a/src/imports/controls/fusion/DelayButton.qml b/src/imports/controls/fusion/DelayButton.qml index 261db320..c150bb2e 100644 --- a/src/imports/controls/fusion/DelayButton.qml +++ b/src/imports/controls/fusion/DelayButton.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.DelayButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/fusion/Dial.qml b/src/imports/controls/fusion/Dial.qml index c9ed0c68..fb248d5e 100644 --- a/src/imports/controls/fusion/Dial.qml +++ b/src/imports/controls/fusion/Dial.qml @@ -34,20 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Dial { id: control - implicitWidth: 100 - implicitHeight: 100 + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) || 100 // ### remove 100 in Qt 6 + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) || 100 // ### remove 100 in Qt 6 background: DialImpl { + implicitWidth: 100 + implicitHeight: 100 palette: control.palette highlight: control.visualFocus } diff --git a/src/imports/controls/fusion/Dialog.qml b/src/imports/controls/fusion/Dialog.qml index 4e43b038..a079d09f 100644 --- a/src/imports/controls/fusion/Dialog.qml +++ b/src/imports/controls/fusion/Dialog.qml @@ -34,27 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Dialog { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - header && header.visible ? header.implicitWidth : 0, - footer && footer.visible ? footer.implicitWidth : 0, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (header && header.visible ? header.implicitHeight + spacing : 0) - + (footer && footer.visible ? footer.implicitHeight + spacing : 0) - + (contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0)) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) padding: 6 diff --git a/src/imports/controls/fusion/DialogButtonBox.qml b/src/imports/controls/fusion/DialogButtonBox.qml index 5d30c329..49446c31 100644 --- a/src/imports/controls/fusion/DialogButtonBox.qml +++ b/src/imports/controls/fusion/DialogButtonBox.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.DialogButtonBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) spacing: 6 padding: 6 @@ -56,9 +56,6 @@ T.DialogButtonBox { delegate: Button { } contentItem: ListView { - implicitWidth: contentWidth - implicitHeight: 24 - model: control.contentModel spacing: control.spacing orientation: ListView.Horizontal diff --git a/src/imports/controls/fusion/Drawer.qml b/src/imports/controls/fusion/Drawer.qml index 711040a2..f0ee0200 100644 --- a/src/imports/controls/fusion/Drawer.qml +++ b/src/imports/controls/fusion/Drawer.qml @@ -34,23 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Drawer { id: control parent: T.Overlay.overlay - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: control.edge === Qt.BottomEdge leftPadding: control.edge === Qt.RightEdge diff --git a/src/imports/controls/fusion/Frame.qml b/src/imports/controls/fusion/Frame.qml index 4acce74a..ffe816b4 100644 --- a/src/imports/controls/fusion/Frame.qml +++ b/src/imports/controls/fusion/Frame.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Frame { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 9 diff --git a/src/imports/controls/fusion/GroupBox.qml b/src/imports/controls/fusion/GroupBox.qml index 439783ac..11372556 100644 --- a/src/imports/controls/fusion/GroupBox.qml +++ b/src/imports/controls/fusion/GroupBox.qml @@ -34,27 +34,25 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.GroupBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - label ? label.implicitWidth + leftPadding + rightPadding : 0, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitLabelWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) spacing: 6 padding: 9 - topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0) + topPadding: padding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0) label: Text { x: control.leftPadding diff --git a/src/imports/controls/fusion/ItemDelegate.qml b/src/imports/controls/fusion/ItemDelegate.qml index 0936c7c2..407078dd 100644 --- a/src/imports/controls/fusion/ItemDelegate.qml +++ b/src/imports/controls/fusion/ItemDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.ItemDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/Label.qml b/src/imports/controls/fusion/Label.qml index 1c6951c2..23e337e2 100644 --- a/src/imports/controls/fusion/Label.qml +++ b/src/imports/controls/fusion/Label.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Label { id: control diff --git a/src/imports/controls/fusion/Menu.qml b/src/imports/controls/fusion/Menu.qml index 3c9d98a2..fd64ed45 100644 --- a/src/imports/controls/fusion/Menu.qml +++ b/src/imports/controls/fusion/Menu.qml @@ -34,21 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 -import QtQuick.Window 2.11 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 +import QtQuick.Window 2.12 T.Menu { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) margins: 0 padding: 1 diff --git a/src/imports/controls/fusion/MenuBar.qml b/src/imports/controls/fusion/MenuBar.qml index d1530d75..81aaf9b5 100644 --- a/src/imports/controls/fusion/MenuBar.qml +++ b/src/imports/controls/fusion/MenuBar.qml @@ -34,19 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.MenuBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) delegate: MenuBarItem { } diff --git a/src/imports/controls/fusion/MenuBarItem.qml b/src/imports/controls/fusion/MenuBarItem.qml index 2b4425a9..85330a73 100644 --- a/src/imports/controls/fusion/MenuBarItem.qml +++ b/src/imports/controls/fusion/MenuBarItem.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.MenuBarItem { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/MenuItem.qml b/src/imports/controls/fusion/MenuItem.qml index 35d7248f..b8ebd5e6 100644 --- a/src/imports/controls/fusion/MenuItem.qml +++ b/src/imports/controls/fusion/MenuItem.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.MenuItem { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/MenuSeparator.qml b/src/imports/controls/fusion/MenuSeparator.qml index a426c0fe..904a15ef 100644 --- a/src/imports/controls/fusion/MenuSeparator.qml +++ b/src/imports/controls/fusion/MenuSeparator.qml @@ -34,22 +34,23 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.MenuSeparator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 5 - topPadding: 1 - bottomPadding: 1 + verticalPadding: 1 contentItem: Rectangle { implicitWidth: 188 diff --git a/src/imports/controls/fusion/Page.qml b/src/imports/controls/fusion/Page.qml index 842db2d0..13f92c7a 100644 --- a/src/imports/controls/fusion/Page.qml +++ b/src/imports/controls/fusion/Page.qml @@ -34,27 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Page { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding, - header && header.visible ? header.implicitWidth : 0, - footer && footer.visible ? footer.implicitWidth : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding - + (header && header.visible ? header.implicitHeight + spacing : 0) - + (footer && footer.visible ? footer.implicitHeight + spacing : 0)) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) background: Rectangle { color: palette.window diff --git a/src/imports/controls/fusion/PageIndicator.qml b/src/imports/controls/fusion/PageIndicator.qml index 39d28ca2..fb3a5b89 100644 --- a/src/imports/controls/fusion/PageIndicator.qml +++ b/src/imports/controls/fusion/PageIndicator.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.PageIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 4 spacing: 4 diff --git a/src/imports/controls/fusion/Pane.qml b/src/imports/controls/fusion/Pane.qml index 59c65cd9..53d51bf7 100644 --- a/src/imports/controls/fusion/Pane.qml +++ b/src/imports/controls/fusion/Pane.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Pane { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 9 diff --git a/src/imports/controls/fusion/Popup.qml b/src/imports/controls/fusion/Popup.qml index 319e5b8a..93c7afd3 100644 --- a/src/imports/controls/fusion/Popup.qml +++ b/src/imports/controls/fusion/Popup.qml @@ -34,23 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Popup { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/fusion/ProgressBar.qml b/src/imports/controls/fusion/ProgressBar.qml index 547d5f7c..4e31d611 100644 --- a/src/imports/controls/fusion/ProgressBar.qml +++ b/src/imports/controls/fusion/ProgressBar.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.ProgressBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem ? contentItem.implicitHeight + topPadding + bottomPadding : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) contentItem: Item { implicitWidth: 120 diff --git a/src/imports/controls/fusion/RadioButton.qml b/src/imports/controls/fusion/RadioButton.qml index 612319b4..ef574201 100644 --- a/src/imports/controls/fusion/RadioButton.qml +++ b/src/imports/controls/fusion/RadioButton.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.RadioButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/RadioDelegate.qml b/src/imports/controls/fusion/RadioDelegate.qml index f5f57071..ddcb1217 100644 --- a/src/imports/controls/fusion/RadioDelegate.qml +++ b/src/imports/controls/fusion/RadioDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.RadioDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/RadioIndicator.qml b/src/imports/controls/fusion/RadioIndicator.qml index d3d40c11..790a5e24 100644 --- a/src/imports/controls/fusion/RadioIndicator.qml +++ b/src/imports/controls/fusion/RadioIndicator.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 Rectangle { id: indicator diff --git a/src/imports/controls/fusion/RangeSlider.qml b/src/imports/controls/fusion/RangeSlider.qml index 260c21cf..17f4c62b 100644 --- a/src/imports/controls/fusion/RangeSlider.qml +++ b/src/imports/controls/fusion/RangeSlider.qml @@ -34,22 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.RangeSlider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(first.handle ? first.handle.implicitWidth : 0, - second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(first.handle ? first.handle.implicitHeight : 0, - second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + Math.max(first.implicitHandleWidth, + second.implicitHandleWidth) + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + Math.max(first.implicitHandleHeight, + second.implicitHandleHeight) + topPadding + bottomPadding) first.handle: SliderHandle { x: control.leftPadding + Math.round(control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) diff --git a/src/imports/controls/fusion/RoundButton.qml b/src/imports/controls/fusion/RoundButton.qml index 5d28b52c..a38d123f 100644 --- a/src/imports/controls/fusion/RoundButton.qml +++ b/src/imports/controls/fusion/RoundButton.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.RoundButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/ScrollBar.qml b/src/imports/controls/fusion/ScrollBar.qml index 25881d2d..154f540b 100644 --- a/src/imports/controls/fusion/ScrollBar.qml +++ b/src/imports/controls/fusion/ScrollBar.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.ScrollBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 2 visible: control.policy !== T.ScrollBar.AlwaysOff diff --git a/src/imports/controls/fusion/ScrollIndicator.qml b/src/imports/controls/fusion/ScrollIndicator.qml index 7d6372a3..3f8668c5 100644 --- a/src/imports/controls/fusion/ScrollIndicator.qml +++ b/src/imports/controls/fusion/ScrollIndicator.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.ScrollIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 2 diff --git a/src/imports/controls/fusion/ScrollView.qml b/src/imports/controls/fusion/ScrollView.qml deleted file mode 100644 index 5cbd170a..00000000 --- a/src/imports/controls/fusion/ScrollView.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** 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 The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/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 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later 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 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 - -T.ScrollView { - id: control - - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : -1) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : -1) - - ScrollBar.vertical: ScrollBar { - parent: control - x: control.mirrored ? 0 : control.width - width - y: control.topPadding - height: control.availableHeight - active: control.ScrollBar.horizontal.active - } - - ScrollBar.horizontal: ScrollBar { - parent: control - x: control.leftPadding - y: control.height - height - width: control.availableWidth - active: control.ScrollBar.vertical.active - } -} diff --git a/src/imports/controls/fusion/Slider.qml b/src/imports/controls/fusion/Slider.qml index a4d28fe5..67ee73cc 100644 --- a/src/imports/controls/fusion/Slider.qml +++ b/src/imports/controls/fusion/Slider.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Slider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitHandleHeight + topPadding + bottomPadding) handle: SliderHandle { x: control.leftPadding + Math.round(control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) diff --git a/src/imports/controls/fusion/SliderGroove.qml b/src/imports/controls/fusion/SliderGroove.qml index cd90bd54..678ac8c2 100644 --- a/src/imports/controls/fusion/SliderGroove.qml +++ b/src/imports/controls/fusion/SliderGroove.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 Rectangle { id: groove diff --git a/src/imports/controls/fusion/SliderHandle.qml b/src/imports/controls/fusion/SliderHandle.qml index 5ea2dd03..9bfa45a1 100644 --- a/src/imports/controls/fusion/SliderHandle.qml +++ b/src/imports/controls/fusion/SliderHandle.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 Rectangle { id: handle diff --git a/src/imports/controls/fusion/SpinBox.qml b/src/imports/controls/fusion/SpinBox.qml index 9d975fa8..5ef01d8f 100644 --- a/src/imports/controls/fusion/SpinBox.qml +++ b/src/imports/controls/fusion/SpinBox.qml @@ -34,25 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.SpinBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentItem.implicitWidth + 2 * padding + - Math.max(up.indicator ? up.indicator.implicitWidth : 0, - down.indicator ? down.indicator.implicitWidth : 0)) - implicitHeight: Math.max(contentItem.implicitHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, - (up.indicator ? up.indicator.implicitHeight : 0 + - down.indicator ? down.indicator.implicitHeight : 0)) - baselineOffset: contentItem.y + contentItem.baselineOffset + Math.max(up.implicitIndicatorWidth, + down.implicitIndicatorWidth)) + implicitHeight: Math.max(implicitContentHeight + topPadding + bottomPadding, + implicitBackgroundHeight, + up.implicitIndicatorHeight + + down.implicitIndicatorHeight) padding: 4 leftPadding: padding + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0)) diff --git a/src/imports/controls/fusion/SwipeDelegate.qml b/src/imports/controls/fusion/SwipeDelegate.qml index 0704f5b3..c5de54a8 100644 --- a/src/imports/controls/fusion/SwipeDelegate.qml +++ b/src/imports/controls/fusion/SwipeDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.SwipeDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/Switch.qml b/src/imports/controls/fusion/Switch.qml index 0f5d484b..6406ba64 100644 --- a/src/imports/controls/fusion/Switch.qml +++ b/src/imports/controls/fusion/Switch.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Switch { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/SwitchDelegate.qml b/src/imports/controls/fusion/SwitchDelegate.qml index 4a09ba25..6f07731e 100644 --- a/src/imports/controls/fusion/SwitchDelegate.qml +++ b/src/imports/controls/fusion/SwitchDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.SwitchDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/SwitchIndicator.qml b/src/imports/controls/fusion/SwitchIndicator.qml index 22430dc3..7948a794 100644 --- a/src/imports/controls/fusion/SwitchIndicator.qml +++ b/src/imports/controls/fusion/SwitchIndicator.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 Rectangle { id: indicator diff --git a/src/imports/controls/fusion/TabBar.qml b/src/imports/controls/fusion/TabBar.qml index d6f3194b..3797e573 100644 --- a/src/imports/controls/fusion/TabBar.qml +++ b/src/imports/controls/fusion/TabBar.qml @@ -34,19 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.TabBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) spacing: -1 diff --git a/src/imports/controls/fusion/TabButton.qml b/src/imports/controls/fusion/TabButton.qml index bdcee759..201e7763 100644 --- a/src/imports/controls/fusion/TabButton.qml +++ b/src/imports/controls/fusion/TabButton.qml @@ -34,25 +34,23 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.TabButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 2 - leftPadding: 4 - rightPadding: 4 + horizontalPadding: 4 spacing: 6 icon.width: 16 diff --git a/src/imports/controls/fusion/TextArea.qml b/src/imports/controls/fusion/TextArea.qml index 9165116c..d2469d28 100644 --- a/src/imports/controls/fusion/TextArea.qml +++ b/src/imports/controls/fusion/TextArea.qml @@ -34,21 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.TextArea { id: control implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, - background ? background.implicitWidth : 0, + implicitBackgroundWidth + leftInset + rightInset, placeholder.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, + implicitBackgroundHeight + topInset + bottomInset, placeholder.implicitHeight + topPadding + bottomPadding) padding: 6 @@ -57,6 +57,7 @@ T.TextArea { color: control.palette.text selectionColor: control.palette.highlight selectedTextColor: control.palette.highlightedText + placeholderTextColor: Color.transparent(control.color, 0.5) PlaceholderText { id: placeholder @@ -65,10 +66,9 @@ T.TextArea { width: control.width - (control.leftPadding + control.rightPadding) height: control.height - (control.topPadding + control.bottomPadding) - opacity: 0.5 text: control.placeholderText font: control.font - color: control.color + color: control.placeholderTextColor verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight diff --git a/src/imports/controls/fusion/TextField.qml b/src/imports/controls/fusion/TextField.qml index 7b8984d2..6f5f49b3 100644 --- a/src/imports/controls/fusion/TextField.qml +++ b/src/imports/controls/fusion/TextField.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.TextField { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0) - || contentWidth + leftPadding + rightPadding - implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, + implicitWidth: implicitBackgroundWidth + leftInset + rightInset + || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding, placeholder.implicitHeight + topPadding + bottomPadding) padding: 4 @@ -56,6 +55,7 @@ T.TextField { color: control.palette.text selectionColor: control.palette.highlight selectedTextColor: control.palette.highlightedText + placeholderTextColor: Color.transparent(control.color, 0.5) verticalAlignment: TextInput.AlignVCenter PlaceholderText { @@ -65,10 +65,9 @@ T.TextField { width: control.width - (control.leftPadding + control.rightPadding) height: control.height - (control.topPadding + control.bottomPadding) - opacity: 0.5 text: control.placeholderText font: control.font - color: control.color + color: control.placeholderTextColor verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight diff --git a/src/imports/controls/fusion/ToolBar.qml b/src/imports/controls/fusion/ToolBar.qml index ab272517..d569899d 100644 --- a/src/imports/controls/fusion/ToolBar.qml +++ b/src/imports/controls/fusion/ToolBar.qml @@ -34,24 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.ToolBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) - - leftPadding: 6 - rightPadding: 6 + horizontalPadding: 6 topPadding: control.position === T.ToolBar.Footer ? 1 : 0 bottomPadding: control.position === T.ToolBar.Header ? 1 : 0 diff --git a/src/imports/controls/fusion/ToolButton.qml b/src/imports/controls/fusion/ToolButton.qml index dc3c9663..f198a18b 100644 --- a/src/imports/controls/fusion/ToolButton.qml +++ b/src/imports/controls/fusion/ToolButton.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.ToolButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/fusion/ToolSeparator.qml b/src/imports/controls/fusion/ToolSeparator.qml index fd10dd72..f8047b81 100644 --- a/src/imports/controls/fusion/ToolSeparator.qml +++ b/src/imports/controls/fusion/ToolSeparator.qml @@ -34,22 +34,23 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.ToolSeparator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: vertical ? 6 : 2 - topPadding: vertical ? 2 : 6 - bottomPadding: vertical ? 2 : 6 + verticalPadding: vertical ? 2 : 6 contentItem: Rectangle { implicitWidth: vertical ? 2 : 8 diff --git a/src/imports/controls/fusion/ToolTip.qml b/src/imports/controls/fusion/ToolTip.qml index 2b404a5e..922789dd 100644 --- a/src/imports/controls/fusion/ToolTip.qml +++ b/src/imports/controls/fusion/ToolTip.qml @@ -34,12 +34,12 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.ToolTip { id: control @@ -47,10 +47,10 @@ T.ToolTip { x: parent ? (parent.width - implicitWidth) / 2 : 0 y: -implicitHeight - 3 - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) margins: 6 padding: 6 diff --git a/src/imports/controls/fusion/Tumbler.qml b/src/imports/controls/fusion/Tumbler.qml index b66e4f2d..fd0d7ef3 100644 --- a/src/imports/controls/fusion/Tumbler.qml +++ b/src/imports/controls/fusion/Tumbler.qml @@ -34,17 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Fusion 2.4 -import QtQuick.Controls.Fusion.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Fusion 2.5 +import QtQuick.Controls.Fusion.impl 2.5 T.Tumbler { id: control - implicitWidth: 60 - implicitHeight: 200 + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) || 60 // ### remove 60 in Qt 6 + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) || 200 // ### remove 200 in Qt 6 delegate: Text { text: modelData @@ -56,6 +59,8 @@ T.Tumbler { } contentItem: TumblerView { + implicitWidth: 60 + implicitHeight: 200 model: control.model delegate: control.delegate path: Path { diff --git a/src/imports/controls/fusion/fusion.pri b/src/imports/controls/fusion/fusion.pri index 4a6e8fb4..c4493c09 100644 --- a/src/imports/controls/fusion/fusion.pri +++ b/src/imports/controls/fusion/fusion.pri @@ -47,7 +47,6 @@ QML_FILES += \ $$PWD/RoundButton.qml \ $$PWD/ScrollBar.qml \ $$PWD/ScrollIndicator.qml \ - $$PWD/ScrollView.qml \ $$PWD/Slider.qml \ $$PWD/SliderGroove.qml \ $$PWD/SliderHandle.qml \ diff --git a/src/imports/controls/fusion/fusion.pro b/src/imports/controls/fusion/fusion.pro index 2934778b..4bc9fcc1 100644 --- a/src/imports/controls/fusion/fusion.pro +++ b/src/imports/controls/fusion/fusion.pro @@ -1,6 +1,6 @@ TARGET = qtquickcontrols2fusionstyleplugin TARGETPATH = QtQuick/Controls.2/Fusion -IMPORT_VERSION = 2.4 +IMPORT_VERSION = 2.5 QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private @@ -19,7 +19,7 @@ SOURCES += \ RESOURCES += \ $$PWD/qtquickcontrols2fusionstyle.qrc -CONFIG += no_cxx_module +CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler load(qml_plugin) requires(qtConfig(quickcontrols2-fusion)) diff --git a/src/imports/controls/fusion/qmldir b/src/imports/controls/fusion/qmldir index 6857b398..b584adc8 100644 --- a/src/imports/controls/fusion/qmldir +++ b/src/imports/controls/fusion/qmldir @@ -1,4 +1,4 @@ module QtQuick.Controls.Fusion plugin qtquickcontrols2fusionstyleplugin classname QtQuickControls2FusionStylePlugin -depends QtQuick.Controls 2.4 +depends QtQuick.Controls 2.5 diff --git a/src/imports/controls/fusion/qquickfusiontheme.cpp b/src/imports/controls/fusion/qquickfusiontheme.cpp index 31494efb..ac88563a 100644 --- a/src/imports/controls/fusion/qquickfusiontheme.cpp +++ b/src/imports/controls/fusion/qquickfusiontheme.cpp @@ -36,11 +36,13 @@ #include "qquickfusiontheme_p.h" +#include <QtQuickTemplates2/private/qquicktheme_p.h> + QT_BEGIN_NAMESPACE -QQuickFusionTheme::QQuickFusionTheme() - : QQuickTheme(QStringLiteral("Fusion")) +void QQuickFusionTheme::initialize(QQuickTheme *theme) { + Q_UNUSED(theme); } QT_END_NAMESPACE diff --git a/src/imports/controls/fusion/qquickfusiontheme_p.h b/src/imports/controls/fusion/qquickfusiontheme_p.h index 5dcfcf61..814c1919 100644 --- a/src/imports/controls/fusion/qquickfusiontheme_p.h +++ b/src/imports/controls/fusion/qquickfusiontheme_p.h @@ -48,16 +48,16 @@ // We mean it. // -#include <QtCore/qvariant.h> -#include <QtGui/qpalette.h> -#include <QtQuickControls2/private/qquicktheme_p.h> +#include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE -class QQuickFusionTheme : public QQuickTheme +class QQuickTheme; + +class QQuickFusionTheme { public: - explicit QQuickFusionTheme(); + static void initialize(QQuickTheme *theme); }; QT_END_NAMESPACE diff --git a/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp b/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp index 542f088c..107b4a2d 100644 --- a/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp +++ b/src/imports/controls/fusion/qtquickcontrols2fusionstyleplugin.cpp @@ -43,14 +43,6 @@ #include "qquickfusionstyle_p.h" #include "qquickfusiontheme_p.h" -static inline void initResources() -{ - Q_INIT_RESOURCE(qtquickcontrols2fusionstyle); -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtQuick_Controls_2_Fusion); -#endif -} - QT_BEGIN_NAMESPACE static QObject *styleSingleton(QQmlEngine *engine, QJSEngine *scriptEngine) @@ -71,12 +63,11 @@ public: void registerTypes(const char *uri) override; QString name() const override; - QQuickProxyTheme *createTheme() const override; + void initializeTheme(QQuickTheme *theme) override; }; QtQuickControls2FusionStylePlugin::QtQuickControls2FusionStylePlugin(QObject *parent) : QQuickStylePlugin(parent) { - initResources(); } void QtQuickControls2FusionStylePlugin::registerTypes(const char *uri) @@ -93,22 +84,22 @@ void QtQuickControls2FusionStylePlugin::registerTypes(const char *uri) qmlRegisterType<QQuickFusionDial>(import, 2, 3, "DialImpl"); qmlRegisterType<QQuickFusionKnob>(import, 2, 3, "KnobImpl"); - qmlRegisterType(typeUrl(QStringLiteral("ButtonPanel.qml")), import, 2, 3, "ButtonPanel"); - qmlRegisterType(typeUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 3, "CheckIndicator"); - qmlRegisterType(typeUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 3, "RadioIndicator"); - qmlRegisterType(typeUrl(QStringLiteral("SliderGroove.qml")), import, 2, 3, "SliderGroove"); - qmlRegisterType(typeUrl(QStringLiteral("SliderHandle.qml")), import, 2, 3, "SliderHandle"); - qmlRegisterType(typeUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 3, "SwitchIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("ButtonPanel.qml")), import, 2, 3, "ButtonPanel"); + qmlRegisterType(resolvedUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 3, "CheckIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 3, "RadioIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("SliderGroove.qml")), import, 2, 3, "SliderGroove"); + qmlRegisterType(resolvedUrl(QStringLiteral("SliderHandle.qml")), import, 2, 3, "SliderHandle"); + qmlRegisterType(resolvedUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 3, "SwitchIndicator"); } QString QtQuickControls2FusionStylePlugin::name() const { - return QStringLiteral("fusion"); + return QStringLiteral("Fusion"); } -QQuickProxyTheme *QtQuickControls2FusionStylePlugin::createTheme() const +void QtQuickControls2FusionStylePlugin::initializeTheme(QQuickTheme *theme) { - return new QQuickFusionTheme; + QQuickFusionTheme::initialize(theme); } QT_END_NAMESPACE diff --git a/src/imports/controls/imagine/ApplicationWindow.qml b/src/imports/controls/imagine/ApplicationWindow.qml index 8600e8d6..00922f63 100644 --- a/src/imports/controls/imagine/ApplicationWindow.qml +++ b/src/imports/controls/imagine/ApplicationWindow.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.2 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ApplicationWindow { id: window diff --git a/src/imports/controls/imagine/BusyIndicator.qml b/src/imports/controls/imagine/BusyIndicator.qml index a9a5ac40..bd90d21a 100644 --- a/src/imports/controls/imagine/BusyIndicator.qml +++ b/src/imports/controls/imagine/BusyIndicator.qml @@ -34,24 +34,29 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.BusyIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + contentItem: AnimatedImage { opacity: control.running ? 1 : 0 playing: control.running || opacity > 0 @@ -70,10 +75,6 @@ T.BusyIndicator { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "busyindicator-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Button.qml b/src/imports/controls/imagine/Button.qml index 7c8ab584..c8962a6b 100644 --- a/src/imports/controls/imagine/Button.qml +++ b/src/imports/controls/imagine/Button.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Button { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) spacing: 6 // ### @@ -57,6 +56,11 @@ T.Button { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + icon.width: 24 icon.height: 24 icon.color: control.enabled && control.flat && control.highlighted ? control.palette.highlight @@ -77,10 +81,6 @@ T.Button { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "button-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/CheckBox.qml b/src/imports/controls/imagine/CheckBox.qml index 8c5cd918..3f0b7684 100644 --- a/src/imports/controls/imagine/CheckBox.qml +++ b/src/imports/controls/imagine/CheckBox.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.CheckBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 6 // ### @@ -56,6 +55,11 @@ T.CheckBox { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + indicator: Image { x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 @@ -86,10 +90,6 @@ T.CheckBox { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "checkbox-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/CheckDelegate.qml b/src/imports/controls/imagine/CheckDelegate.qml index 76cd89c4..2336131f 100644 --- a/src/imports/controls/imagine/CheckDelegate.qml +++ b/src/imports/controls/imagine/CheckDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.CheckDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 12 // ### @@ -58,6 +57,11 @@ T.CheckDelegate { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + icon.width: 24 icon.height: 24 icon.color: control.palette.text @@ -97,10 +101,6 @@ T.CheckDelegate { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "checkdelegate-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/ComboBox.qml b/src/imports/controls/imagine/ComboBox.qml index fa22ab90..530fa378 100644 --- a/src/imports/controls/imagine/ComboBox.qml +++ b/src/imports/controls/imagine/ComboBox.qml @@ -34,26 +34,30 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.3 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ComboBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentItem.implicitWidth + background ? (background.leftPadding + background.rightPadding) : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + background ? (background.topPadding + background.bottomPadding) : 0) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + Math.max(implicitContentHeight, + implicitIndicatorHeight) + background ? (background.topPadding + background.bottomPadding) : 0) leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + delegate: ItemDelegate { width: parent.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData @@ -102,10 +106,6 @@ T.ComboBox { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "combobox-background" NinePatchImageSelector on source { states: [ @@ -133,6 +133,11 @@ T.ComboBox { rightPadding: background.rightPadding bottomPadding: background.bottomPadding + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + palette.text: control.palette.text palette.highlight: control.palette.highlight palette.highlightedText: control.palette.highlightedText @@ -150,10 +155,6 @@ T.ComboBox { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.popup.width + leftInset + rightInset - height: control.popup.height + topInset + bottomInset - source: Imagine.url + "combobox-popup" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/DelayButton.qml b/src/imports/controls/imagine/DelayButton.qml index f0a2c568..ef1f6511 100644 --- a/src/imports/controls/imagine/DelayButton.qml +++ b/src/imports/controls/imagine/DelayButton.qml @@ -34,26 +34,30 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 import QtGraphicalEffects 1.0 T.DelayButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + transition: Transition { NumberAnimation { duration: control.delay * (control.pressed ? 1.0 - control.progress : 0.3 * control.progress) @@ -70,10 +74,6 @@ T.DelayButton { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "delaybutton-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Dial.qml b/src/imports/controls/imagine/Dial.qml index e9652249..ac7a4645 100644 --- a/src/imports/controls/imagine/Dial.qml +++ b/src/imports/controls/imagine/Dial.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Dial { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 @@ -52,6 +52,11 @@ T.Dial { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + handle: Image { x: background.x + background.width / 2 - handle.width / 2 y: background.y + background.height / 2 - handle.height / 2 diff --git a/src/imports/controls/imagine/Dialog.qml b/src/imports/controls/imagine/Dialog.qml index 67215ec5..968f70ab 100644 --- a/src/imports/controls/imagine/Dialog.qml +++ b/src/imports/controls/imagine/Dialog.qml @@ -34,37 +34,35 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Dialog { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - header && header.visible ? header.implicitWidth : 0, - footer && footer.visible ? footer.implicitWidth : 0, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (header && header.visible ? header.implicitHeight + spacing : 0) - + (footer && footer.visible ? footer.implicitHeight + spacing : 0) - + (contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0)) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 - background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + background: NinePatchImage { source: Imagine.url + "dialog-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/DialogButtonBox.qml b/src/imports/controls/imagine/DialogButtonBox.qml index 69211ed9..ec1cbde8 100644 --- a/src/imports/controls/imagine/DialogButtonBox.qml +++ b/src/imports/controls/imagine/DialogButtonBox.qml @@ -34,24 +34,30 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.DialogButtonBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + (control.count === 1 ? contentWidth * 2 : contentWidth) + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + spacing: 6 delegate: Button { @@ -60,9 +66,6 @@ T.DialogButtonBox { } contentItem: ListView { - implicitWidth: control.count === 1 ? 200 : contentWidth - implicitHeight: 32 - model: control.contentModel spacing: control.spacing orientation: ListView.Horizontal @@ -71,10 +74,6 @@ T.DialogButtonBox { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "dialogbuttonbox-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Drawer.qml b/src/imports/controls/imagine/Drawer.qml index d4bf5a7c..ea4f7337 100644 --- a/src/imports/controls/imagine/Drawer.qml +++ b/src/imports/controls/imagine/Drawer.qml @@ -34,35 +34,35 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Drawer { id: control parent: T.ApplicationWindow.overlay - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + enter: Transition { SmoothedAnimation { velocity: 5 } } exit: Transition { SmoothedAnimation { velocity: 5 } } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "drawer-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Frame.qml b/src/imports/controls/imagine/Frame.qml index 4c9b87d3..b049715b 100644 --- a/src/imports/controls/imagine/Frame.qml +++ b/src/imports/controls/imagine/Frame.qml @@ -34,30 +34,30 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Frame { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 - background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + background: NinePatchImage { source: Imagine.url + "frame-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/GroupBox.qml b/src/imports/controls/imagine/GroupBox.qml index b2868cec..816e0c8c 100644 --- a/src/imports/controls/imagine/GroupBox.qml +++ b/src/imports/controls/imagine/GroupBox.qml @@ -34,24 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.GroupBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - label ? label.implicitWidth + leftPadding + rightPadding : 0, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitLabelWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) - - topPadding: (background ? background.topPadding : 0) + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0) + topPadding: (background ? background.topPadding : 0) + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0) leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 diff --git a/src/imports/controls/imagine/ItemDelegate.qml b/src/imports/controls/imagine/ItemDelegate.qml index 6d1d7bbe..7ec07f55 100644 --- a/src/imports/controls/imagine/ItemDelegate.qml +++ b/src/imports/controls/imagine/ItemDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ItemDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 12 // ### @@ -58,6 +57,11 @@ T.ItemDelegate { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + icon.width: 24 icon.height: 24 icon.color: control.palette.text @@ -75,10 +79,6 @@ T.ItemDelegate { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "itemdelegate-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Label.qml b/src/imports/controls/imagine/Label.qml index c73954b2..f9a5bdb6 100644 --- a/src/imports/controls/imagine/Label.qml +++ b/src/imports/controls/imagine/Label.qml @@ -34,22 +34,23 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Label { id: control + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + color: control.palette.windowText linkColor: control.palette.link background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "label-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Menu.qml b/src/imports/controls/imagine/Menu.qml index 74dc09de..bf7540fd 100644 --- a/src/imports/controls/imagine/Menu.qml +++ b/src/imports/controls/imagine/Menu.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 -import QtQuick.Window 2.11 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 +import QtQuick.Window 2.12 T.Menu { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topMargin: background ? background.topInset : 0 leftMargin: background ? background.leftInset : 0 @@ -59,6 +59,11 @@ T.Menu { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + delegate: MenuItem { } contentItem: ListView { @@ -72,10 +77,6 @@ T.Menu { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "menu-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/MenuItem.qml b/src/imports/controls/imagine/MenuItem.qml index 80d6f2cd..58dc344a 100644 --- a/src/imports/controls/imagine/MenuItem.qml +++ b/src/imports/controls/imagine/MenuItem.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.MenuItem { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 6 // ### @@ -58,6 +57,11 @@ T.MenuItem { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + icon.width: 24 icon.height: 24 icon.color: control.palette.windowText @@ -118,10 +122,6 @@ T.MenuItem { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "menuitem-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/MenuSeparator.qml b/src/imports/controls/imagine/MenuSeparator.qml index a14fe9a6..3821a15a 100644 --- a/src/imports/controls/imagine/MenuSeparator.qml +++ b/src/imports/controls/imagine/MenuSeparator.qml @@ -34,24 +34,29 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.MenuSeparator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem ? contentItem.implicitHeight + topPadding + bottomPadding : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + contentItem: NinePatchImage { source: Imagine.url + "menuseparator-separator" NinePatchImageSelector on source { @@ -63,10 +68,6 @@ T.MenuSeparator { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "menuseparator-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Page.qml b/src/imports/controls/imagine/Page.qml index c3dd355e..2fe6a01d 100644 --- a/src/imports/controls/imagine/Page.qml +++ b/src/imports/controls/imagine/Page.qml @@ -34,36 +34,34 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Page { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding, - header && header.visible ? header.implicitWidth : 0, - footer && footer.visible ? footer.implicitWidth : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding - + (header && header.visible ? header.implicitHeight + spacing : 0) - + (footer && footer.visible ? footer.implicitHeight + spacing : 0)) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 - background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + background: NinePatchImage { source: Imagine.url + "page-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/PageIndicator.qml b/src/imports/controls/imagine/PageIndicator.qml index 156033e2..7e9f43fe 100644 --- a/src/imports/controls/imagine/PageIndicator.qml +++ b/src/imports/controls/imagine/PageIndicator.qml @@ -34,24 +34,29 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.PageIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + delegate: Image { source: Imagine.url + "pageindicator-delegate" ImageSelector on source { @@ -75,10 +80,6 @@ T.PageIndicator { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "pageindicator-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Pane.qml b/src/imports/controls/imagine/Pane.qml index a1899149..f794666e 100644 --- a/src/imports/controls/imagine/Pane.qml +++ b/src/imports/controls/imagine/Pane.qml @@ -34,30 +34,30 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Pane { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 - background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + background: NinePatchImage { source: Imagine.url + "pane-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Popup.qml b/src/imports/controls/imagine/Popup.qml index a111df3a..12b8300b 100644 --- a/src/imports/controls/imagine/Popup.qml +++ b/src/imports/controls/imagine/Popup.qml @@ -34,32 +34,30 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Popup { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : undefined leftPadding: background ? background.leftPadding : undefined rightPadding: background ? background.rightPadding : undefined bottomPadding: background ? background.bottomPadding : undefined - background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + background: NinePatchImage { source: Imagine.url + "popup-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/ProgressBar.qml b/src/imports/controls/imagine/ProgressBar.qml index 7fd0ce1b..c809f308 100644 --- a/src/imports/controls/imagine/ProgressBar.qml +++ b/src/imports/controls/imagine/ProgressBar.qml @@ -34,25 +34,30 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 import QtGraphicalEffects 1.0 T.ProgressBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + contentItem: Item { implicitWidth: control.indeterminate ? animation.implicitWidth || progress.implicitWidth : progress.implicitWidth implicitHeight: control.indeterminate ? animation.implicitHeight || progress.implicitHeight : progress.implicitHeight @@ -124,10 +129,6 @@ T.ProgressBar { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "progressbar-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/RadioButton.qml b/src/imports/controls/imagine/RadioButton.qml index 57bdedaa..6ba36d8a 100644 --- a/src/imports/controls/imagine/RadioButton.qml +++ b/src/imports/controls/imagine/RadioButton.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.RadioButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 6 // ### @@ -56,6 +55,11 @@ T.RadioButton { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + indicator: Image { x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 @@ -85,10 +89,6 @@ T.RadioButton { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "radiobutton-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/RadioDelegate.qml b/src/imports/controls/imagine/RadioDelegate.qml index e7e37b0b..c3febde2 100644 --- a/src/imports/controls/imagine/RadioDelegate.qml +++ b/src/imports/controls/imagine/RadioDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.RadioDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 12 // ### @@ -58,6 +57,11 @@ T.RadioDelegate { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + icon.width: 24 icon.height: 24 icon.color: control.palette.text @@ -96,10 +100,6 @@ T.RadioDelegate { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "radiodelegate-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/RangeSlider.qml b/src/imports/controls/imagine/RangeSlider.qml index 5c7ee70e..5461cf01 100644 --- a/src/imports/controls/imagine/RangeSlider.qml +++ b/src/imports/controls/imagine/RangeSlider.qml @@ -34,26 +34,31 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.RangeSlider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(first.handle ? first.handle.implicitWidth : 0, - second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(first.handle ? first.handle.implicitHeight : 0, - second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + first.implicitHandleWidth + leftPadding + rightPadding, + second.implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + first.implicitHandleHeight + topPadding + bottomPadding, + second.implicitHandleHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + first.handle: Image { x: control.leftPadding + (control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height)) @@ -93,9 +98,6 @@ T.RangeSlider { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset scale: control.horizontal && control.mirrored ? -1 : 1 source: Imagine.url + "rangeslider-background" diff --git a/src/imports/controls/imagine/RoundButton.qml b/src/imports/controls/imagine/RoundButton.qml index b9f4ae06..718faad4 100644 --- a/src/imports/controls/imagine/RoundButton.qml +++ b/src/imports/controls/imagine/RoundButton.qml @@ -34,27 +34,31 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.RoundButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + icon.width: 24 icon.height: 24 icon.color: control.enabled && control.flat && control.highlighted ? control.palette.highlight @@ -75,10 +79,6 @@ T.RoundButton { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - // ### TODO: radius? source: Imagine.url + "roundbutton-background" NinePatchImageSelector on source { diff --git a/src/imports/controls/imagine/ScrollBar.qml b/src/imports/controls/imagine/ScrollBar.qml index 49c8d1f0..b7acf416 100644 --- a/src/imports/controls/imagine/ScrollBar.qml +++ b/src/imports/controls/imagine/ScrollBar.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ScrollBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) visible: control.policy !== T.ScrollBar.AlwaysOff @@ -54,6 +54,11 @@ T.ScrollBar { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + contentItem: NinePatchImage { width: control.availableWidth height: control.availableHeight @@ -74,10 +79,6 @@ T.ScrollBar { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "scrollbar-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/ScrollIndicator.qml b/src/imports/controls/imagine/ScrollIndicator.qml index a2d0e94f..fd1effa3 100644 --- a/src/imports/controls/imagine/ScrollIndicator.qml +++ b/src/imports/controls/imagine/ScrollIndicator.qml @@ -34,24 +34,29 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ScrollIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + contentItem: NinePatchImage { width: control.availableWidth height: control.availableHeight @@ -70,10 +75,6 @@ T.ScrollIndicator { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "scrollindicator-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/ScrollView.qml b/src/imports/controls/imagine/ScrollView.qml index 9ab64881..64fd3ac5 100644 --- a/src/imports/controls/imagine/ScrollView.qml +++ b/src/imports/controls/imagine/ScrollView.qml @@ -34,26 +34,30 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ScrollView { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : -1) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : -1) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + T.ScrollBar.vertical: ScrollBar { parent: control x: control.mirrored ? 0 : control.width - width @@ -71,10 +75,6 @@ T.ScrollView { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.path + "scrollview-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Slider.qml b/src/imports/controls/imagine/Slider.qml index a206c03b..f39bab70 100644 --- a/src/imports/controls/imagine/Slider.qml +++ b/src/imports/controls/imagine/Slider.qml @@ -34,24 +34,29 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Slider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitHandleHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + handle: Image { x: Math.round(control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)) y: Math.round(control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))) @@ -71,9 +76,6 @@ T.Slider { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset scale: control.horizontal && control.mirrored ? -1 : 1 source: Imagine.url + "slider-background" diff --git a/src/imports/controls/imagine/SpinBox.qml b/src/imports/controls/imagine/SpinBox.qml index 1ef862f5..866db7fc 100644 --- a/src/imports/controls/imagine/SpinBox.qml +++ b/src/imports/controls/imagine/SpinBox.qml @@ -34,29 +34,33 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.SpinBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentItem.implicitWidth + 2 * padding + - (up.indicator ? up.indicator.implicitWidth : 0) + - (down.indicator ? down.indicator.implicitWidth : 0)) - implicitHeight: Math.max(contentItem.implicitHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, - up.indicator ? up.indicator.implicitHeight : 0, - down.indicator ? down.indicator.implicitHeight : 0) - baselineOffset: contentItem.y + contentItem.baselineOffset + up.implicitIndicatorWidth + + down.implicitIndicatorWidth) + implicitHeight: Math.max(implicitContentHeight + topPadding + bottomPadding, + implicitBackgroundHeight, + up.implicitIndicatorHeight, + down.implicitIndicatorHeight) topPadding: background ? background.topPadding : 0 leftPadding: (background ? background.leftPadding : 0) + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0)) rightPadding: (background ? background.rightPadding : 0) + (control.mirrored ? (down.indicator ? down.indicator.width : 0) : (up.indicator ? up.indicator.width : 0)) bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + validator: IntValidator { locale: control.locale.name bottom: Math.min(control.from, control.to) @@ -134,10 +138,6 @@ T.SpinBox { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "spinbox-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/StackView.qml b/src/imports/controls/imagine/StackView.qml index 8d749519..302816d7 100644 --- a/src/imports/controls/imagine/StackView.qml +++ b/src/imports/controls/imagine/StackView.qml @@ -34,22 +34,27 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.StackView { id: control - implicitWidth: background ? background.implicitWidth : 0 - implicitHeight: background ? background.implicitHeight : 0 + implicitWidth: implicitBackgroundWidth + implicitHeight: implicitBackgroundHeight topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + popEnter: Transition { XAnimator { from: (control.mirrored ? -1 : 1) * -control.width; to: 0; duration: 400; easing.type: Easing.OutCubic } } @@ -75,10 +80,6 @@ T.StackView { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "stackview-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/SwipeDelegate.qml b/src/imports/controls/imagine/SwipeDelegate.qml index 23edfc58..be1a378e 100644 --- a/src/imports/controls/imagine/SwipeDelegate.qml +++ b/src/imports/controls/imagine/SwipeDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.SwipeDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 12 // ### @@ -58,6 +57,11 @@ T.SwipeDelegate { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + icon.width: 24 icon.height: 24 icon.color: control.palette.text @@ -77,10 +81,6 @@ T.SwipeDelegate { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "swipedelegate-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/SwipeView.qml b/src/imports/controls/imagine/SwipeView.qml index f997be0d..6c946715 100644 --- a/src/imports/controls/imagine/SwipeView.qml +++ b/src/imports/controls/imagine/SwipeView.qml @@ -34,24 +34,29 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.SwipeView { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + contentItem: ListView { model: control.contentModel interactive: control.interactive @@ -69,10 +74,6 @@ T.SwipeView { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "swipeview-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Switch.qml b/src/imports/controls/imagine/Switch.qml index 085d6879..2a144c85 100644 --- a/src/imports/controls/imagine/Switch.qml +++ b/src/imports/controls/imagine/Switch.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Switch { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 6 // ### @@ -56,6 +55,11 @@ T.Switch { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + indicator: NinePatchImage { x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 @@ -115,10 +119,6 @@ T.Switch { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "switch-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/SwitchDelegate.qml b/src/imports/controls/imagine/SwitchDelegate.qml index b53cf321..a4f7e93e 100644 --- a/src/imports/controls/imagine/SwitchDelegate.qml +++ b/src/imports/controls/imagine/SwitchDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.SwitchDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 12 // ### @@ -58,6 +57,11 @@ T.SwitchDelegate { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + icon.width: 24 icon.height: 24 icon.color: control.palette.text @@ -127,10 +131,6 @@ T.SwitchDelegate { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "switchdelegate-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/TabBar.qml b/src/imports/controls/imagine/TabBar.qml index be143bf1..20802da0 100644 --- a/src/imports/controls/imagine/TabBar.qml +++ b/src/imports/controls/imagine/TabBar.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.TabBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 @@ -52,6 +52,11 @@ T.TabBar { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + contentItem: ListView { model: control.contentModel currentIndex: control.currentIndex @@ -69,10 +74,6 @@ T.TabBar { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "tabbar-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/TabButton.qml b/src/imports/controls/imagine/TabButton.qml index d4098c9e..71cd021f 100644 --- a/src/imports/controls/imagine/TabButton.qml +++ b/src/imports/controls/imagine/TabButton.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.TabButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) spacing: 6 // ### @@ -57,6 +56,11 @@ T.TabButton { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + icon.width: 24 icon.height: 24 icon.color: control.palette.buttonText @@ -73,10 +77,6 @@ T.TabButton { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "tabbutton-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/TextArea.qml b/src/imports/controls/imagine/TextArea.qml index 1e351ab8..94fe237c 100644 --- a/src/imports/controls/imagine/TextArea.qml +++ b/src/imports/controls/imagine/TextArea.qml @@ -34,21 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.TextArea { id: control implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, - background ? background.implicitWidth : 0, + implicitBackgroundWidth + leftInset + rightInset, placeholder.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, + implicitBackgroundHeight + topInset + bottomInset, placeholder.implicitHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 @@ -56,10 +56,16 @@ T.TextArea { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + color: control.palette.text selectionColor: control.palette.highlight selectedTextColor: control.palette.highlightedText verticalAlignment: Qt.AlignVCenter + placeholderTextColor: Color.transparent(control.color, 0.5) PlaceholderText { id: placeholder @@ -70,19 +76,14 @@ T.TextArea { text: control.placeholderText font: control.font - color: control.color + color: control.placeholderTextColor verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight renderType: control.renderType - opacity: 0.5 } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "textarea-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/TextField.qml b/src/imports/controls/imagine/TextField.qml index 1782c1e2..2943396e 100644 --- a/src/imports/controls/imagine/TextField.qml +++ b/src/imports/controls/imagine/TextField.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.TextField { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0) - || contentWidth + leftPadding + rightPadding - implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, + implicitWidth: implicitBackgroundWidth + leftInset + rightInset + || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding, placeholder.implicitHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 @@ -56,9 +55,15 @@ T.TextField { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + color: control.palette.text selectionColor: control.palette.highlight selectedTextColor: control.palette.highlightedText + placeholderTextColor: Color.transparent(control.color, 0.5) verticalAlignment: Qt.AlignVCenter PlaceholderText { @@ -70,19 +75,14 @@ T.TextField { text: control.placeholderText font: control.font - color: control.color + color: control.placeholderTextColor verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight renderType: control.renderType - opacity: 0.5 } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "textfield-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/ToolBar.qml b/src/imports/controls/imagine/ToolBar.qml index 289566ec..f1cb3768 100644 --- a/src/imports/controls/imagine/ToolBar.qml +++ b/src/imports/controls/imagine/ToolBar.qml @@ -34,30 +34,30 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ToolBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 - background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + background: NinePatchImage { source: Imagine.url + "toolbar-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/ToolButton.qml b/src/imports/controls/imagine/ToolButton.qml index 63260ff5..e41c2cf8 100644 --- a/src/imports/controls/imagine/ToolButton.qml +++ b/src/imports/controls/imagine/ToolButton.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ToolButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) spacing: 6 // ### @@ -57,6 +56,11 @@ T.ToolButton { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + icon.width: 24 icon.height: 24 icon.color: control.palette.buttonText @@ -73,10 +77,6 @@ T.ToolButton { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "toolbutton-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/ToolSeparator.qml b/src/imports/controls/imagine/ToolSeparator.qml index 88b645cb..8961b259 100644 --- a/src/imports/controls/imagine/ToolSeparator.qml +++ b/src/imports/controls/imagine/ToolSeparator.qml @@ -34,24 +34,29 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ToolSeparator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem ? contentItem.implicitHeight + topPadding + bottomPadding : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) topPadding: background ? background.topPadding : 0 leftPadding: background ? background.leftPadding : 0 rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + contentItem: NinePatchImage { source: Imagine.url + "toolseparator-separator" NinePatchImageSelector on source { @@ -65,10 +70,6 @@ T.ToolSeparator { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "toolseparator-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/ToolTip.qml b/src/imports/controls/imagine/ToolTip.qml index 81a5e8aa..2bcb4fa8 100644 --- a/src/imports/controls/imagine/ToolTip.qml +++ b/src/imports/controls/imagine/ToolTip.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.ToolTip { id: control @@ -45,10 +45,10 @@ T.ToolTip { x: parent ? (parent.width - implicitWidth) / 2 : 0 - (background ? background.leftInset : 0) y: -implicitHeight - (background ? background.topInset : 0) - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topMargin: background ? background.topInset : 0 leftMargin: background ? background.leftInset : 0 @@ -60,6 +60,11 @@ T.ToolTip { rightPadding: background ? background.rightPadding : 0 bottomPadding: background ? background.bottomPadding : 0 + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 + closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent contentItem: Text { @@ -70,10 +75,6 @@ T.ToolTip { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "tooltip-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/Tumbler.qml b/src/imports/controls/imagine/Tumbler.qml index 7beb39c5..80e8eb1f 100644 --- a/src/imports/controls/imagine/Tumbler.qml +++ b/src/imports/controls/imagine/Tumbler.qml @@ -34,17 +34,25 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Imagine 2.4 -import QtQuick.Controls.Imagine.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Imagine 2.5 +import QtQuick.Controls.Imagine.impl 2.5 T.Tumbler { id: control - implicitWidth: 60 - implicitHeight: 200 + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) || 60 // ### remove 60 in Qt 6 + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) || 200 // ### remove 200 in Qt 6 + + topInset: background ? -background.topInset || 0 : 0 + leftInset: background ? -background.leftInset || 0 : 0 + rightInset: background ? -background.rightInset || 0 : 0 + bottomInset: background ? -background.bottomInset || 0 : 0 delegate: Text { text: modelData @@ -56,6 +64,8 @@ T.Tumbler { } contentItem: TumblerView { + implicitWidth: 60 + implicitHeight: 200 model: control.model delegate: control.delegate path: Path { @@ -71,10 +81,6 @@ T.Tumbler { } background: NinePatchImage { - x: -leftInset; y: -topInset - width: control.width + leftInset + rightInset - height: control.height + topInset + bottomInset - source: Imagine.url + "tumbler-background" NinePatchImageSelector on source { states: [ diff --git a/src/imports/controls/imagine/imagine.pro b/src/imports/controls/imagine/imagine.pro index 1f63d572..2368c0a4 100644 --- a/src/imports/controls/imagine/imagine.pro +++ b/src/imports/controls/imagine/imagine.pro @@ -1,6 +1,6 @@ TARGET = qtquickcontrols2imaginestyleplugin TARGETPATH = QtQuick/Controls.2/Imagine -IMPORT_VERSION = 2.4 +IMPORT_VERSION = 2.5 QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private @@ -22,7 +22,7 @@ qtquickcontrols2imaginestyle.files += \ $$files($$PWD/images/*.webp) RESOURCES += qtquickcontrols2imaginestyle -CONFIG += no_cxx_module +CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler load(qml_plugin) requires(qtConfig(quickcontrols2-imagine)) diff --git a/src/imports/controls/imagine/qmldir b/src/imports/controls/imagine/qmldir index 48fd3bdb..7b4b3ea0 100644 --- a/src/imports/controls/imagine/qmldir +++ b/src/imports/controls/imagine/qmldir @@ -1,5 +1,5 @@ module QtQuick.Controls.Imagine plugin qtquickcontrols2imaginestyleplugin classname QtQuickControls2ImagineStylePlugin -depends QtQuick.Controls 2.4 +depends QtQuick.Controls 2.5 depends QtGraphicalEffects 1.0 diff --git a/src/imports/controls/imagine/qquickimaginetheme.cpp b/src/imports/controls/imagine/qquickimaginetheme.cpp index 5505e7ce..a9722fa5 100644 --- a/src/imports/controls/imagine/qquickimaginetheme.cpp +++ b/src/imports/controls/imagine/qquickimaginetheme.cpp @@ -36,20 +36,21 @@ #include "qquickimaginetheme_p.h" -#include <QtGui/qfontinfo.h> +#include <QtQuickTemplates2/private/qquicktheme_p.h> QT_BEGIN_NAMESPACE -QQuickImagineTheme::QQuickImagineTheme() - : QQuickTheme(QStringLiteral("Imagine")) +void QQuickImagineTheme::initialize(QQuickTheme *theme) { + QFont systemFont; systemFont.setFamily(QLatin1String("Open Sans")); - systemFont = resolveFont(systemFont); + theme->setFont(QQuickTheme::System, systemFont); const QColor accentColor = QColor::fromRgb(0x4fc1e9); const QColor windowTextColor = QColor::fromRgb(0x434a54); const QColor disabledWindowTextColor = QColor::fromRgb(0xccd1d9); + QPalette systemPalette; systemPalette.setColor(QPalette::ButtonText, Qt::white); systemPalette.setColor(QPalette::BrightText, Qt::white); systemPalette.setColor(QPalette::Highlight, accentColor); @@ -59,19 +60,7 @@ QQuickImagineTheme::QQuickImagineTheme() systemPalette.setColor(QPalette::WindowText, windowTextColor); systemPalette.setColor(QPalette::Disabled, QPalette::Text, disabledWindowTextColor); systemPalette.setColor(QPalette::Disabled, QPalette::WindowText, disabledWindowTextColor); - systemPalette = resolvePalette(systemPalette); -} - -const QFont *QQuickImagineTheme::font(QPlatformTheme::Font type) const -{ - Q_UNUSED(type); - return &systemFont; -} - -const QPalette *QQuickImagineTheme::palette(QPlatformTheme::Palette type) const -{ - Q_UNUSED(type); - return &systemPalette; + theme->setPalette(QQuickTheme::System, systemPalette); } QT_END_NAMESPACE diff --git a/src/imports/controls/imagine/qquickimaginetheme_p.h b/src/imports/controls/imagine/qquickimaginetheme_p.h index ea3a1cbd..d3d43074 100644 --- a/src/imports/controls/imagine/qquickimaginetheme_p.h +++ b/src/imports/controls/imagine/qquickimaginetheme_p.h @@ -48,21 +48,16 @@ // We mean it. // -#include <QtQuickControls2/private/qquicktheme_p.h> +#include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE -class QQuickImagineTheme : public QQuickTheme +class QQuickTheme; + +class QQuickImagineTheme { public: - explicit QQuickImagineTheme(); - - const QFont *font(Font type = SystemFont) const override; - const QPalette *palette(Palette type = SystemPalette) const override; - -private: - QFont systemFont; - QPalette systemPalette; + static void initialize(QQuickTheme *theme); }; QT_END_NAMESPACE diff --git a/src/imports/controls/imagine/qquickninepatchimage.cpp b/src/imports/controls/imagine/qquickninepatchimage.cpp index 9e1b82bf..c840c6f8 100644 --- a/src/imports/controls/imagine/qquickninepatchimage.cpp +++ b/src/imports/controls/imagine/qquickninepatchimage.cpp @@ -192,9 +192,6 @@ public: void updatePaddings(const QSizeF &size, const QVector<qreal> &horizontal, const QVector<qreal> &vertical); void updateInsets(const QVector<qreal> &horizontal, const QVector<qreal> &vertical); - qreal getImplicitWidth() const override; - qreal getImplicitHeight() const override; - bool resetNode = false; qreal topPadding = 0; qreal leftPadding = 0; @@ -332,18 +329,6 @@ void QQuickNinePatchImagePrivate::updateInsets(const QVector<qreal> &horizontal, emit q->rightInsetChanged(); } -qreal QQuickNinePatchImagePrivate::getImplicitWidth() const -{ - Q_Q(const QQuickNinePatchImage); - return implicitWidth - q->leftInset() - q->rightInset(); -} - -qreal QQuickNinePatchImagePrivate::getImplicitHeight() const -{ - Q_Q(const QQuickNinePatchImage); - return implicitHeight - q->topInset() - q->bottomInset(); -} - QQuickNinePatchImage::QQuickNinePatchImage(QQuickItem *parent) : QQuickImage(*(new QQuickNinePatchImagePrivate), parent) { diff --git a/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp b/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp index 2a613f1c..490825ff 100644 --- a/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp +++ b/src/imports/controls/imagine/qtquickcontrols2imaginestyleplugin.cpp @@ -43,14 +43,6 @@ #include "qquickimaginetheme_p.h" #include "qquickninepatchimage_p.h" -static inline void initResources() -{ - Q_INIT_RESOURCE(qmake_qtquickcontrols2imaginestyle); -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtQuick_Controls_2_Imagine); -#endif -} - QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQtQuickControlsImagine, "qt.quick.controls.imagine") @@ -66,12 +58,11 @@ public: void registerTypes(const char *uri) override; QString name() const override; - QQuickProxyTheme *createTheme() const override; + void initializeTheme(QQuickTheme *theme) override; }; QtQuickControls2ImagineStylePlugin::QtQuickControls2ImagineStylePlugin(QObject *parent) : QQuickStylePlugin(parent) { - initResources(); } void QtQuickControls2ImagineStylePlugin::registerTypes(const char *uri) @@ -90,12 +81,12 @@ void QtQuickControls2ImagineStylePlugin::registerTypes(const char *uri) QString QtQuickControls2ImagineStylePlugin::name() const { - return QStringLiteral("imagine"); + return QStringLiteral("Imagine"); } -QQuickProxyTheme *QtQuickControls2ImagineStylePlugin::createTheme() const +void QtQuickControls2ImagineStylePlugin::initializeTheme(QQuickTheme *theme) { - return new QQuickImagineTheme; + QQuickImagineTheme::initialize(theme); } QT_END_NAMESPACE diff --git a/src/imports/controls/material/ApplicationWindow.qml b/src/imports/controls/material/ApplicationWindow.qml index c3d866ce..94aaeff3 100644 --- a/src/imports/controls/material/ApplicationWindow.qml +++ b/src/imports/controls/material/ApplicationWindow.qml @@ -34,10 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.3 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.ApplicationWindow { id: window diff --git a/src/imports/controls/material/BoxShadow.qml b/src/imports/controls/material/BoxShadow.qml index 3d352195..5004c7f6 100644 --- a/src/imports/controls/material/BoxShadow.qml +++ b/src/imports/controls/material/BoxShadow.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 /* A implementation of CSS's box-shadow, used by ElevationEffect for a Material Design diff --git a/src/imports/controls/material/BusyIndicator.qml b/src/imports/controls/material/BusyIndicator.qml index 5e53bdb9..18887669 100644 --- a/src/imports/controls/material/BusyIndicator.qml +++ b/src/imports/controls/material/BusyIndicator.qml @@ -34,22 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.BusyIndicator { id: control - implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding - implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 contentItem: BusyIndicatorImpl { - implicitWidth: 48 - implicitHeight: 48 + implicitWidth: control.Material.touchTarget + implicitHeight: control.Material.touchTarget color: control.Material.accentColor running: control.running diff --git a/src/imports/controls/material/Button.qml b/src/imports/controls/material/Button.qml index 6401b2ad..62afe2cb 100644 --- a/src/imports/controls/material/Button.qml +++ b/src/imports/controls/material/Button.qml @@ -34,26 +34,25 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.Button { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) - // external vertical padding is 6 (to increase touch area) + topInset: 6 + bottomInset: 6 padding: 12 - leftPadding: padding - 4 - rightPadding: padding - 4 + horizontalPadding: padding - 4 spacing: 6 icon.width: 24 @@ -82,12 +81,8 @@ T.Button { // TODO: Add a proper ripple/ink effect for mouse/touch input and focus state background: Rectangle { implicitWidth: 64 - implicitHeight: 48 + implicitHeight: control.Material.buttonHeight - // external vertical padding is 6 (to increase touch area) - y: 6 - width: parent.width - height: parent.height - 12 radius: 2 color: !control.enabled ? control.Material.buttonDisabledColor : control.highlighted ? control.Material.highlightedButtonColor : control.Material.buttonColor diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml index 1f818e6e..3ba8c887 100644 --- a/src/imports/controls/material/CheckBox.qml +++ b/src/imports/controls/material/CheckBox.qml @@ -34,25 +34,23 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.CheckBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 8 padding: 8 - topPadding: padding + 7 - bottomPadding: padding + 7 + verticalPadding: padding + 7 indicator: CheckIndicator { x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 diff --git a/src/imports/controls/material/CheckDelegate.qml b/src/imports/controls/material/CheckDelegate.qml index 1d3ff61d..caf0f8e1 100644 --- a/src/imports/controls/material/CheckDelegate.qml +++ b/src/imports/controls/material/CheckDelegate.qml @@ -34,26 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.CheckDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 - topPadding: 8 - bottomPadding: 8 + verticalPadding: 8 spacing: 16 icon.width: 24 @@ -82,7 +80,7 @@ T.CheckDelegate { } background: Rectangle { - implicitHeight: 48 + implicitHeight: control.Material.delegateHeight color: control.highlighted ? control.Material.listHighlightColor : "transparent" diff --git a/src/imports/controls/material/CheckIndicator.qml b/src/imports/controls/material/CheckIndicator.qml index dbba4ca4..67f46551 100644 --- a/src/imports/controls/material/CheckIndicator.qml +++ b/src/imports/controls/material/CheckIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 Rectangle { id: indicatorItem diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 3dd3cf30..5db53d1c 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -34,23 +34,25 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.3 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.ComboBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) + + topInset: 6 + bottomInset: 6 leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) @@ -99,11 +101,8 @@ T.ComboBox { background: Rectangle { implicitWidth: 120 - implicitHeight: 48 + implicitHeight: control.Material.buttonHeight - // external vertical padding is 6 (to increase touch area) - y: 6 - height: parent.height - 12 radius: control.flat ? 0 : 2 color: !control.editable ? control.Material.dialogColor : "transparent" diff --git a/src/imports/controls/material/CursorDelegate.qml b/src/imports/controls/material/CursorDelegate.qml index 5b2140a7..ffb3b3dd 100644 --- a/src/imports/controls/material/CursorDelegate.qml +++ b/src/imports/controls/material/CursorDelegate.qml @@ -34,8 +34,8 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Controls.Material 2.5 Rectangle { id: cursor diff --git a/src/imports/controls/material/DelayButton.qml b/src/imports/controls/material/DelayButton.qml index 4043949c..fddd49e4 100644 --- a/src/imports/controls/material/DelayButton.qml +++ b/src/imports/controls/material/DelayButton.qml @@ -34,26 +34,25 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.DelayButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) - // external vertical padding is 6 (to increase touch area) + topInset: 6 + bottomInset: 6 padding: 12 - leftPadding: padding - 4 - rightPadding: padding - 4 + horizontalPadding: padding - 4 Material.elevation: control.down ? 8 : 2 @@ -75,12 +74,8 @@ T.DelayButton { // TODO: Add a proper ripple/ink effect for mouse/touch input and focus state background: Rectangle { implicitWidth: 64 - implicitHeight: 48 + implicitHeight: control.Material.buttonHeight - // external vertical padding is 6 (to increase touch area) - y: 6 - width: parent.width - height: parent.height - 12 radius: 2 color: !control.enabled ? control.Material.buttonDisabledColor : control.Material.buttonColor diff --git a/src/imports/controls/material/Dial.qml b/src/imports/controls/material/Dial.qml index 54469c92..ce6bbc4b 100644 --- a/src/imports/controls/material/Dial.qml +++ b/src/imports/controls/material/Dial.qml @@ -34,18 +34,23 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.Dial { id: control - implicitWidth: 100 - implicitHeight: 100 + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) || 100 // ### remove 100 in Qt 6 + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) || 100 // ### remove 100 in Qt 6 background: Rectangle { + implicitWidth: 100 + implicitHeight: 100 + x: control.width / 2 - width / 2 y: control.height / 2 - height / 2 width: Math.max(64, Math.min(control.width, control.height)) diff --git a/src/imports/controls/material/Dialog.qml b/src/imports/controls/material/Dialog.qml index 5bbafc68..9426096e 100644 --- a/src/imports/controls/material/Dialog.qml +++ b/src/imports/controls/material/Dialog.qml @@ -34,27 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.Dialog { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - header && header.visible ? header.implicitWidth : 0, - footer && footer.visible ? footer.implicitWidth : 0, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (header && header.visible ? header.implicitHeight + spacing : 0) - + (footer && footer.visible ? footer.implicitHeight + spacing : 0) - + (contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0)) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) padding: 24 topPadding: 20 diff --git a/src/imports/controls/material/DialogButtonBox.qml b/src/imports/controls/material/DialogButtonBox.qml index 35df6362..eee9b88d 100644 --- a/src/imports/controls/material/DialogButtonBox.qml +++ b/src/imports/controls/material/DialogButtonBox.qml @@ -34,35 +34,32 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.DialogButtonBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) spacing: 8 padding: 8 - topPadding: 2 - bottomPadding: 2 + verticalPadding: 2 alignment: Qt.AlignRight + buttonLayout: T.DialogButtonBox.AndroidLayout Material.foreground: Material.accent delegate: Button { flat: true } contentItem: ListView { - implicitWidth: contentWidth - implicitHeight: 48 - model: control.contentModel spacing: control.spacing orientation: ListView.Horizontal @@ -71,7 +68,7 @@ T.DialogButtonBox { } background: PaddedRectangle { - implicitHeight: 52 + implicitHeight: control.Material.dialogButtonBoxHeight radius: 2 color: control.Material.dialogColor // Rounded corners should be only at the top or at the bottom diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml index 827e0b21..6721e10f 100644 --- a/src/imports/controls/material/Drawer.qml +++ b/src/imports/controls/material/Drawer.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.Drawer { id: control parent: T.Overlay.overlay - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: !dim && edge === Qt.BottomEdge && Material.elevation === 0 leftPadding: !dim && edge === Qt.RightEdge && Material.elevation === 0 diff --git a/src/imports/controls/material/ElevationEffect.qml b/src/imports/controls/material/ElevationEffect.qml index 71eccf4e..7e5d79aa 100644 --- a/src/imports/controls/material/ElevationEffect.qml +++ b/src/imports/controls/material/ElevationEffect.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 /* An effect for standard Material Design elevation shadows. Useful for using as \c layer.effect. diff --git a/src/imports/controls/material/Frame.qml b/src/imports/controls/material/Frame.qml index 51721c2c..7af59ca1 100644 --- a/src/imports/controls/material/Frame.qml +++ b/src/imports/controls/material/Frame.qml @@ -34,21 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.Frame { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 12 + verticalPadding: Material.frameVerticalPadding background: Rectangle { radius: 2 diff --git a/src/imports/controls/material/GroupBox.qml b/src/imports/controls/material/GroupBox.qml index 7ac30ec6..b07bb12d 100644 --- a/src/imports/controls/material/GroupBox.qml +++ b/src/imports/controls/material/GroupBox.qml @@ -34,25 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.GroupBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - label ? label.implicitWidth + leftPadding + rightPadding : 0, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitLabelWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) spacing: 6 padding: 12 - topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0) + topPadding: Material.frameVerticalPadding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0) + bottomPadding: Material.frameVerticalPadding label: Text { x: control.leftPadding diff --git a/src/imports/controls/material/ItemDelegate.qml b/src/imports/controls/material/ItemDelegate.qml index 3230ff26..b4839dd3 100644 --- a/src/imports/controls/material/ItemDelegate.qml +++ b/src/imports/controls/material/ItemDelegate.qml @@ -34,26 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.ItemDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 - topPadding: 8 - bottomPadding: 8 + verticalPadding: 8 spacing: 16 icon.width: 24 @@ -73,7 +71,7 @@ T.ItemDelegate { } background: Rectangle { - implicitHeight: 48 + implicitHeight: control.Material.delegateHeight color: control.highlighted ? control.Material.listHighlightColor : "transparent" diff --git a/src/imports/controls/material/Label.qml b/src/imports/controls/material/Label.qml index 26998a9e..49333e86 100644 --- a/src/imports/controls/material/Label.qml +++ b/src/imports/controls/material/Label.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.Label { id: control diff --git a/src/imports/controls/material/Menu.qml b/src/imports/controls/material/Menu.qml index 206ebd75..8f7c797c 100644 --- a/src/imports/controls/material/Menu.qml +++ b/src/imports/controls/material/Menu.qml @@ -34,26 +34,25 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 -import QtQuick.Window 2.11 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 +import QtQuick.Window 2.12 T.Menu { id: control Material.elevation: 8 - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) margins: 0 - topPadding: 8 - bottomPadding: 8 + verticalPadding: 8 transformOrigin: !cascade ? Item.Top : (mirrored ? Item.TopRight : Item.TopLeft) @@ -84,7 +83,7 @@ T.Menu { background: Rectangle { implicitWidth: 200 - implicitHeight: 48 + implicitHeight: control.Material.menuItemHeight radius: 3 color: control.Material.dialogColor diff --git a/src/imports/controls/material/MenuBar.qml b/src/imports/controls/material/MenuBar.qml index da12c9e9..74c5083d 100644 --- a/src/imports/controls/material/MenuBar.qml +++ b/src/imports/controls/material/MenuBar.qml @@ -34,19 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.MenuBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) delegate: MenuBarItem { } diff --git a/src/imports/controls/material/MenuBarItem.qml b/src/imports/controls/material/MenuBarItem.qml index 3c99cc15..eeb93fe4 100644 --- a/src/imports/controls/material/MenuBarItem.qml +++ b/src/imports/controls/material/MenuBarItem.qml @@ -34,25 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.MenuBarItem { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 - topPadding: 12 - bottomPadding: 12 + verticalPadding: 12 spacing: 16 icon.width: 24 diff --git a/src/imports/controls/material/MenuItem.qml b/src/imports/controls/material/MenuItem.qml index 54d13f8e..1f9caf8d 100644 --- a/src/imports/controls/material/MenuItem.qml +++ b/src/imports/controls/material/MenuItem.qml @@ -34,26 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.MenuItem { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 - topPadding: 12 - bottomPadding: 12 + verticalPadding: Material.menuItemVerticalPadding spacing: 16 icon.width: 24 @@ -97,7 +95,7 @@ T.MenuItem { background: Rectangle { implicitWidth: 200 - implicitHeight: 48 + implicitHeight: control.Material.menuItemHeight color: control.highlighted ? control.Material.listHighlightColor : "transparent" Ripple { diff --git a/src/imports/controls/material/MenuSeparator.qml b/src/imports/controls/material/MenuSeparator.qml index d2059d3a..6eb597c3 100644 --- a/src/imports/controls/material/MenuSeparator.qml +++ b/src/imports/controls/material/MenuSeparator.qml @@ -34,18 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.MenuSeparator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) - topPadding: 8 - bottomPadding: 8 + verticalPadding: 8 contentItem: Rectangle { implicitWidth: 200 diff --git a/src/imports/controls/material/Page.qml b/src/imports/controls/material/Page.qml index 647d8f0f..6e09f44f 100644 --- a/src/imports/controls/material/Page.qml +++ b/src/imports/controls/material/Page.qml @@ -34,24 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.Page { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding, - header && header.visible ? header.implicitWidth : 0, - footer && footer.visible ? footer.implicitWidth : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding - + (header && header.visible ? header.implicitHeight + spacing : 0) - + (footer && footer.visible ? footer.implicitHeight + spacing : 0)) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) background: Rectangle { color: control.Material.backgroundColor diff --git a/src/imports/controls/material/PageIndicator.qml b/src/imports/controls/material/PageIndicator.qml index 2ab9cd33..5cfcce04 100644 --- a/src/imports/controls/material/PageIndicator.qml +++ b/src/imports/controls/material/PageIndicator.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.PageIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 spacing: 6 diff --git a/src/imports/controls/material/Pane.qml b/src/imports/controls/material/Pane.qml index 0e232a9d..af2c2642 100644 --- a/src/imports/controls/material/Pane.qml +++ b/src/imports/controls/material/Pane.qml @@ -34,19 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.Pane { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 12 diff --git a/src/imports/controls/material/Popup.qml b/src/imports/controls/material/Popup.qml index 0d255f7d..3d7039bb 100644 --- a/src/imports/controls/material/Popup.qml +++ b/src/imports/controls/material/Popup.qml @@ -34,23 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.Popup { id: control Material.elevation: 24 - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 12 diff --git a/src/imports/controls/material/ProgressBar.qml b/src/imports/controls/material/ProgressBar.qml index 0f08c732..269ac657 100644 --- a/src/imports/controls/material/ProgressBar.qml +++ b/src/imports/controls/material/ProgressBar.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.ProgressBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) contentItem: ProgressBarImpl { implicitHeight: 4 diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml index 2a95f989..108ddbad 100644 --- a/src/imports/controls/material/RadioButton.qml +++ b/src/imports/controls/material/RadioButton.qml @@ -34,25 +34,23 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.RadioButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 8 padding: 8 - topPadding: padding + 6 - bottomPadding: padding + 6 + verticalPadding: padding + 6 indicator: RadioIndicator { x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 diff --git a/src/imports/controls/material/RadioDelegate.qml b/src/imports/controls/material/RadioDelegate.qml index d498ee80..5cc23829 100644 --- a/src/imports/controls/material/RadioDelegate.qml +++ b/src/imports/controls/material/RadioDelegate.qml @@ -34,26 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.RadioDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 - topPadding: 8 - bottomPadding: 8 + verticalPadding: 8 spacing: 16 icon.width: 24 @@ -82,7 +80,7 @@ T.RadioDelegate { } background: Rectangle { - implicitHeight: 48 + implicitHeight: control.Material.delegateHeight color: control.highlighted ? control.Material.listHighlightColor : "transparent" diff --git a/src/imports/controls/material/RadioIndicator.qml b/src/imports/controls/material/RadioIndicator.qml index 7f27dcdc..f69f31cc 100644 --- a/src/imports/controls/material/RadioIndicator.qml +++ b/src/imports/controls/material/RadioIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 Rectangle { implicitWidth: 20 diff --git a/src/imports/controls/material/RangeSlider.qml b/src/imports/controls/material/RangeSlider.qml index cbe21400..8c8a88b1 100644 --- a/src/imports/controls/material/RangeSlider.qml +++ b/src/imports/controls/material/RangeSlider.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.RangeSlider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(first.handle ? first.handle.implicitWidth : 0, - second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(first.handle ? first.handle.implicitHeight : 0, - second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + first.implicitHandleWidth + leftPadding + rightPadding, + second.implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + first.implicitHandleHeight + topPadding + bottomPadding, + second.implicitHandleHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/material/RectangularGlow.qml b/src/imports/controls/material/RectangularGlow.qml index 35ca8b46..58e11b9f 100644 --- a/src/imports/controls/material/RectangularGlow.qml +++ b/src/imports/controls/material/RectangularGlow.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 /* A cross-graphics API implementation of QtGraphicalEffects' RectangularGlow. diff --git a/src/imports/controls/material/RoundButton.qml b/src/imports/controls/material/RoundButton.qml index 92e6bc84..fafc92c7 100644 --- a/src/imports/controls/material/RoundButton.qml +++ b/src/imports/controls/material/RoundButton.qml @@ -34,23 +34,25 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.RoundButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) - // external vertical padding is 6 (to increase touch area) + topInset: 6 + leftInset: 6 + rightInset: 6 + bottomInset: 6 padding: 12 spacing: 6 @@ -79,14 +81,9 @@ T.RoundButton { // TODO: Add a proper ripple/ink effect for mouse/touch input and focus state background: Rectangle { - implicitWidth: 48 - implicitHeight: 48 + implicitWidth: control.Material.buttonHeight + implicitHeight: control.Material.buttonHeight - // external vertical padding is 6 (to increase touch area) - x: 6 - y: 6 - width: parent.width - 12 - height: parent.height - 12 radius: control.radius color: !control.enabled ? control.Material.buttonDisabledColor : control.checked || control.highlighted ? control.Material.highlightedButtonColor : control.Material.buttonColor diff --git a/src/imports/controls/material/ScrollBar.qml b/src/imports/controls/material/ScrollBar.qml index 2ff925af..01a33f9e 100644 --- a/src/imports/controls/material/ScrollBar.qml +++ b/src/imports/controls/material/ScrollBar.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.ScrollBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: control.interactive ? 1 : 2 visible: control.policy !== T.ScrollBar.AlwaysOff diff --git a/src/imports/controls/material/ScrollIndicator.qml b/src/imports/controls/material/ScrollIndicator.qml index 92727822..5578f29e 100644 --- a/src/imports/controls/material/ScrollIndicator.qml +++ b/src/imports/controls/material/ScrollIndicator.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.ScrollIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 2 diff --git a/src/imports/controls/material/Slider.qml b/src/imports/controls/material/Slider.qml index 1044354a..33b333fe 100644 --- a/src/imports/controls/material/Slider.qml +++ b/src/imports/controls/material/Slider.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.Slider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitHandleHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/material/SliderHandle.qml b/src/imports/controls/material/SliderHandle.qml index 64879a46..2ebbcccd 100644 --- a/src/imports/controls/material/SliderHandle.qml +++ b/src/imports/controls/material/SliderHandle.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 Item { id: root diff --git a/src/imports/controls/material/SpinBox.qml b/src/imports/controls/material/SpinBox.qml index cf9196ac..d0a09a10 100644 --- a/src/imports/controls/material/SpinBox.qml +++ b/src/imports/controls/material/SpinBox.qml @@ -34,23 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.SpinBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentItem.implicitWidth + - (up.indicator ? up.indicator.implicitWidth : 0) + - (down.indicator ? down.indicator.implicitWidth : 0)) - implicitHeight: Math.max(contentItem.implicitHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, - up.indicator ? up.indicator.implicitHeight : 0, - down.indicator ? down.indicator.implicitHeight : 0) - baselineOffset: contentItem.y + contentItem.baselineOffset + up.implicitIndicatorWidth + + down.implicitIndicatorWidth) + implicitHeight: Math.max(implicitContentHeight + topPadding + bottomPadding, + implicitBackgroundHeight, + up.implicitIndicatorHeight, + down.implicitIndicatorHeight) spacing: 6 topPadding: 8 @@ -83,8 +82,8 @@ T.SpinBox { up.indicator: Item { x: control.mirrored ? 0 : parent.width - width - implicitWidth: 48 - implicitHeight: 48 + implicitWidth: control.Material.touchTarget + implicitHeight: control.Material.touchTarget height: parent.height width: height @@ -117,8 +116,8 @@ T.SpinBox { down.indicator: Item { x: control.mirrored ? parent.width - width : 0 - implicitWidth: 48 - implicitHeight: 48 + implicitWidth: control.Material.touchTarget + implicitHeight: control.Material.touchTarget height: parent.height width: height @@ -144,7 +143,7 @@ T.SpinBox { background: Item { implicitWidth: 192 - implicitHeight: 48 + implicitHeight: control.Material.touchTarget Rectangle { x: parent.width / 2 - width / 2 diff --git a/src/imports/controls/material/StackView.qml b/src/imports/controls/material/StackView.qml index 8b69121b..6f76e2e3 100644 --- a/src/imports/controls/material/StackView.qml +++ b/src/imports/controls/material/StackView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.StackView { id: control diff --git a/src/imports/controls/material/SwipeDelegate.qml b/src/imports/controls/material/SwipeDelegate.qml index 1095ac68..fe036486 100644 --- a/src/imports/controls/material/SwipeDelegate.qml +++ b/src/imports/controls/material/SwipeDelegate.qml @@ -34,26 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.SwipeDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 - topPadding: 8 - bottomPadding: 8 + verticalPadding: 8 spacing: 16 icon.width: 24 @@ -75,7 +73,7 @@ T.SwipeDelegate { } background: Rectangle { - implicitHeight: 48 + implicitHeight: control.Material.delegateHeight color: control.Material.backgroundColor diff --git a/src/imports/controls/material/SwipeView.qml b/src/imports/controls/material/SwipeView.qml index eb753579..62d8b1a9 100644 --- a/src/imports/controls/material/SwipeView.qml +++ b/src/imports/controls/material/SwipeView.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.SwipeView { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) contentItem: ListView { model: control.contentModel diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml index d44a9f2c..677a57e8 100644 --- a/src/imports/controls/material/Switch.qml +++ b/src/imports/controls/material/Switch.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 -import QtQuick.Templates 2.4 as T +import QtQuick 2.12 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 +import QtQuick.Templates 2.5 as T T.Switch { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 8 spacing: 8 diff --git a/src/imports/controls/material/SwitchDelegate.qml b/src/imports/controls/material/SwitchDelegate.qml index 308e9772..1f1e5ffa 100644 --- a/src/imports/controls/material/SwitchDelegate.qml +++ b/src/imports/controls/material/SwitchDelegate.qml @@ -34,26 +34,24 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.SwitchDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 16 - topPadding: 8 - bottomPadding: 8 + verticalPadding: Material.switchDelegateVerticalPadding spacing: 16 icon.width: 24 @@ -82,7 +80,7 @@ T.SwitchDelegate { } background: Rectangle { - implicitHeight: 48 + implicitHeight: control.Material.delegateHeight color: control.highlighted ? control.Material.listHighlightColor : "transparent" diff --git a/src/imports/controls/material/SwitchIndicator.qml b/src/imports/controls/material/SwitchIndicator.qml index 2c5fc33d..f7567059 100644 --- a/src/imports/controls/material/SwitchIndicator.qml +++ b/src/imports/controls/material/SwitchIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 Item { id: indicator diff --git a/src/imports/controls/material/TabBar.qml b/src/imports/controls/material/TabBar.qml index c9410dfc..1e9444fb 100644 --- a/src/imports/controls/material/TabBar.qml +++ b/src/imports/controls/material/TabBar.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.TabBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) spacing: 1 diff --git a/src/imports/controls/material/TabButton.qml b/src/imports/controls/material/TabButton.qml index 3134cca9..c5cd8f9b 100644 --- a/src/imports/controls/material/TabButton.qml +++ b/src/imports/controls/material/TabButton.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.TabButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 12 spacing: 6 @@ -69,7 +68,7 @@ T.TabButton { } background: Ripple { - implicitHeight: 48 + implicitHeight: control.Material.touchTarget clip: true pressed: control.pressed diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml index 207d12c5..ce49af53 100644 --- a/src/imports/controls/material/TextArea.qml +++ b/src/imports/controls/material/TextArea.qml @@ -34,21 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.TextArea { id: control implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, - background ? background.implicitWidth : 0, + implicitBackgroundWidth + leftInset + rightInset, placeholder.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(contentHeight + 1 + topPadding + bottomPadding, - background ? background.implicitHeight : 0, + implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, + implicitBackgroundHeight + topInset + bottomInset, placeholder.implicitHeight + 1 + topPadding + bottomPadding) topPadding: 8 @@ -57,7 +57,7 @@ T.TextArea { color: enabled ? Material.foreground : Material.hintTextColor selectionColor: Material.accentColor selectedTextColor: Material.primaryHighlightedTextColor - + placeholderTextColor: Material.hintTextColor cursorDelegate: CursorDelegate { } PlaceholderText { @@ -68,7 +68,7 @@ T.TextArea { height: control.height - (control.topPadding + control.bottomPadding) text: control.placeholderText font: control.font - color: control.Material.hintTextColor + color: control.placeholderTextColor verticalAlignment: control.verticalAlignment elide: Text.ElideRight renderType: control.renderType diff --git a/src/imports/controls/material/TextField.qml b/src/imports/controls/material/TextField.qml index e8af67d4..7aa612eb 100644 --- a/src/imports/controls/material/TextField.qml +++ b/src/imports/controls/material/TextField.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.TextField { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0) - || contentWidth + leftPadding + rightPadding - implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, + implicitWidth: implicitBackgroundWidth + leftInset + rightInset + || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding, placeholder.implicitHeight + topPadding + bottomPadding) topPadding: 8 @@ -57,6 +56,7 @@ T.TextField { color: enabled ? Material.foreground : Material.hintTextColor selectionColor: Material.accentColor selectedTextColor: Material.primaryHighlightedTextColor + placeholderTextColor: Material.hintTextColor verticalAlignment: TextInput.AlignVCenter cursorDelegate: CursorDelegate { } @@ -69,7 +69,7 @@ T.TextField { height: control.height - (control.topPadding + control.bottomPadding) text: control.placeholderText font: control.font - color: control.Material.hintTextColor + color: control.placeholderTextColor verticalAlignment: control.verticalAlignment elide: Text.ElideRight renderType: control.renderType diff --git a/src/imports/controls/material/ToolBar.qml b/src/imports/controls/material/ToolBar.qml index 766856d0..9c09778b 100644 --- a/src/imports/controls/material/ToolBar.qml +++ b/src/imports/controls/material/ToolBar.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.ToolBar { id: control Material.elevation: 4 - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) Material.foreground: Material.toolTextColor diff --git a/src/imports/controls/material/ToolButton.qml b/src/imports/controls/material/ToolButton.qml index 86a9f5c0..55f1bd52 100644 --- a/src/imports/controls/material/ToolButton.qml +++ b/src/imports/controls/material/ToolButton.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Material 2.4 -import QtQuick.Controls.Material.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Material 2.5 +import QtQuick.Controls.Material.impl 2.5 T.ToolButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 spacing: 6 @@ -70,8 +69,8 @@ T.ToolButton { } background: Ripple { - implicitWidth: 48 - implicitHeight: 48 + implicitWidth: control.Material.touchTarget + implicitHeight: control.Material.touchTarget readonly property bool square: control.contentItem.width <= control.contentItem.height diff --git a/src/imports/controls/material/ToolSeparator.qml b/src/imports/controls/material/ToolSeparator.qml index d6feeb85..8120ac54 100644 --- a/src/imports/controls/material/ToolSeparator.qml +++ b/src/imports/controls/material/ToolSeparator.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.ToolSeparator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) - leftPadding: vertical ? 12 : 5 - rightPadding: vertical ? 12 : 5 - topPadding: vertical ? 5 : 12 - bottomPadding: vertical ? 5 : 12 + horizontalPadding: vertical ? 12 : 5 + verticalPadding: vertical ? 5 : 12 contentItem: Rectangle { implicitWidth: vertical ? 1 : 38 diff --git a/src/imports/controls/material/ToolTip.qml b/src/imports/controls/material/ToolTip.qml index bb7a9d7c..ced62f47 100644 --- a/src/imports/controls/material/ToolTip.qml +++ b/src/imports/controls/material/ToolTip.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.ToolTip { id: control @@ -44,15 +44,14 @@ T.ToolTip { x: parent ? (parent.width - implicitWidth) / 2 : 0 y: -implicitHeight - 24 - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) margins: 12 padding: 8 - leftPadding: padding + 8 - rightPadding: padding + 8 + horizontalPadding: padding + 8 closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent @@ -76,7 +75,7 @@ T.ToolTip { } background: Rectangle { - implicitHeight: 32 + implicitHeight: control.Material.tooltipHeight color: control.Material.tooltipColor opacity: 0.9 radius: 2 diff --git a/src/imports/controls/material/Tumbler.qml b/src/imports/controls/material/Tumbler.qml index d5c42422..c35b771a 100644 --- a/src/imports/controls/material/Tumbler.qml +++ b/src/imports/controls/material/Tumbler.qml @@ -34,16 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Material 2.4 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Material 2.5 T.Tumbler { id: control - implicitWidth: 60 - implicitHeight: 200 + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) || 60 // ### remove 60 in Qt 6 + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) || 200 // ### remove 200 in Qt 6 delegate: Text { text: modelData @@ -55,6 +58,8 @@ T.Tumbler { } contentItem: TumblerView { + implicitWidth: 60 + implicitHeight: 200 model: control.model delegate: control.delegate path: Path { diff --git a/src/imports/controls/material/material.pro b/src/imports/controls/material/material.pro index 9e04a23d..c3cbb355 100644 --- a/src/imports/controls/material/material.pro +++ b/src/imports/controls/material/material.pro @@ -1,6 +1,6 @@ TARGET = qtquickcontrols2materialstyleplugin TARGETPATH = QtQuick/Controls.2/Material -IMPORT_VERSION = 2.4 +IMPORT_VERSION = 2.5 QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private @@ -19,8 +19,7 @@ SOURCES += \ RESOURCES += \ $$PWD/qtquickcontrols2materialstyleplugin.qrc -!static: CONFIG += qmlcache -CONFIG += no_cxx_module +CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler load(qml_plugin) requires(qtConfig(quickcontrols2-material)) diff --git a/src/imports/controls/material/qmldir b/src/imports/controls/material/qmldir index d6ab0177..870a0382 100644 --- a/src/imports/controls/material/qmldir +++ b/src/imports/controls/material/qmldir @@ -1,4 +1,4 @@ module QtQuick.Controls.Material plugin qtquickcontrols2materialstyleplugin classname QtQuickControls2MaterialStylePlugin -depends QtQuick.Controls 2.4 +depends QtQuick.Controls 2.5 diff --git a/src/imports/controls/material/qquickmaterialstyle.cpp b/src/imports/controls/material/qquickmaterialstyle.cpp index 4dd4e128..77a65927 100644 --- a/src/imports/controls/material/qquickmaterialstyle.cpp +++ b/src/imports/controls/material/qquickmaterialstyle.cpp @@ -387,6 +387,10 @@ static bool globalPrimaryCustom = false; static bool globalAccentCustom = false; static bool globalForegroundCustom = true; static bool globalBackgroundCustom = true; +// This is global because: +// 1) The theme needs access to it to determine font sizes. +// 2) There can only be one variant used for the whole application. +static QQuickMaterialStyle::Variant globalVariant = QQuickMaterialStyle::Normal; static const QRgb backgroundColorLight = 0xFFFAFAFA; static const QRgb backgroundColorDark = 0xFF303030; @@ -439,7 +443,7 @@ QQuickMaterialStyle::QQuickMaterialStyle(QObject *parent) : QQuickAttachedObject m_foreground(globalForeground), m_background(globalBackground) { - init(); + QQuickAttachedObject::init(); } QQuickMaterialStyle *QQuickMaterialStyle::qmlAttachedProperties(QObject *object) @@ -1129,17 +1133,61 @@ QColor QQuickMaterialStyle::shade(const QColor &color, Shade shade) const } } -void QQuickMaterialStyle::attachedParentChange(QQuickAttachedObject *newParent, QQuickAttachedObject *oldParent) +int QQuickMaterialStyle::touchTarget() const { - Q_UNUSED(oldParent); - QQuickMaterialStyle *material = qobject_cast<QQuickMaterialStyle *>(newParent); - if (material) { - inheritPrimary(material->m_primary, material->m_customPrimary); - inheritAccent(material->m_accent, material->m_customAccent); - inheritForeground(material->m_foreground, material->m_customForeground, material->m_hasForeground); - inheritBackground(material->m_background, material->m_customBackground, material->m_hasBackground); - inheritTheme(material->theme()); - } + // https://material.io/guidelines/components/buttons.html#buttons-style + return globalVariant == Dense ? 44 : 48; +} + +int QQuickMaterialStyle::buttonHeight() const +{ + // https://material.io/guidelines/components/buttons.html#buttons-style + return globalVariant == Dense ? 32 : 36; +} + +int QQuickMaterialStyle::delegateHeight() const +{ + // https://material.io/guidelines/components/lists.html#lists-specs + return globalVariant == Dense ? 40 : 48; +} + +int QQuickMaterialStyle::dialogButtonBoxHeight() const +{ + return globalVariant == Dense ? 48 : 52; +} + +int QQuickMaterialStyle::frameVerticalPadding() const +{ + return globalVariant == Dense ? 8 : 12; +} + +int QQuickMaterialStyle::menuItemHeight() const +{ + // https://material.io/guidelines/components/menus.html#menus-simple-menus + return globalVariant == Dense ? 32 : 48; +} + +int QQuickMaterialStyle::menuItemVerticalPadding() const +{ + return globalVariant == Dense ? 8 : 12; +} + +int QQuickMaterialStyle::switchDelegateVerticalPadding() const +{ + // SwitchDelegate's indicator is much larger than the others due to the shadow, + // so we must reduce its padding to ensure its implicitHeight is 40 when dense. + return globalVariant == Dense ? 4 : 8; +} + +int QQuickMaterialStyle::tooltipHeight() const +{ + // https://material.io/guidelines/components/tooltips.html + return globalVariant == Dense ? 22 : 32; +} + +QQuickMaterialStyle::Variant QQuickMaterialStyle::variant() +{ + return globalVariant; } template <typename Enum> @@ -1159,88 +1207,101 @@ static QByteArray resolveSetting(const QByteArray &env, const QSharedPointer<QSe return value; } -void QQuickMaterialStyle::init() +void QQuickMaterialStyle::initGlobals() { - static bool globalsInitialized = false; - if (!globalsInitialized) { - QSharedPointer<QSettings> settings = QQuickStylePrivate::settings(QStringLiteral("Material")); + QSharedPointer<QSettings> settings = QQuickStylePrivate::settings(QStringLiteral("Material")); - bool ok = false; - QByteArray themeValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_THEME", settings, QStringLiteral("Theme")); - Theme themeEnum = toEnumValue<Theme>(themeValue, &ok); - if (ok) - globalTheme = m_theme = effectiveTheme(themeEnum); - else if (!themeValue.isEmpty()) - qWarning().nospace().noquote() << "Material: unknown theme value: " << themeValue; + bool ok = false; + QByteArray themeValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_THEME", settings, QStringLiteral("Theme")); + Theme themeEnum = toEnumValue<Theme>(themeValue, &ok); + if (ok) + globalTheme = effectiveTheme(themeEnum); + else if (!themeValue.isEmpty()) + qWarning().nospace().noquote() << "Material: unknown theme value: " << themeValue; - QByteArray primaryValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_PRIMARY", settings, QStringLiteral("Primary")); - Color primaryEnum = toEnumValue<Color>(primaryValue, &ok); - if (ok) { - globalPrimaryCustom = m_customPrimary = false; - globalPrimary = m_primary = primaryEnum; - } else { - QColor color(primaryValue.constData()); - if (color.isValid()) { - globalPrimaryCustom = m_customPrimary = true; - globalPrimary = m_primary = color.rgba(); - } else if (!primaryValue.isEmpty()) { - qWarning().nospace().noquote() << "Material: unknown primary value: " << primaryValue; - } - } + QByteArray variantValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_VARIANT", settings, QStringLiteral("Variant")); + Variant variantEnum = toEnumValue<Variant>(variantValue, &ok); + if (ok) + globalVariant = variantEnum; + else if (!variantValue.isEmpty()) + qWarning().nospace().noquote() << "Material: unknown variant value: " << variantValue; - QByteArray accentValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_ACCENT", settings, QStringLiteral("Accent")); - Color accentEnum = toEnumValue<Color>(accentValue, &ok); - if (ok) { - globalAccentCustom = m_customAccent = false; - globalAccent = m_accent = accentEnum; - } else if (!accentValue.isEmpty()) { - QColor color(accentValue.constData()); - if (color.isValid()) { - globalAccentCustom = m_customAccent = true; - globalAccent = m_accent = color.rgba(); - } else { - qWarning().nospace().noquote() << "Material: unknown accent value: " << accentValue; - } + QByteArray primaryValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_PRIMARY", settings, QStringLiteral("Primary")); + Color primaryEnum = toEnumValue<Color>(primaryValue, &ok); + if (ok) { + globalPrimaryCustom = false; + globalPrimary = primaryEnum; + } else { + QColor color(primaryValue.constData()); + if (color.isValid()) { + globalPrimaryCustom = true; + globalPrimary = color.rgba(); + } else if (!primaryValue.isEmpty()) { + qWarning().nospace().noquote() << "Material: unknown primary value: " << primaryValue; } + } - QByteArray foregroundValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_FOREGROUND", settings, QStringLiteral("Foreground")); - Color foregroundEnum = toEnumValue<Color>(foregroundValue, &ok); - if (ok) { - globalForegroundCustom = m_customForeground = false; - globalForeground = m_foreground = foregroundEnum; - hasGlobalForeground = m_hasForeground = true; - } else if (!foregroundValue.isEmpty()) { - QColor color(foregroundValue.constData()); - if (color.isValid()) { - globalForegroundCustom = m_customForeground = true; - globalForeground = m_foreground = color.rgba(); - hasGlobalForeground = m_hasForeground = true; - } else { - qWarning().nospace().noquote() << "Material: unknown foreground value: " << foregroundValue; - } + QByteArray accentValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_ACCENT", settings, QStringLiteral("Accent")); + Color accentEnum = toEnumValue<Color>(accentValue, &ok); + if (ok) { + globalAccentCustom = false; + globalAccent = accentEnum; + } else if (!accentValue.isEmpty()) { + QColor color(accentValue.constData()); + if (color.isValid()) { + globalAccentCustom = true; + globalAccent = color.rgba(); + } else { + qWarning().nospace().noquote() << "Material: unknown accent value: " << accentValue; } + } - QByteArray backgroundValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_BACKGROUND", settings, QStringLiteral("Background")); - Color backgroundEnum = toEnumValue<Color>(backgroundValue, &ok); - if (ok) { - globalBackgroundCustom = m_customBackground = false; - globalBackground = m_background = backgroundEnum; - hasGlobalBackground = m_hasBackground = true; - } else if (!backgroundValue.isEmpty()) { - QColor color(backgroundValue.constData()); - if (color.isValid()) { - globalBackgroundCustom = m_customBackground = true; - globalBackground = m_background = color.rgba(); - hasGlobalBackground = m_hasBackground = true; - } else { - qWarning().nospace().noquote() << "Material: unknown background value: " << backgroundValue; - } + QByteArray foregroundValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_FOREGROUND", settings, QStringLiteral("Foreground")); + Color foregroundEnum = toEnumValue<Color>(foregroundValue, &ok); + if (ok) { + globalForegroundCustom = false; + globalForeground = foregroundEnum; + hasGlobalForeground = true; + } else if (!foregroundValue.isEmpty()) { + QColor color(foregroundValue.constData()); + if (color.isValid()) { + globalForegroundCustom = true; + globalForeground = color.rgba(); + hasGlobalForeground = true; + } else { + qWarning().nospace().noquote() << "Material: unknown foreground value: " << foregroundValue; } + } - globalsInitialized = true; + QByteArray backgroundValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_BACKGROUND", settings, QStringLiteral("Background")); + Color backgroundEnum = toEnumValue<Color>(backgroundValue, &ok); + if (ok) { + globalBackgroundCustom = false; + globalBackground = backgroundEnum; + hasGlobalBackground = true; + } else if (!backgroundValue.isEmpty()) { + QColor color(backgroundValue.constData()); + if (color.isValid()) { + globalBackgroundCustom = true; + globalBackground = color.rgba(); + hasGlobalBackground = true; + } else { + qWarning().nospace().noquote() << "Material: unknown background value: " << backgroundValue; + } } +} - QQuickAttachedObject::init(); // TODO: lazy init? +void QQuickMaterialStyle::attachedParentChange(QQuickAttachedObject *newParent, QQuickAttachedObject *oldParent) +{ + Q_UNUSED(oldParent); + QQuickMaterialStyle *material = qobject_cast<QQuickMaterialStyle *>(newParent); + if (material) { + inheritPrimary(material->m_primary, material->m_customPrimary); + inheritAccent(material->m_accent, material->m_customAccent); + inheritForeground(material->m_foreground, material->m_customForeground, material->m_hasForeground); + inheritBackground(material->m_background, material->m_customBackground, material->m_hasBackground); + inheritTheme(material->theme()); + } } bool QQuickMaterialStyle::variantToRgba(const QVariant &var, const char *name, QRgb *rgba, bool *custom) const diff --git a/src/imports/controls/material/qquickmaterialstyle_p.h b/src/imports/controls/material/qquickmaterialstyle_p.h index 6008b1e0..4b0f7b31 100644 --- a/src/imports/controls/material/qquickmaterialstyle_p.h +++ b/src/imports/controls/material/qquickmaterialstyle_p.h @@ -98,6 +98,16 @@ class QQuickMaterialStyle : public QQuickAttachedObject Q_PROPERTY(QColor toolTextColor READ toolTextColor NOTIFY paletteChanged FINAL) Q_PROPERTY(QColor spinBoxDisabledIconColor READ spinBoxDisabledIconColor NOTIFY paletteChanged FINAL) + Q_PROPERTY(int touchTarget READ touchTarget CONSTANT FINAL) + Q_PROPERTY(int buttonHeight READ buttonHeight CONSTANT FINAL) + Q_PROPERTY(int delegateHeight READ delegateHeight CONSTANT FINAL) + Q_PROPERTY(int dialogButtonBoxHeight READ dialogButtonBoxHeight CONSTANT FINAL) + Q_PROPERTY(int frameVerticalPadding READ frameVerticalPadding CONSTANT FINAL) + Q_PROPERTY(int menuItemHeight READ menuItemHeight CONSTANT FINAL) + Q_PROPERTY(int menuItemVerticalPadding READ menuItemVerticalPadding CONSTANT FINAL) + Q_PROPERTY(int switchDelegateVerticalPadding READ switchDelegateVerticalPadding CONSTANT FINAL) + Q_PROPERTY(int tooltipHeight READ tooltipHeight CONSTANT FINAL) + public: enum Theme { Light, @@ -105,6 +115,11 @@ public: System }; + enum Variant { + Normal, + Dense + }; + enum Color { Red, Pink, @@ -145,6 +160,7 @@ public: }; Q_ENUM(Theme) + Q_ENUM(Variant) Q_ENUM(Color) Q_ENUM(Shade) @@ -225,6 +241,20 @@ public: Q_INVOKABLE QColor color(Color color, Shade shade = Shade500) const; Q_INVOKABLE QColor shade(const QColor &color, Shade shade) const; + int touchTarget() const; + int buttonHeight() const; + int delegateHeight() const; + int dialogButtonBoxHeight() const; + int frameVerticalPadding() const; + int menuItemHeight() const; + int menuItemVerticalPadding() const; + int switchDelegateVerticalPadding() const; + int tooltipHeight() const; + + static void initGlobals(); + + static Variant variant(); + Q_SIGNALS: void themeChanged(); void primaryChanged(); diff --git a/src/imports/controls/material/qquickmaterialtheme.cpp b/src/imports/controls/material/qquickmaterialtheme.cpp index c697b2a5..f42c0a03 100644 --- a/src/imports/controls/material/qquickmaterialtheme.cpp +++ b/src/imports/controls/material/qquickmaterialtheme.cpp @@ -35,16 +35,25 @@ ****************************************************************************/ #include "qquickmaterialtheme_p.h" +#include "qquickmaterialstyle_p.h" #include <QtGui/qpa/qplatformdialoghelper.h> #include <QtGui/qfont.h> #include <QtGui/qfontinfo.h> +#include <QtQuickTemplates2/private/qquicktheme_p.h> QT_BEGIN_NAMESPACE -QQuickMaterialTheme::QQuickMaterialTheme() - : QQuickTheme(QStringLiteral("Material")) +void QQuickMaterialTheme::initialize(QQuickTheme *theme) { + QFont systemFont; + QFont buttonFont; + QFont toolTipFont; + QFont itemViewFont; + QFont listViewFont; + QFont menuItemFont; + QFont editorFont; + QFont font; font.setFamily(QLatin1String("Roboto")); QString family = QFontInfo(font).family(); @@ -64,64 +73,40 @@ QQuickMaterialTheme::QQuickMaterialTheme() editorFont.setFamily(family); } - systemFont.setPixelSize(14); - systemFont = resolveFont(systemFont); + const bool dense = QQuickMaterialStyle::variant() == QQuickMaterialStyle::Dense; + systemFont.setPixelSize(dense ? 13 : 14); + theme->setFont(QQuickTheme::System, systemFont); - buttonFont.setPixelSize(14); + // https://material.io/guidelines/components/buttons.html#buttons-style + buttonFont.setPixelSize(dense ? 13 : 14); buttonFont.setCapitalization(QFont::AllUppercase); buttonFont.setWeight(QFont::Medium); - buttonFont = resolveFont(buttonFont); + theme->setFont(QQuickTheme::Button, buttonFont); + theme->setFont(QQuickTheme::TabBar, buttonFont); + theme->setFont(QQuickTheme::ToolBar, buttonFont); - toolTipFont.setPixelSize(14); + // https://material.io/guidelines/components/tooltips.html + toolTipFont.setPixelSize(dense ? 10 : 14); toolTipFont.setWeight(QFont::Medium); - toolTipFont = resolveFont(toolTipFont); + theme->setFont(QQuickTheme::ToolTip, toolTipFont); - itemViewFont.setPixelSize(14); + itemViewFont.setPixelSize(dense ? 13 : 14); itemViewFont.setWeight(QFont::Medium); - itemViewFont = resolveFont(itemViewFont); - - listViewFont.setPixelSize(16); - listViewFont = resolveFont(listViewFont); + theme->setFont(QQuickTheme::ItemView, itemViewFont); - menuItemFont.setPixelSize(16); - menuItemFont = resolveFont(menuItemFont); + // https://material.io/guidelines/components/lists.html#lists-specs + listViewFont.setPixelSize(dense ? 13 : 16); + theme->setFont(QQuickTheme::ListView, listViewFont); - editorFont.setPixelSize(16); - editorFont = resolveFont(editorFont); -} + menuItemFont.setPixelSize(dense ? 13 : 16); + theme->setFont(QQuickTheme::Menu, menuItemFont); + theme->setFont(QQuickTheme::MenuBar, menuItemFont); + theme->setFont(QQuickTheme::ComboBox, menuItemFont); -const QFont *QQuickMaterialTheme::font(QPlatformTheme::Font type) const -{ - switch (type) { - case QPlatformTheme::TabButtonFont: - case QPlatformTheme::PushButtonFont: - case QPlatformTheme::ToolButtonFont: - return &buttonFont; - case QPlatformTheme::TipLabelFont: - return &toolTipFont; - case QPlatformTheme::ItemViewFont: - return &itemViewFont; - case QPlatformTheme::ListViewFont: - return &listViewFont; - case QPlatformTheme::MenuBarFont: - case QPlatformTheme::MenuItemFont: - case QPlatformTheme::ComboMenuItemFont: - return &menuItemFont; - case QPlatformTheme::EditorFont: - return &editorFont; - default: - return &systemFont; - } -} - -QVariant QQuickMaterialTheme::themeHint(ThemeHint hint) const -{ - switch (hint) { - case QPlatformTheme::DialogButtonBoxLayout: - return QVariant(QPlatformDialogHelper::AndroidLayout); - default: - return QQuickProxyTheme::themeHint(hint); - } + editorFont.setPixelSize(dense ? 13 : 16); + theme->setFont(QQuickTheme::TextArea, editorFont); + theme->setFont(QQuickTheme::TextField, editorFont); + theme->setFont(QQuickTheme::SpinBox, editorFont); } QT_END_NAMESPACE diff --git a/src/imports/controls/material/qquickmaterialtheme_p.h b/src/imports/controls/material/qquickmaterialtheme_p.h index 0e791386..9a1362b8 100644 --- a/src/imports/controls/material/qquickmaterialtheme_p.h +++ b/src/imports/controls/material/qquickmaterialtheme_p.h @@ -48,29 +48,16 @@ // We mean it. // -#include <QtCore/qvariant.h> -#include <QtGui/qfont.h> -#include <QtQuickControls2/private/qquicktheme_p.h> +#include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE -class QQuickMaterialTheme : public QQuickTheme +class QQuickTheme; + +class QQuickMaterialTheme { public: - explicit QQuickMaterialTheme(); - - const QFont *font(Font type = SystemFont) const override; - - QVariant themeHint(ThemeHint hint) const override; - -private: - QFont systemFont; - QFont buttonFont; - QFont toolTipFont; - QFont itemViewFont; - QFont listViewFont; - QFont menuItemFont; - QFont editorFont; + static void initialize(QQuickTheme *theme); }; QT_END_NAMESPACE diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp index 33c14d04..d407af94 100644 --- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp +++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp @@ -45,14 +45,6 @@ #include <QtQuickControls2/private/qquickstyleselector_p.h> #include <QtQuickControls2/private/qquickpaddedrectangle_p.h> -static inline void initResources() -{ - Q_INIT_RESOURCE(qtquickcontrols2materialstyleplugin); -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtQuick_Controls_2_Material); -#endif -} - QT_BEGIN_NAMESPACE class QtQuickControls2MaterialStylePlugin : public QQuickStylePlugin @@ -66,12 +58,12 @@ public: void registerTypes(const char *uri) override; QString name() const override; - QQuickProxyTheme *createTheme() const override; + void initializeTheme(QQuickTheme *theme) override; }; QtQuickControls2MaterialStylePlugin::QtQuickControls2MaterialStylePlugin(QObject *parent) : QQuickStylePlugin(parent) { - initResources(); + QQuickMaterialStyle::initGlobals(); } void QtQuickControls2MaterialStylePlugin::registerTypes(const char *uri) @@ -85,24 +77,24 @@ void QtQuickControls2MaterialStylePlugin::registerTypes(const char *uri) qmlRegisterType<QQuickMaterialBusyIndicator>(import, 2, 0, "BusyIndicatorImpl"); qmlRegisterType<QQuickMaterialProgressBar>(import, 2, 0, "ProgressBarImpl"); qmlRegisterType<QQuickMaterialRipple>(import, 2, 0, "Ripple"); - qmlRegisterType(typeUrl(QStringLiteral("BoxShadow.qml")), import, 2, 0, "BoxShadow"); - qmlRegisterType(typeUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator"); - qmlRegisterType(typeUrl(QStringLiteral("CursorDelegate.qml")), import, 2, 0, "CursorDelegate"); - qmlRegisterType(typeUrl(QStringLiteral("ElevationEffect.qml")), import, 2, 0, "ElevationEffect"); - qmlRegisterType(typeUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 0, "RadioIndicator"); - qmlRegisterType(typeUrl(QStringLiteral("RectangularGlow.qml")), import, 2, 0, "RectangularGlow"); - qmlRegisterType(typeUrl(QStringLiteral("SliderHandle.qml")), import, 2, 0, "SliderHandle"); - qmlRegisterType(typeUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 0, "SwitchIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("BoxShadow.qml")), import, 2, 0, "BoxShadow"); + qmlRegisterType(resolvedUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("CursorDelegate.qml")), import, 2, 0, "CursorDelegate"); + qmlRegisterType(resolvedUrl(QStringLiteral("ElevationEffect.qml")), import, 2, 0, "ElevationEffect"); + qmlRegisterType(resolvedUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 0, "RadioIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("RectangularGlow.qml")), import, 2, 0, "RectangularGlow"); + qmlRegisterType(resolvedUrl(QStringLiteral("SliderHandle.qml")), import, 2, 0, "SliderHandle"); + qmlRegisterType(resolvedUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 0, "SwitchIndicator"); } QString QtQuickControls2MaterialStylePlugin::name() const { - return QStringLiteral("material"); + return QStringLiteral("Material"); } -QQuickProxyTheme *QtQuickControls2MaterialStylePlugin::createTheme() const +void QtQuickControls2MaterialStylePlugin::initializeTheme(QQuickTheme *theme) { - return new QQuickMaterialTheme; + QQuickMaterialTheme::initialize(theme); } QT_END_NAMESPACE diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes index 5011365c..949eea62 100644 --- a/src/imports/controls/plugins.qmltypes +++ b/src/imports/controls/plugins.qmltypes @@ -4,12 +4,12 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtQuick.Controls 2.4 -merge ../templates/plugins.qmltypes -dependencies dependencies.json' +// 'qmlplugindump -nonrelocatable QtQuick.Controls 2.5 -merge ../templates/plugins.qmltypes -dependencies dependencies.json' Module { dependencies: [ "QtQuick 2.11", - "QtQuick.Templates 2.4", + "QtQuick.Templates 2.5", "QtQuick.Window 2.2" ] Component { @@ -658,9 +658,10 @@ Module { "QtQuick.Templates/AbstractButton 2.0", "QtQuick.Templates/AbstractButton 2.2", "QtQuick.Templates/AbstractButton 2.3", - "QtQuick.Templates/AbstractButton 2.4" + "QtQuick.Templates/AbstractButton 2.4", + "QtQuick.Templates/AbstractButton 2.5" ] - exportMetaObjectRevisions: [0, 2, 3, 4] + exportMetaObjectRevisions: [0, 2, 3, 4, 5] Enum { name: "Display" values: { @@ -685,6 +686,8 @@ Module { Property { name: "autoRepeatInterval"; revision: 4; type: "int" } Property { name: "pressX"; revision: 4; type: "double"; isReadonly: true } Property { name: "pressY"; revision: 4; type: "double"; isReadonly: true } + Property { name: "implicitIndicatorWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitIndicatorHeight"; revision: 5; type: "double"; isReadonly: true } Signal { name: "pressed" } Signal { name: "released" } Signal { name: "canceled" } @@ -699,6 +702,8 @@ Module { Signal { name: "autoRepeatIntervalChanged"; revision: 4 } Signal { name: "pressXChanged"; revision: 4 } Signal { name: "pressYChanged"; revision: 4 } + Signal { name: "implicitIndicatorWidthChanged"; revision: 5 } + Signal { name: "implicitIndicatorHeightChanged"; revision: 5 } Method { name: "toggle" } } Component { @@ -909,9 +914,10 @@ Module { exports: [ "QtQuick.Templates/ComboBox 2.0", "QtQuick.Templates/ComboBox 2.1", - "QtQuick.Templates/ComboBox 2.2" + "QtQuick.Templates/ComboBox 2.2", + "QtQuick.Templates/ComboBox 2.5" ] - exportMetaObjectRevisions: [0, 1, 2] + exportMetaObjectRevisions: [0, 1, 2, 5] Property { name: "count"; type: "int"; isReadonly: true } Property { name: "model"; type: "QVariant" } Property { name: "delegateModel"; type: "QQmlInstanceModel"; isReadonly: true; isPointer: true } @@ -932,6 +938,8 @@ Module { Property { name: "inputMethodHints"; revision: 2; type: "Qt::InputMethodHints" } Property { name: "inputMethodComposing"; revision: 2; type: "bool"; isReadonly: true } Property { name: "acceptableInput"; revision: 2; type: "bool"; isReadonly: true } + Property { name: "implicitIndicatorWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitIndicatorHeight"; revision: 5; type: "double"; isReadonly: true } Signal { name: "activated" Parameter { name: "index"; type: "int" } @@ -949,6 +957,8 @@ Module { Signal { name: "inputMethodHintsChanged"; revision: 2 } Signal { name: "inputMethodComposingChanged"; revision: 2 } Signal { name: "acceptableInputChanged"; revision: 2 } + Signal { name: "implicitIndicatorWidthChanged"; revision: 5 } + Signal { name: "implicitIndicatorHeightChanged"; revision: 5 } Method { name: "incrementCurrentIndex" } Method { name: "decrementCurrentIndex" } Method { name: "selectAll"; revision: 2 } @@ -976,15 +986,20 @@ Module { exports: [ "QtQuick.Templates/Container 2.0", "QtQuick.Templates/Container 2.1", - "QtQuick.Templates/Container 2.3" + "QtQuick.Templates/Container 2.3", + "QtQuick.Templates/Container 2.5" ] - exportMetaObjectRevisions: [0, 1, 3] + exportMetaObjectRevisions: [0, 1, 3, 5] Property { name: "count"; type: "int"; isReadonly: true } Property { name: "contentModel"; type: "QVariant"; isReadonly: true } Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } Property { name: "contentChildren"; type: "QQuickItem"; isList: true; isReadonly: true } Property { name: "currentIndex"; type: "int" } Property { name: "currentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } + Property { name: "contentWidth"; revision: 5; type: "double" } + Property { name: "contentHeight"; revision: 5; type: "double" } + Signal { name: "contentWidthChanged"; revision: 5 } + Signal { name: "contentHeightChanged"; revision: 5 } Method { name: "setCurrentIndex" Parameter { name: "index"; type: "int" } @@ -1021,15 +1036,17 @@ Module { Parameter { name: "index"; type: "int" } } } + Component { name: "QQuickContentItem"; defaultProperty: "data"; prototype: "QQuickItem" } Component { name: "QQuickControl" defaultProperty: "data" prototype: "QQuickItem" exports: [ "QtQuick.Templates/Control 2.0", - "QtQuick.Templates/Control 2.3" + "QtQuick.Templates/Control 2.3", + "QtQuick.Templates/Control 2.5" ] - exportMetaObjectRevisions: [0, 3] + exportMetaObjectRevisions: [0, 3, 5] Property { name: "font"; type: "QFont" } Property { name: "availableWidth"; type: "double"; isReadonly: true } Property { name: "availableHeight"; type: "double"; isReadonly: true } @@ -1049,8 +1066,29 @@ Module { Property { name: "wheelEnabled"; type: "bool" } Property { name: "background"; type: "QQuickItem"; isPointer: true } Property { name: "contentItem"; type: "QQuickItem"; isPointer: true } + Property { name: "baselineOffset"; type: "double" } Property { name: "palette"; revision: 3; type: "QPalette" } + Property { name: "horizontalPadding"; revision: 5; type: "double" } + Property { name: "verticalPadding"; revision: 5; type: "double" } + Property { name: "implicitContentWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitContentHeight"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitBackgroundWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitBackgroundHeight"; revision: 5; type: "double"; isReadonly: true } + Property { name: "topInset"; revision: 5; type: "double" } + Property { name: "leftInset"; revision: 5; type: "double" } + Property { name: "rightInset"; revision: 5; type: "double" } + Property { name: "bottomInset"; revision: 5; type: "double" } Signal { name: "paletteChanged"; revision: 3 } + Signal { name: "horizontalPaddingChanged"; revision: 5 } + Signal { name: "verticalPaddingChanged"; revision: 5 } + Signal { name: "implicitContentWidthChanged"; revision: 5 } + Signal { name: "implicitContentHeightChanged"; revision: 5 } + Signal { name: "implicitBackgroundWidthChanged"; revision: 5 } + Signal { name: "implicitBackgroundHeightChanged"; revision: 5 } + Signal { name: "topInsetChanged"; revision: 5 } + Signal { name: "leftInsetChanged"; revision: 5 } + Signal { name: "rightInsetChanged"; revision: 5 } + Signal { name: "bottomInsetChanged"; revision: 5 } } Component { name: "QQuickDelayButton" @@ -1099,9 +1137,10 @@ Module { prototype: "QQuickPopup" exports: [ "QtQuick.Templates/Dialog 2.1", - "QtQuick.Templates/Dialog 2.3" + "QtQuick.Templates/Dialog 2.3", + "QtQuick.Templates/Dialog 2.5" ] - exportMetaObjectRevisions: [0, 3] + exportMetaObjectRevisions: [0, 3, 5] Enum { name: "StandardCode" values: { @@ -1114,6 +1153,10 @@ Module { Property { name: "footer"; type: "QQuickItem"; isPointer: true } Property { name: "standardButtons"; type: "QPlatformDialogHelper::StandardButtons" } Property { name: "result"; revision: 3; type: "int" } + Property { name: "implicitHeaderWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitHeaderHeight"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitFooterWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitFooterHeight"; revision: 5; type: "double"; isReadonly: true } Signal { name: "accepted" } Signal { name: "rejected" } Signal { name: "applied"; revision: 3 } @@ -1140,9 +1183,10 @@ Module { prototype: "QQuickContainer" exports: [ "QtQuick.Templates/DialogButtonBox 2.1", - "QtQuick.Templates/DialogButtonBox 2.3" + "QtQuick.Templates/DialogButtonBox 2.3", + "QtQuick.Templates/DialogButtonBox 2.5" ] - exportMetaObjectRevisions: [0, 3] + exportMetaObjectRevisions: [0, 3, 5] attachedType: "QQuickDialogButtonBoxAttached" Enum { name: "Position" @@ -1151,10 +1195,23 @@ Module { "Footer": 1 } } + Enum { + name: "ButtonLayout" + values: { + "UnknownLayout": -1, + "WinLayout": 0, + "MacLayout": 1, + "KdeLayout": 2, + "GnomeLayout": 3, + "MacModelessLayout": 4, + "AndroidLayout": 5 + } + } Property { name: "position"; type: "Position" } Property { name: "alignment"; type: "Qt::Alignment" } Property { name: "standardButtons"; type: "QPlatformDialogHelper::StandardButtons" } Property { name: "delegate"; type: "QQmlComponent"; isPointer: true } + Property { name: "buttonLayout"; revision: 5; type: "ButtonLayout" } Signal { name: "accepted" } Signal { name: "rejected" } Signal { name: "helpRequested" } @@ -1165,6 +1222,7 @@ Module { Signal { name: "applied"; revision: 3 } Signal { name: "reset"; revision: 3 } Signal { name: "discarded"; revision: 3 } + Signal { name: "buttonLayoutChanged"; revision: 5 } Method { name: "standardButton" type: "QQuickAbstractButton*" @@ -1203,12 +1261,18 @@ Module { name: "QQuickGroupBox" defaultProperty: "contentData" prototype: "QQuickFrame" - exports: ["QtQuick.Templates/GroupBox 2.0"] - exportMetaObjectRevisions: [0] + exports: [ + "QtQuick.Templates/GroupBox 2.0", + "QtQuick.Templates/GroupBox 2.5" + ] + exportMetaObjectRevisions: [0, 5] Property { name: "title"; type: "string" } Property { name: "label"; type: "QQuickItem"; isPointer: true } + Property { name: "implicitLabelWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitLabelHeight"; revision: 5; type: "double"; isReadonly: true } + Signal { name: "implicitLabelWidthChanged"; revision: 5 } + Signal { name: "implicitLabelHeightChanged"; revision: 5 } } - Component { name: "QQuickIcon" Property { name: "name"; type: "string" } @@ -1217,7 +1281,6 @@ Module { Property { name: "height"; type: "int" } Property { name: "color"; type: "QColor" } } - Component { name: "QQuickItemDelegate" defaultProperty: "data" @@ -1455,18 +1518,22 @@ Module { Component { name: "QQuickPage" defaultProperty: "contentData" - prototype: "QQuickControl" - exports: ["QtQuick.Templates/Page 2.0", "QtQuick.Templates/Page 2.1"] - exportMetaObjectRevisions: [0, 1] + prototype: "QQuickPane" + exports: [ + "QtQuick.Templates/Page 2.0", + "QtQuick.Templates/Page 2.1", + "QtQuick.Templates/Page 2.5" + ] + exportMetaObjectRevisions: [0, 1, 5] Property { name: "title"; type: "string" } Property { name: "header"; type: "QQuickItem"; isPointer: true } Property { name: "footer"; type: "QQuickItem"; isPointer: true } - Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "contentChildren"; type: "QQuickItem"; isList: true; isReadonly: true } Property { name: "contentWidth"; revision: 1; type: "double" } Property { name: "contentHeight"; revision: 1; type: "double" } - Signal { name: "contentWidthChanged"; revision: 1 } - Signal { name: "contentHeightChanged"; revision: 1 } + Property { name: "implicitHeaderWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitHeaderHeight"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitFooterWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitFooterHeight"; revision: 5; type: "double"; isReadonly: true } } Component { name: "QQuickPageIndicator" @@ -1497,9 +1564,10 @@ Module { exports: [ "QtQuick.Templates/Popup 2.0", "QtQuick.Templates/Popup 2.1", - "QtQuick.Templates/Popup 2.3" + "QtQuick.Templates/Popup 2.3", + "QtQuick.Templates/Popup 2.5" ] - exportMetaObjectRevisions: [0, 1, 3] + exportMetaObjectRevisions: [0, 1, 3, 5] Enum { name: "ClosePolicy" values: { @@ -1570,6 +1638,23 @@ Module { Property { name: "mirrored"; revision: 3; type: "bool"; isReadonly: true } Property { name: "enabled"; revision: 3; type: "bool" } Property { name: "palette"; revision: 3; type: "QPalette" } + Property { name: "horizontalPadding"; type: "double" } + Property { name: "verticalPadding"; type: "double" } + Property { + name: "anchors" + revision: 5 + type: "QQuickPopupAnchors" + isReadonly: true + isPointer: true + } + Property { name: "implicitContentWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitContentHeight"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitBackgroundWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitBackgroundHeight"; revision: 5; type: "double"; isReadonly: true } + Property { name: "topInset"; revision: 5; type: "double" } + Property { name: "leftInset"; revision: 5; type: "double" } + Property { name: "rightInset"; revision: 5; type: "double" } + Property { name: "bottomInset"; revision: 5; type: "double" } Signal { name: "opened" } Signal { name: "closed" } Signal { name: "aboutToShow" } @@ -1583,6 +1668,16 @@ Module { Signal { name: "mirroredChanged"; revision: 3 } Signal { name: "enabledChanged"; revision: 3 } Signal { name: "paletteChanged"; revision: 3 } + Signal { name: "horizontalPaddingChanged"; revision: 5 } + Signal { name: "verticalPaddingChanged"; revision: 5 } + Signal { name: "implicitContentWidthChanged"; revision: 5 } + Signal { name: "implicitContentHeightChanged"; revision: 5 } + Signal { name: "implicitBackgroundWidthChanged"; revision: 5 } + Signal { name: "implicitBackgroundHeightChanged"; revision: 5 } + Signal { name: "topInsetChanged"; revision: 5 } + Signal { name: "leftInsetChanged"; revision: 5 } + Signal { name: "rightInsetChanged"; revision: 5 } + Signal { name: "bottomInsetChanged"; revision: 5 } Method { name: "open" } Method { name: "close" } Method { @@ -1592,6 +1687,12 @@ Module { Method { name: "forceActiveFocus" } } Component { + name: "QQuickPopupAnchors" + prototype: "QObject" + Property { name: "centerIn"; type: "QQuickItem"; isPointer: true } + } + Component { name: "QQuickPopupItem"; defaultProperty: "contentData"; prototype: "QQuickPage" } + Component { name: "QQuickProgressBar" defaultProperty: "data" prototype: "QQuickControl" @@ -1626,9 +1727,10 @@ Module { "QtQuick.Templates/RangeSlider 2.0", "QtQuick.Templates/RangeSlider 2.1", "QtQuick.Templates/RangeSlider 2.2", - "QtQuick.Templates/RangeSlider 2.3" + "QtQuick.Templates/RangeSlider 2.3", + "QtQuick.Templates/RangeSlider 2.5" ] - exportMetaObjectRevisions: [0, 1, 2, 3] + exportMetaObjectRevisions: [0, 1, 2, 3, 5] Enum { name: "SnapMode" values: { @@ -1647,12 +1749,20 @@ Module { Property { name: "live"; revision: 2; type: "bool" } Property { name: "horizontal"; revision: 3; type: "bool"; isReadonly: true } Property { name: "vertical"; revision: 3; type: "bool"; isReadonly: true } + Property { name: "touchDragThreshold"; revision: 5; type: "double" } Signal { name: "liveChanged"; revision: 2 } + Signal { name: "touchDragThresholdChanged"; revision: 5 } Method { name: "setValues" Parameter { name: "firstValue"; type: "double" } Parameter { name: "secondValue"; type: "double" } } + Method { + name: "valueAt" + revision: 5 + type: "double" + Parameter { name: "position"; type: "double" } + } } Component { name: "QQuickRangeSliderNode" @@ -1663,7 +1773,10 @@ Module { Property { name: "handle"; type: "QQuickItem"; isPointer: true } Property { name: "pressed"; type: "bool" } Property { name: "hovered"; revision: 1; type: "bool" } + Property { name: "implicitHandleWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitHandleHeight"; revision: 5; type: "double"; isReadonly: true } Signal { name: "hoveredChanged"; revision: 1 } + Signal { name: "moved" } Method { name: "increase" } Method { name: "decrease" } } @@ -1781,13 +1894,9 @@ Module { Component { name: "QQuickScrollView" defaultProperty: "contentData" - prototype: "QQuickControl" + prototype: "QQuickPane" exports: ["QtQuick.Templates/ScrollView 2.2"] exportMetaObjectRevisions: [0] - Property { name: "contentWidth"; type: "double" } - Property { name: "contentHeight"; type: "double" } - Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "contentChildren"; type: "QQuickItem"; isList: true; isReadonly: true } } Component { name: "QQuickSlider" @@ -1797,9 +1906,10 @@ Module { "QtQuick.Templates/Slider 2.0", "QtQuick.Templates/Slider 2.1", "QtQuick.Templates/Slider 2.2", - "QtQuick.Templates/Slider 2.3" + "QtQuick.Templates/Slider 2.3", + "QtQuick.Templates/Slider 2.5" ] - exportMetaObjectRevisions: [0, 1, 2, 3] + exportMetaObjectRevisions: [0, 1, 2, 3, 5] Enum { name: "SnapMode" values: { @@ -1821,8 +1931,14 @@ Module { Property { name: "live"; revision: 2; type: "bool" } Property { name: "horizontal"; revision: 3; type: "bool"; isReadonly: true } Property { name: "vertical"; revision: 3; type: "bool"; isReadonly: true } + Property { name: "touchDragThreshold"; revision: 5; type: "double" } + Property { name: "implicitHandleWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitHandleHeight"; revision: 5; type: "double"; isReadonly: true } Signal { name: "moved"; revision: 2 } Signal { name: "liveChanged"; revision: 2 } + Signal { name: "touchDragThresholdChanged"; revision: 5 } + Signal { name: "implicitHandleWidthChanged"; revision: 5 } + Signal { name: "implicitHandleHeightChanged"; revision: 5 } Method { name: "increase" } Method { name: "decrease" } Method { @@ -1841,9 +1957,10 @@ Module { "QtQuick.Templates/SpinBox 2.1", "QtQuick.Templates/SpinBox 2.2", "QtQuick.Templates/SpinBox 2.3", - "QtQuick.Templates/SpinBox 2.4" + "QtQuick.Templates/SpinBox 2.4", + "QtQuick.Templates/SpinBox 2.5" ] - exportMetaObjectRevisions: [0, 1, 2, 3, 4] + exportMetaObjectRevisions: [0, 1, 2, 3, 4, 5] Property { name: "from"; type: "int" } Property { name: "to"; type: "int" } Property { name: "value"; type: "int" } @@ -1872,7 +1989,11 @@ Module { Property { name: "pressed"; type: "bool" } Property { name: "indicator"; type: "QQuickItem"; isPointer: true } Property { name: "hovered"; revision: 1; type: "bool" } + Property { name: "implicitIndicatorWidth"; revision: 5; type: "double"; isReadonly: true } + Property { name: "implicitIndicatorHeight"; revision: 5; type: "double"; isReadonly: true } Signal { name: "hoveredChanged"; revision: 1 } + Signal { name: "implicitIndicatorWidthChanged"; revision: 5 } + Signal { name: "implicitIndicatorHeightChanged"; revision: 5 } } Component { name: "QQuickStackView" @@ -2089,8 +2210,6 @@ Module { Property { name: "position"; type: "Position" } Property { name: "contentWidth"; revision: 2; type: "double" } Property { name: "contentHeight"; revision: 2; type: "double" } - Signal { name: "contentWidthChanged"; revision: 2 } - Signal { name: "contentHeightChanged"; revision: 2 } } Component { name: "QQuickTabBarAttached" @@ -2113,9 +2232,10 @@ Module { exports: [ "QtQuick.Templates/TextArea 2.0", "QtQuick.Templates/TextArea 2.1", - "QtQuick.Templates/TextArea 2.3" + "QtQuick.Templates/TextArea 2.3", + "QtQuick.Templates/TextArea 2.5" ] - exportMetaObjectRevisions: [0, 1, 3] + exportMetaObjectRevisions: [0, 1, 3, 5] attachedType: "QQuickTextAreaAttached" Property { name: "font"; type: "QFont" } Property { name: "implicitWidth"; type: "double" } @@ -2126,6 +2246,7 @@ Module { Property { name: "hovered"; revision: 1; type: "bool"; isReadonly: true } Property { name: "hoverEnabled"; revision: 1; type: "bool" } Property { name: "palette"; revision: 3; type: "QPalette" } + Property { name: "placeholderTextColor"; revision: 5; type: "QColor" } Signal { name: "implicitWidthChanged3" } Signal { name: "implicitHeightChanged3" } Signal { @@ -2145,6 +2266,7 @@ Module { Signal { name: "hoveredChanged"; revision: 1 } Signal { name: "hoverEnabledChanged"; revision: 1 } Signal { name: "paletteChanged"; revision: 3 } + Signal { name: "placeholderTextColorChanged"; revision: 5 } } Component { name: "QQuickTextAreaAttached" @@ -2158,9 +2280,10 @@ Module { exports: [ "QtQuick.Templates/TextField 2.0", "QtQuick.Templates/TextField 2.1", - "QtQuick.Templates/TextField 2.3" + "QtQuick.Templates/TextField 2.3", + "QtQuick.Templates/TextField 2.5" ] - exportMetaObjectRevisions: [0, 1, 3] + exportMetaObjectRevisions: [0, 1, 3, 5] Property { name: "font"; type: "QFont" } Property { name: "implicitWidth"; type: "double" } Property { name: "implicitHeight"; type: "double" } @@ -2170,6 +2293,7 @@ Module { Property { name: "hovered"; revision: 1; type: "bool"; isReadonly: true } Property { name: "hoverEnabled"; revision: 1; type: "bool" } Property { name: "palette"; revision: 3; type: "QPalette" } + Property { name: "placeholderTextColor"; revision: 5; type: "QColor" } Signal { name: "implicitWidthChanged3" } Signal { name: "implicitHeightChanged3" } Signal { @@ -2189,6 +2313,7 @@ Module { Signal { name: "hoveredChanged"; revision: 1 } Signal { name: "hoverEnabledChanged"; revision: 1 } Signal { name: "paletteChanged"; revision: 3 } + Signal { name: "placeholderTextColorChanged"; revision: 5 } } Component { name: "QQuickToolBar" @@ -2226,12 +2351,27 @@ Module { name: "QQuickToolTip" defaultProperty: "contentData" prototype: "QQuickPopup" - exports: ["QtQuick.Templates/ToolTip 2.0"] - exportMetaObjectRevisions: [0] + exports: [ + "QtQuick.Templates/ToolTip 2.0", + "QtQuick.Templates/ToolTip 2.5" + ] + exportMetaObjectRevisions: [0, 5] attachedType: "QQuickToolTipAttached" Property { name: "delay"; type: "int" } Property { name: "timeout"; type: "int" } Property { name: "text"; type: "string" } + Method { + name: "show" + revision: 5 + Parameter { name: "text"; type: "string" } + Parameter { name: "ms"; type: "int" } + } + Method { + name: "show" + revision: 5 + Parameter { name: "text"; type: "string" } + } + Method { name: "hide"; revision: 5 } } Component { name: "QQuickToolTipAttached" @@ -2263,6 +2403,17 @@ Module { ] exportMetaObjectRevisions: [0, 1, 2] attachedType: "QQuickTumblerAttached" + Enum { + name: "PositionMode" + values: { + "Beginning": 0, + "Center": 1, + "End": 2, + "Visible": 3, + "Contain": 4, + "SnapPosition": 5 + } + } Property { name: "model"; type: "QVariant" } Property { name: "count"; type: "int"; isReadonly: true } Property { name: "currentIndex"; type: "int" } @@ -2273,6 +2424,12 @@ Module { Property { name: "moving"; revision: 2; type: "bool"; isReadonly: true } Signal { name: "wrapChanged"; revision: 1 } Signal { name: "movingChanged"; revision: 2 } + Method { + name: "positionViewAtIndex" + revision: 5 + Parameter { name: "index"; type: "int" } + Parameter { name: "mode"; type: "PositionMode" } + } } Component { name: "QQuickTumblerAttached" diff --git a/src/imports/controls/qmldir b/src/imports/controls/qmldir index de40013f..c9ccb8f9 100644 --- a/src/imports/controls/qmldir +++ b/src/imports/controls/qmldir @@ -1,5 +1,5 @@ module QtQuick.Controls plugin qtquickcontrols2plugin classname QtQuickControls2Plugin -depends QtQuick.Templates 2.4 +depends QtQuick.Templates 2.5 designersupported diff --git a/src/imports/controls/qquickdefaulttheme.cpp b/src/imports/controls/qquickdefaulttheme.cpp index f4b6f5d7..bc292c2f 100644 --- a/src/imports/controls/qquickdefaulttheme.cpp +++ b/src/imports/controls/qquickdefaulttheme.cpp @@ -36,11 +36,14 @@ #include "qquickdefaulttheme_p.h" +#include <QtQuickTemplates2/private/qquicktheme_p.h> + QT_BEGIN_NAMESPACE -QQuickDefaultTheme::QQuickDefaultTheme() - : QQuickTheme(QStringLiteral("Default")) +void QQuickDefaultTheme::initialize(QQuickTheme *theme) { + QPalette systemPalette; + systemPalette.setColor(QPalette::Base, QColor::fromRgba(0xFFFFFFFF)); systemPalette.setColor(QPalette::Disabled, QPalette::Base, QColor::fromRgba(0xFFD6D6D6)); @@ -80,13 +83,7 @@ QQuickDefaultTheme::QQuickDefaultTheme() systemPalette.setColor(QPalette::WindowText, QColor::fromRgba(0xFF26282A)); systemPalette.setColor(QPalette::Disabled, QPalette::WindowText, QColor::fromRgba(0xFFBDBEBF)); - systemPalette = resolvePalette(systemPalette); -} - -const QPalette *QQuickDefaultTheme::palette(QPlatformTheme::Palette type) const -{ - Q_UNUSED(type); - return &systemPalette; + theme->setPalette(QQuickTheme::System, systemPalette); } QT_END_NAMESPACE diff --git a/src/imports/controls/qquickdefaulttheme_p.h b/src/imports/controls/qquickdefaulttheme_p.h index 16e4d061..3a7311c7 100644 --- a/src/imports/controls/qquickdefaulttheme_p.h +++ b/src/imports/controls/qquickdefaulttheme_p.h @@ -48,19 +48,16 @@ // We mean it. // -#include <QtQuickControls2/private/qquicktheme_p.h> +#include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE -class QQuickDefaultTheme : public QQuickTheme +class QQuickTheme; + +class QQuickDefaultTheme { public: - explicit QQuickDefaultTheme(); - - const QPalette *palette(Palette type) const override; - -private: - QPalette systemPalette; + static void initialize(QQuickTheme *theme); }; QT_END_NAMESPACE diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 76086376..754e76ab 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -34,7 +34,13 @@ ** ****************************************************************************/ +#include <QtCore/qdir.h> +#include <QtCore/qfile.h> +#include <QtCore/qfileinfo.h> +#include <QtCore/qpluginloader.h> #include <QtCore/private/qfileselector_p.h> +#include <QtQml/qqmlfile.h> +#include <QtQml/private/qqmldirparser_p.h> #include <QtQuickControls2/qquickstyle.h> #include <QtQuickControls2/private/qquickchecklabel_p.h> #include <QtQuickControls2/private/qquickcolor_p.h> @@ -46,13 +52,13 @@ #include <QtQuickControls2/private/qquickiconlabel_p.h> #include <QtQuickControls2/private/qquickstyle_p.h> #include <QtQuickControls2/private/qquickstyleplugin_p.h> -#include <QtQuickControls2/private/qquickstyleselector_p.h> #if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) #include <QtQuickControls2/private/qquicktumblerview_p.h> #endif #include <QtQuickTemplates2/private/qquickoverlay_p.h> #include <QtQuickControls2/private/qquickclippedtext_p.h> #include <QtQuickControls2/private/qquickitemgroup_p.h> +#include <QtQuickTemplates2/private/qquicktheme_p_p.h> #include "qquickdefaultbusyindicator_p.h" #include "qquickdefaultdial_p.h" @@ -60,14 +66,6 @@ #include "qquickdefaultstyle_p.h" #include "qquickdefaulttheme_p.h" -static inline void initResources() -{ - Q_INIT_RESOURCE(qtquickcontrols2plugin); -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtQuick_Controls_2); -#endif -} - QT_BEGIN_NAMESPACE class QtQuickControls2Plugin: public QQuickStylePlugin @@ -82,12 +80,15 @@ public: void registerTypes(const char *uri) override; QString name() const override; - QQuickProxyTheme *createTheme() const override; + void initializeTheme(QQuickTheme *theme) override; + +private: + QList<QQuickStylePlugin *> loadStylePlugins(); + QQuickTheme *createTheme(const QString &name); }; QtQuickControls2Plugin::QtQuickControls2Plugin(QObject *parent) : QQuickStylePlugin(parent) { - initResources(); } QtQuickControls2Plugin::~QtQuickControls2Plugin() @@ -95,81 +96,94 @@ QtQuickControls2Plugin::~QtQuickControls2Plugin() QQuickStylePrivate::reset(); } +static bool isDefaultStyle(const QString &style) +{ + return style.isEmpty() || style.compare(QStringLiteral("Default"), Qt::CaseInsensitive) == 0; +} + void QtQuickControls2Plugin::registerTypes(const char *uri) { - QQuickStylePrivate::init(typeUrl()); + QQuickStylePrivate::init(baseUrl()); + const QString style = QQuickStyle::name(); if (!style.isEmpty()) QFileSelectorPrivate::addStatics(QStringList() << style.toLower()); - QQuickStyleSelector selector; - selector.setBaseUrl(typeUrl()); + QQuickTheme *theme = createTheme(style.isEmpty() ? name() : style); + if (isDefaultStyle(style)) + initializeTheme(theme); + + // load the style's plugins to get access to its resources and initialize the theme + QList<QQuickStylePlugin *> stylePlugins = loadStylePlugins(); + for (QQuickStylePlugin *stylePlugin : stylePlugins) + stylePlugin->initializeTheme(theme); + qDeleteAll(stylePlugins); qmlRegisterModule(uri, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2... // QtQuick.Controls 2.0 (originally introduced in Qt 5.7) - qmlRegisterType(selector.select(QStringLiteral("AbstractButton.qml")), uri, 2, 0, "AbstractButton"); - qmlRegisterType(selector.select(QStringLiteral("ApplicationWindow.qml")), uri, 2, 0, "ApplicationWindow"); - qmlRegisterType(selector.select(QStringLiteral("BusyIndicator.qml")), uri, 2, 0, "BusyIndicator"); - qmlRegisterType(selector.select(QStringLiteral("Button.qml")), uri, 2, 0, "Button"); - qmlRegisterType(selector.select(QStringLiteral("ButtonGroup.qml")), uri, 2, 0, "ButtonGroup"); - qmlRegisterType(selector.select(QStringLiteral("CheckBox.qml")), uri, 2, 0, "CheckBox"); - qmlRegisterType(selector.select(QStringLiteral("CheckDelegate.qml")), uri, 2, 0, "CheckDelegate"); - qmlRegisterType(selector.select(QStringLiteral("ComboBox.qml")), uri, 2, 0, "ComboBox"); - qmlRegisterType(selector.select(QStringLiteral("Container.qml")), uri, 2, 0, "Container"); - qmlRegisterType(selector.select(QStringLiteral("Control.qml")), uri, 2, 0, "Control"); - qmlRegisterType(selector.select(QStringLiteral("Dial.qml")), uri, 2, 0, "Dial"); - qmlRegisterType(selector.select(QStringLiteral("Drawer.qml")), uri, 2, 0, "Drawer"); - qmlRegisterType(selector.select(QStringLiteral("Frame.qml")), uri, 2, 0, "Frame"); - qmlRegisterType(selector.select(QStringLiteral("GroupBox.qml")), uri, 2, 0, "GroupBox"); - qmlRegisterType(selector.select(QStringLiteral("ItemDelegate.qml")), uri, 2, 0, "ItemDelegate"); - qmlRegisterType(selector.select(QStringLiteral("Label.qml")), uri, 2, 0, "Label"); - qmlRegisterType(selector.select(QStringLiteral("Menu.qml")), uri, 2, 0, "Menu"); - qmlRegisterType(selector.select(QStringLiteral("MenuItem.qml")), uri, 2, 0, "MenuItem"); - qmlRegisterType(selector.select(QStringLiteral("Page.qml")), uri, 2, 0, "Page"); - qmlRegisterType(selector.select(QStringLiteral("PageIndicator.qml")), uri, 2, 0, "PageIndicator"); - qmlRegisterType(selector.select(QStringLiteral("Pane.qml")), uri, 2, 0, "Pane"); - qmlRegisterType(selector.select(QStringLiteral("Popup.qml")), uri, 2, 0, "Popup"); - qmlRegisterType(selector.select(QStringLiteral("ProgressBar.qml")), uri, 2, 0, "ProgressBar"); - qmlRegisterType(selector.select(QStringLiteral("RadioButton.qml")), uri, 2, 0, "RadioButton"); - qmlRegisterType(selector.select(QStringLiteral("RadioDelegate.qml")), uri, 2, 0, "RadioDelegate"); - qmlRegisterType(selector.select(QStringLiteral("RangeSlider.qml")), uri, 2, 0, "RangeSlider"); - qmlRegisterType(selector.select(QStringLiteral("ScrollBar.qml")), uri, 2, 0, "ScrollBar"); - qmlRegisterType(selector.select(QStringLiteral("ScrollIndicator.qml")), uri, 2, 0, "ScrollIndicator"); - qmlRegisterType(selector.select(QStringLiteral("Slider.qml")), uri, 2, 0, "Slider"); - qmlRegisterType(selector.select(QStringLiteral("SpinBox.qml")), uri, 2, 0, "SpinBox"); - qmlRegisterType(selector.select(QStringLiteral("StackView.qml")), uri, 2, 0, "StackView"); - qmlRegisterType(selector.select(QStringLiteral("SwipeDelegate.qml")), uri, 2, 0, "SwipeDelegate"); - qmlRegisterType(selector.select(QStringLiteral("SwipeView.qml")), uri, 2, 0, "SwipeView"); - qmlRegisterType(selector.select(QStringLiteral("Switch.qml")), uri, 2, 0, "Switch"); - qmlRegisterType(selector.select(QStringLiteral("SwitchDelegate.qml")), uri, 2, 0, "SwitchDelegate"); - qmlRegisterType(selector.select(QStringLiteral("TabBar.qml")), uri, 2, 0, "TabBar"); - qmlRegisterType(selector.select(QStringLiteral("TabButton.qml")), uri, 2, 0, "TabButton"); - qmlRegisterType(selector.select(QStringLiteral("TextArea.qml")), uri, 2, 0, "TextArea"); - qmlRegisterType(selector.select(QStringLiteral("TextField.qml")), uri, 2, 0, "TextField"); - qmlRegisterType(selector.select(QStringLiteral("ToolBar.qml")), uri, 2, 0, "ToolBar"); - qmlRegisterType(selector.select(QStringLiteral("ToolButton.qml")), uri, 2, 0, "ToolButton"); - qmlRegisterType(selector.select(QStringLiteral("ToolTip.qml")), uri, 2, 0, "ToolTip"); + qmlRegisterType(resolvedUrl(QStringLiteral("AbstractButton.qml")), uri, 2, 0, "AbstractButton"); + qmlRegisterType(resolvedUrl(QStringLiteral("ApplicationWindow.qml")), uri, 2, 0, "ApplicationWindow"); + qmlRegisterType(resolvedUrl(QStringLiteral("BusyIndicator.qml")), uri, 2, 0, "BusyIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("Button.qml")), uri, 2, 0, "Button"); + qmlRegisterType(resolvedUrl(QStringLiteral("ButtonGroup.qml")), uri, 2, 0, "ButtonGroup"); + qmlRegisterType(resolvedUrl(QStringLiteral("CheckBox.qml")), uri, 2, 0, "CheckBox"); + qmlRegisterType(resolvedUrl(QStringLiteral("CheckDelegate.qml")), uri, 2, 0, "CheckDelegate"); + qmlRegisterType(resolvedUrl(QStringLiteral("ComboBox.qml")), uri, 2, 0, "ComboBox"); + qmlRegisterType(resolvedUrl(QStringLiteral("Container.qml")), uri, 2, 0, "Container"); + qmlRegisterType(resolvedUrl(QStringLiteral("Control.qml")), uri, 2, 0, "Control"); + qmlRegisterType(resolvedUrl(QStringLiteral("Dial.qml")), uri, 2, 0, "Dial"); + qmlRegisterType(resolvedUrl(QStringLiteral("Drawer.qml")), uri, 2, 0, "Drawer"); + qmlRegisterType(resolvedUrl(QStringLiteral("Frame.qml")), uri, 2, 0, "Frame"); + qmlRegisterType(resolvedUrl(QStringLiteral("GroupBox.qml")), uri, 2, 0, "GroupBox"); + qmlRegisterType(resolvedUrl(QStringLiteral("ItemDelegate.qml")), uri, 2, 0, "ItemDelegate"); + qmlRegisterType(resolvedUrl(QStringLiteral("Label.qml")), uri, 2, 0, "Label"); + qmlRegisterType(resolvedUrl(QStringLiteral("Menu.qml")), uri, 2, 0, "Menu"); + qmlRegisterType(resolvedUrl(QStringLiteral("MenuItem.qml")), uri, 2, 0, "MenuItem"); + qmlRegisterType(resolvedUrl(QStringLiteral("Page.qml")), uri, 2, 0, "Page"); + qmlRegisterType(resolvedUrl(QStringLiteral("PageIndicator.qml")), uri, 2, 0, "PageIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("Pane.qml")), uri, 2, 0, "Pane"); + qmlRegisterType(resolvedUrl(QStringLiteral("Popup.qml")), uri, 2, 0, "Popup"); + qmlRegisterType(resolvedUrl(QStringLiteral("ProgressBar.qml")), uri, 2, 0, "ProgressBar"); + qmlRegisterType(resolvedUrl(QStringLiteral("RadioButton.qml")), uri, 2, 0, "RadioButton"); + qmlRegisterType(resolvedUrl(QStringLiteral("RadioDelegate.qml")), uri, 2, 0, "RadioDelegate"); + qmlRegisterType(resolvedUrl(QStringLiteral("RangeSlider.qml")), uri, 2, 0, "RangeSlider"); + qmlRegisterType(resolvedUrl(QStringLiteral("ScrollBar.qml")), uri, 2, 0, "ScrollBar"); + qmlRegisterType(resolvedUrl(QStringLiteral("ScrollIndicator.qml")), uri, 2, 0, "ScrollIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("Slider.qml")), uri, 2, 0, "Slider"); + qmlRegisterType(resolvedUrl(QStringLiteral("SpinBox.qml")), uri, 2, 0, "SpinBox"); + qmlRegisterType(resolvedUrl(QStringLiteral("StackView.qml")), uri, 2, 0, "StackView"); + qmlRegisterType(resolvedUrl(QStringLiteral("SwipeDelegate.qml")), uri, 2, 0, "SwipeDelegate"); + qmlRegisterType(resolvedUrl(QStringLiteral("SwipeView.qml")), uri, 2, 0, "SwipeView"); + qmlRegisterType(resolvedUrl(QStringLiteral("Switch.qml")), uri, 2, 0, "Switch"); + qmlRegisterType(resolvedUrl(QStringLiteral("SwitchDelegate.qml")), uri, 2, 0, "SwitchDelegate"); + qmlRegisterType(resolvedUrl(QStringLiteral("TabBar.qml")), uri, 2, 0, "TabBar"); + qmlRegisterType(resolvedUrl(QStringLiteral("TabButton.qml")), uri, 2, 0, "TabButton"); + qmlRegisterType(resolvedUrl(QStringLiteral("TextArea.qml")), uri, 2, 0, "TextArea"); + qmlRegisterType(resolvedUrl(QStringLiteral("TextField.qml")), uri, 2, 0, "TextField"); + qmlRegisterType(resolvedUrl(QStringLiteral("ToolBar.qml")), uri, 2, 0, "ToolBar"); + qmlRegisterType(resolvedUrl(QStringLiteral("ToolButton.qml")), uri, 2, 0, "ToolButton"); + qmlRegisterType(resolvedUrl(QStringLiteral("ToolTip.qml")), uri, 2, 0, "ToolTip"); #if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) - qmlRegisterType(selector.select(QStringLiteral("Tumbler.qml")), uri, 2, 0, "Tumbler"); + qmlRegisterType(resolvedUrl(QStringLiteral("Tumbler.qml")), uri, 2, 0, "Tumbler"); #endif // QtQuick.Controls 2.1 (new types in Qt 5.8) - qmlRegisterType(selector.select(QStringLiteral("Dialog.qml")), uri, 2, 1, "Dialog"); - qmlRegisterType(selector.select(QStringLiteral("DialogButtonBox.qml")), uri, 2, 1, "DialogButtonBox"); - qmlRegisterType(selector.select(QStringLiteral("MenuSeparator.qml")), uri, 2, 1, "MenuSeparator"); - qmlRegisterType(selector.select(QStringLiteral("RoundButton.qml")), uri, 2, 1, "RoundButton"); - qmlRegisterType(selector.select(QStringLiteral("ToolSeparator.qml")), uri, 2, 1, "ToolSeparator"); + qmlRegisterType(resolvedUrl(QStringLiteral("Dialog.qml")), uri, 2, 1, "Dialog"); + qmlRegisterType(resolvedUrl(QStringLiteral("DialogButtonBox.qml")), uri, 2, 1, "DialogButtonBox"); + qmlRegisterType(resolvedUrl(QStringLiteral("MenuSeparator.qml")), uri, 2, 1, "MenuSeparator"); + qmlRegisterType(resolvedUrl(QStringLiteral("RoundButton.qml")), uri, 2, 1, "RoundButton"); + qmlRegisterType(resolvedUrl(QStringLiteral("ToolSeparator.qml")), uri, 2, 1, "ToolSeparator"); // QtQuick.Controls 2.2 (new types in Qt 5.9) - qmlRegisterType(selector.select(QStringLiteral("DelayButton.qml")), uri, 2, 2, "DelayButton"); - qmlRegisterType(selector.select(QStringLiteral("ScrollView.qml")), uri, 2, 2, "ScrollView"); + qmlRegisterType(resolvedUrl(QStringLiteral("DelayButton.qml")), uri, 2, 2, "DelayButton"); + qmlRegisterType(resolvedUrl(QStringLiteral("ScrollView.qml")), uri, 2, 2, "ScrollView"); // QtQuick.Controls 2.3 (new types in Qt 5.10) - qmlRegisterType(selector.select(QStringLiteral("Action.qml")), uri, 2, 3, "Action"); - qmlRegisterType(selector.select(QStringLiteral("ActionGroup.qml")), uri, 2, 3, "ActionGroup"); - qmlRegisterType(selector.select(QStringLiteral("MenuBar.qml")), uri, 2, 3, "MenuBar"); - qmlRegisterType(selector.select(QStringLiteral("MenuBarItem.qml")), uri, 2, 3, "MenuBarItem"); + qmlRegisterType(resolvedUrl(QStringLiteral("Action.qml")), uri, 2, 3, "Action"); + qmlRegisterType(resolvedUrl(QStringLiteral("ActionGroup.qml")), uri, 2, 3, "ActionGroup"); + qmlRegisterType(resolvedUrl(QStringLiteral("MenuBar.qml")), uri, 2, 3, "MenuBar"); + qmlRegisterType(resolvedUrl(QStringLiteral("MenuBarItem.qml")), uri, 2, 3, "MenuBarItem"); qmlRegisterUncreatableType<QQuickOverlay>(uri, 2, 3, "Overlay", QStringLiteral("Overlay is only available as an attached property.")); const QByteArray import = QByteArray(uri) + ".impl"; @@ -212,12 +226,71 @@ void QtQuickControls2Plugin::registerTypes(const char *uri) QString QtQuickControls2Plugin::name() const { - return QStringLiteral("default"); + return QStringLiteral("Default"); } -QQuickProxyTheme *QtQuickControls2Plugin::createTheme() const +void QtQuickControls2Plugin::initializeTheme(QQuickTheme *theme) { - return new QQuickDefaultTheme; + QQuickDefaultTheme::initialize(theme); +} + +QList<QQuickStylePlugin *> QtQuickControls2Plugin::loadStylePlugins() +{ + QList<QQuickStylePlugin *> stylePlugins; + + QFileInfo fileInfo = QQmlFile::urlToLocalFileOrQrc(resolvedUrl(QStringLiteral("qmldir"))); + if (fileInfo.exists() && fileInfo.path() != QQmlFile::urlToLocalFileOrQrc(baseUrl())) { + QFile file(fileInfo.filePath()); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QQmlDirParser parser; + parser.parse(QString::fromUtf8(file.readAll())); + if (!parser.hasError()) { +#ifdef QT_STATIC + const auto plugins = QPluginLoader::staticInstances(); + for (QObject *instance : plugins) { + QQuickStylePlugin *stylePlugin = qobject_cast<QQuickStylePlugin *>(instance); + if (!stylePlugin || parser.className() != QLatin1String(instance->metaObject()->className())) + continue; + stylePlugins += stylePlugin; + } +#elif QT_CONFIG(library) + QPluginLoader loader; + const auto plugins = parser.plugins(); + for (const QQmlDirParser::Plugin &plugin : plugins) { + QDir dir = fileInfo.dir(); + if (!plugin.path.isEmpty() && !dir.cd(plugin.path)) + continue; + QString filePath = dir.filePath(plugin.name); +#if defined(Q_OS_MACOS) && defined(QT_DEBUG) + // Avoid mismatching plugins on macOS so that we don't end up loading both debug and + // release versions of the same Qt libraries (due to the plugin's dependencies). + filePath += QStringLiteral("_debug"); +#endif // Q_OS_MACOS && QT_DEBUG + loader.setFileName(filePath); + QQuickStylePlugin *stylePlugin = qobject_cast<QQuickStylePlugin *>(loader.instance()); + if (stylePlugin) + stylePlugins += stylePlugin; + } +#endif + } + } + } + return stylePlugins; +} + +QQuickTheme *QtQuickControls2Plugin::createTheme(const QString &name) +{ + QQuickTheme *theme = new QQuickTheme; +#if QT_CONFIG(settings) + QQuickThemePrivate *p = QQuickThemePrivate::get(theme); + QSharedPointer<QSettings> settings = QQuickStylePrivate::settings(name); + if (settings) { + p->defaultFont.reset(QQuickStylePrivate::readFont(settings)); + p->defaultPalette.reset(QQuickStylePrivate::readPalette(settings)); + } +#endif + QQuickThemePrivate::instance.reset(theme); + return theme; } QT_END_NAMESPACE diff --git a/src/imports/controls/universal/ApplicationWindow.qml b/src/imports/controls/universal/ApplicationWindow.qml index 0b119693..313b980e 100644 --- a/src/imports/controls/universal/ApplicationWindow.qml +++ b/src/imports/controls/universal/ApplicationWindow.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.3 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 -import QtQuick.Controls.Universal.impl 2.4 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 +import QtQuick.Controls.Universal.impl 2.5 T.ApplicationWindow { id: window diff --git a/src/imports/controls/universal/BusyIndicator.qml b/src/imports/controls/universal/BusyIndicator.qml index cc9e6b85..cc6f241d 100644 --- a/src/imports/controls/universal/BusyIndicator.qml +++ b/src/imports/controls/universal/BusyIndicator.qml @@ -34,16 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 -import QtQuick.Controls.Universal.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 +import QtQuick.Controls.Universal.impl 2.5 T.BusyIndicator { id: control - implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding - implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) contentItem: BusyIndicatorImpl { implicitWidth: 20 diff --git a/src/imports/controls/universal/Button.qml b/src/imports/controls/universal/Button.qml index d8b6836d..648b2950 100644 --- a/src/imports/controls/universal/Button.qml +++ b/src/imports/controls/universal/Button.qml @@ -34,24 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.Button { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 8 - topPadding: padding - 4 - bottomPadding: padding - 4 + verticalPadding: padding - 4 spacing: 8 icon.width: 20 diff --git a/src/imports/controls/universal/CheckBox.qml b/src/imports/controls/universal/CheckBox.qml index 7566c33a..b0632da1 100644 --- a/src/imports/controls/universal/CheckBox.qml +++ b/src/imports/controls/universal/CheckBox.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 -import QtQuick.Controls.Universal.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 +import QtQuick.Controls.Universal.impl 2.5 T.CheckBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 8 diff --git a/src/imports/controls/universal/CheckDelegate.qml b/src/imports/controls/universal/CheckDelegate.qml index 8419ac1e..98092919 100644 --- a/src/imports/controls/universal/CheckDelegate.qml +++ b/src/imports/controls/universal/CheckDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 -import QtQuick.Controls.Universal.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 +import QtQuick.Controls.Universal.impl 2.5 T.CheckDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 12 diff --git a/src/imports/controls/universal/CheckIndicator.qml b/src/imports/controls/universal/CheckIndicator.qml index 63bbc3d0..cf8ce3c6 100644 --- a/src/imports/controls/universal/CheckIndicator.qml +++ b/src/imports/controls/universal/CheckIndicator.qml @@ -34,11 +34,11 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 Rectangle { implicitWidth: 20 diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml index f8ea2874..37b008ba 100644 --- a/src/imports/controls/universal/ComboBox.qml +++ b/src/imports/controls/universal/ComboBox.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 +import QtQuick 2.12 import QtQuick.Window 2.3 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.ComboBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) diff --git a/src/imports/controls/universal/DelayButton.qml b/src/imports/controls/universal/DelayButton.qml index be0cccad..2df2e0b4 100644 --- a/src/imports/controls/universal/DelayButton.qml +++ b/src/imports/controls/universal/DelayButton.qml @@ -34,22 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.DelayButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 8 - topPadding: padding - 4 - bottomPadding: padding - 4 + verticalPadding: padding - 4 property bool useSystemFocusVisuals: true diff --git a/src/imports/controls/universal/Dial.qml b/src/imports/controls/universal/Dial.qml index d2634713..ae163cab 100644 --- a/src/imports/controls/universal/Dial.qml +++ b/src/imports/controls/universal/Dial.qml @@ -34,17 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.Dial { id: control - implicitWidth: 100 - implicitHeight: 100 + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) || 100 // ### remove 100 in Qt 6 + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) || 100 // ### remove 100 in Qt 6 background: Rectangle { + implicitWidth: 100 + implicitHeight: 100 + x: control.width / 2 - width / 2 y: control.height / 2 - height / 2 width: Math.max(64, Math.min(control.width, control.height)) diff --git a/src/imports/controls/universal/Dialog.qml b/src/imports/controls/universal/Dialog.qml index 08cc441a..bf7b274c 100644 --- a/src/imports/controls/universal/Dialog.qml +++ b/src/imports/controls/universal/Dialog.qml @@ -34,29 +34,25 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.Universal 2.5 T.Dialog { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - header && header.visible ? header.implicitWidth : 0, - footer && footer.visible ? footer.implicitWidth : 0, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (header && header.visible ? header.implicitHeight + spacing : 0) - + (footer && footer.visible ? footer.implicitHeight + spacing : 0) - + (contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0)) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) padding: 24 - topPadding: 18 - bottomPadding: 18 + verticalPadding: 18 background: Rectangle { color: control.Universal.chromeMediumLowColor diff --git a/src/imports/controls/universal/DialogButtonBox.qml b/src/imports/controls/universal/DialogButtonBox.qml index 17a9156d..84393a79 100644 --- a/src/imports/controls/universal/DialogButtonBox.qml +++ b/src/imports/controls/universal/DialogButtonBox.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.Universal 2.5 T.DialogButtonBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + (control.count === 1 ? contentWidth * 2 : contentWidth) + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) spacing: 4 padding: 24 @@ -58,9 +58,6 @@ T.DialogButtonBox { } contentItem: ListView { - implicitWidth: control.count === 1 ? 200 : contentWidth - implicitHeight: 32 - model: control.contentModel spacing: control.spacing orientation: ListView.Horizontal diff --git a/src/imports/controls/universal/Drawer.qml b/src/imports/controls/universal/Drawer.qml index 8fbd57c6..6c824c8f 100644 --- a/src/imports/controls/universal/Drawer.qml +++ b/src/imports/controls/universal/Drawer.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.Drawer { id: control parent: T.Overlay.overlay - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) topPadding: control.edge === Qt.BottomEdge leftPadding: control.edge === Qt.RightEdge diff --git a/src/imports/controls/universal/Frame.qml b/src/imports/controls/universal/Frame.qml index 4f11bc18..e82c0773 100644 --- a/src/imports/controls/universal/Frame.qml +++ b/src/imports/controls/universal/Frame.qml @@ -34,18 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.Frame { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 12 diff --git a/src/imports/controls/universal/GroupBox.qml b/src/imports/controls/universal/GroupBox.qml index 8fb68e29..792fcb93 100644 --- a/src/imports/controls/universal/GroupBox.qml +++ b/src/imports/controls/universal/GroupBox.qml @@ -34,24 +34,22 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.GroupBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - label ? label.implicitWidth + leftPadding + rightPadding : 0, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitLabelWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) spacing: 12 padding: 12 - topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0) + topPadding: padding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0) label: Text { x: control.leftPadding diff --git a/src/imports/controls/universal/ItemDelegate.qml b/src/imports/controls/universal/ItemDelegate.qml index 65d52729..656aa338 100644 --- a/src/imports/controls/universal/ItemDelegate.qml +++ b/src/imports/controls/universal/ItemDelegate.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.ItemDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 12 diff --git a/src/imports/controls/universal/Label.qml b/src/imports/controls/universal/Label.qml index bad9ac04..2e6bb1c3 100644 --- a/src/imports/controls/universal/Label.qml +++ b/src/imports/controls/universal/Label.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.Label { id: control diff --git a/src/imports/controls/universal/Menu.qml b/src/imports/controls/universal/Menu.qml index ba998827..567b13af 100644 --- a/src/imports/controls/universal/Menu.qml +++ b/src/imports/controls/universal/Menu.qml @@ -34,19 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 -import QtQuick.Window 2.11 +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 +import QtQuick.Window 2.12 T.Menu { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) margins: 0 overlap: 1 diff --git a/src/imports/controls/universal/MenuBar.qml b/src/imports/controls/universal/MenuBar.qml index a1d7e88a..f2a26a46 100644 --- a/src/imports/controls/universal/MenuBar.qml +++ b/src/imports/controls/universal/MenuBar.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.MenuBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) delegate: MenuBarItem { } diff --git a/src/imports/controls/universal/MenuBarItem.qml b/src/imports/controls/universal/MenuBarItem.qml index e88a3ced..34d9ad29 100644 --- a/src/imports/controls/universal/MenuBarItem.qml +++ b/src/imports/controls/universal/MenuBarItem.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.MenuBarItem { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 12 topPadding: padding - 1 diff --git a/src/imports/controls/universal/MenuItem.qml b/src/imports/controls/universal/MenuItem.qml index c9c38cb5..7b52300c 100644 --- a/src/imports/controls/universal/MenuItem.qml +++ b/src/imports/controls/universal/MenuItem.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.MenuItem { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 12 topPadding: padding - 1 diff --git a/src/imports/controls/universal/MenuSeparator.qml b/src/imports/controls/universal/MenuSeparator.qml index 6d0d9dd5..9e3b1d89 100644 --- a/src/imports/controls/universal/MenuSeparator.qml +++ b/src/imports/controls/universal/MenuSeparator.qml @@ -34,15 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.MenuSeparator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 12 topPadding: 9 diff --git a/src/imports/controls/universal/Page.qml b/src/imports/controls/universal/Page.qml index 734ea245..e09225e4 100644 --- a/src/imports/controls/universal/Page.qml +++ b/src/imports/controls/universal/Page.qml @@ -34,24 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.Page { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding, - header && header.visible ? header.implicitWidth : 0, - footer && footer.visible ? footer.implicitWidth : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding - + (header && header.visible ? header.implicitHeight + spacing : 0) - + (footer && footer.visible ? footer.implicitHeight + spacing : 0)) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) background: Rectangle { color: control.Universal.background diff --git a/src/imports/controls/universal/PageIndicator.qml b/src/imports/controls/universal/PageIndicator.qml index c14a3365..a89a7d07 100644 --- a/src/imports/controls/universal/PageIndicator.qml +++ b/src/imports/controls/universal/PageIndicator.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.PageIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 spacing: 7 diff --git a/src/imports/controls/universal/Pane.qml b/src/imports/controls/universal/Pane.qml index 340653ea..d643bb7f 100644 --- a/src/imports/controls/universal/Pane.qml +++ b/src/imports/controls/universal/Pane.qml @@ -34,18 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.Pane { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 12 diff --git a/src/imports/controls/universal/Popup.qml b/src/imports/controls/universal/Popup.qml index 567fa7d2..739fab68 100644 --- a/src/imports/controls/universal/Popup.qml +++ b/src/imports/controls/universal/Popup.qml @@ -34,20 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.Popup { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) padding: 12 diff --git a/src/imports/controls/universal/ProgressBar.qml b/src/imports/controls/universal/ProgressBar.qml index e7aa6bbe..7403f74c 100644 --- a/src/imports/controls/universal/ProgressBar.qml +++ b/src/imports/controls/universal/ProgressBar.qml @@ -34,18 +34,18 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 -import QtQuick.Controls.Universal.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 +import QtQuick.Controls.Universal.impl 2.5 T.ProgressBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) contentItem: ProgressBarImpl { implicitHeight: 10 diff --git a/src/imports/controls/universal/RadioButton.qml b/src/imports/controls/universal/RadioButton.qml index 763725b6..7c8fdcc9 100644 --- a/src/imports/controls/universal/RadioButton.qml +++ b/src/imports/controls/universal/RadioButton.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 -import QtQuick.Controls.Universal.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 +import QtQuick.Controls.Universal.impl 2.5 T.RadioButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 6 spacing: 8 diff --git a/src/imports/controls/universal/RadioDelegate.qml b/src/imports/controls/universal/RadioDelegate.qml index 90d023b3..2e068c4b 100644 --- a/src/imports/controls/universal/RadioDelegate.qml +++ b/src/imports/controls/universal/RadioDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 -import QtQuick.Controls.Universal.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 +import QtQuick.Controls.Universal.impl 2.5 T.RadioDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 12 diff --git a/src/imports/controls/universal/RadioIndicator.qml b/src/imports/controls/universal/RadioIndicator.qml index 11f388c2..71cb7098 100644 --- a/src/imports/controls/universal/RadioIndicator.qml +++ b/src/imports/controls/universal/RadioIndicator.qml @@ -34,8 +34,8 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Controls.Universal 2.5 Rectangle { implicitWidth: 20 diff --git a/src/imports/controls/universal/RangeSlider.qml b/src/imports/controls/universal/RangeSlider.qml index 6ee923e1..57b30ea9 100644 --- a/src/imports/controls/universal/RangeSlider.qml +++ b/src/imports/controls/universal/RangeSlider.qml @@ -34,19 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.RangeSlider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - Math.max(first.handle ? first.handle.implicitWidth : 0, - second.handle ? second.handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(first.handle ? first.handle.implicitHeight : 0, - second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + first.implicitHandleWidth + leftPadding + rightPadding, + second.implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + first.implicitHandleHeight + topPadding + bottomPadding, + second.implicitHandleHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/universal/RoundButton.qml b/src/imports/controls/universal/RoundButton.qml index 34983ac9..06455e0c 100644 --- a/src/imports/controls/universal/RoundButton.qml +++ b/src/imports/controls/universal/RoundButton.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.RoundButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 8 spacing: 8 diff --git a/src/imports/controls/universal/ScrollBar.qml b/src/imports/controls/universal/ScrollBar.qml index 91b77366..6cb77245 100644 --- a/src/imports/controls/universal/ScrollBar.qml +++ b/src/imports/controls/universal/ScrollBar.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.ScrollBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) visible: control.policy !== T.ScrollBar.AlwaysOff diff --git a/src/imports/controls/universal/ScrollIndicator.qml b/src/imports/controls/universal/ScrollIndicator.qml index f09124db..b2dd6bbd 100644 --- a/src/imports/controls/universal/ScrollIndicator.qml +++ b/src/imports/controls/universal/ScrollIndicator.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.ScrollIndicator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) contentItem: Rectangle { implicitWidth: 6 diff --git a/src/imports/controls/universal/Slider.qml b/src/imports/controls/universal/Slider.qml index 49b6d371..5ccf83b6 100644 --- a/src/imports/controls/universal/Slider.qml +++ b/src/imports/controls/universal/Slider.qml @@ -34,17 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.Slider { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitHandleWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitHandleHeight + topPadding + bottomPadding) padding: 6 diff --git a/src/imports/controls/universal/SpinBox.qml b/src/imports/controls/universal/SpinBox.qml index d9ceed78..0ef08538 100644 --- a/src/imports/controls/universal/SpinBox.qml +++ b/src/imports/controls/universal/SpinBox.qml @@ -34,24 +34,23 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.SpinBox { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentItem.implicitWidth + 16 + - (up.indicator ? up.indicator.implicitWidth : 0) + - (down.indicator ? down.indicator.implicitWidth : 0)) - implicitHeight: Math.max(contentItem.implicitHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, - up.indicator ? up.indicator.implicitHeight : 0, - down.indicator ? down.indicator.implicitHeight : 0) - baselineOffset: contentItem.y + contentItem.baselineOffset + up.implicitIndicatorWidth + + down.implicitIndicatorWidth) + implicitHeight: Math.max(implicitContentHeight + topPadding + bottomPadding, + implicitBackgroundHeight, + up.implicitIndicatorHeight, + down.implicitIndicatorHeight) // TextControlThemePadding + 2 (border) padding: 12 diff --git a/src/imports/controls/universal/StackView.qml b/src/imports/controls/universal/StackView.qml index 77d70255..c4cf70e7 100644 --- a/src/imports/controls/universal/StackView.qml +++ b/src/imports/controls/universal/StackView.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.StackView { id: control diff --git a/src/imports/controls/universal/SwipeDelegate.qml b/src/imports/controls/universal/SwipeDelegate.qml index ffcdf0a9..492e2e3a 100644 --- a/src/imports/controls/universal/SwipeDelegate.qml +++ b/src/imports/controls/universal/SwipeDelegate.qml @@ -34,21 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.SwipeDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 12 diff --git a/src/imports/controls/universal/Switch.qml b/src/imports/controls/universal/Switch.qml index b0d1923b..538562bc 100644 --- a/src/imports/controls/universal/Switch.qml +++ b/src/imports/controls/universal/Switch.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 -import QtQuick.Controls.Universal.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 +import QtQuick.Controls.Universal.impl 2.5 T.Switch { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) padding: 5 spacing: 8 diff --git a/src/imports/controls/universal/SwitchDelegate.qml b/src/imports/controls/universal/SwitchDelegate.qml index 48248193..32e63cf5 100644 --- a/src/imports/controls/universal/SwitchDelegate.qml +++ b/src/imports/controls/universal/SwitchDelegate.qml @@ -34,22 +34,21 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 -import QtQuick.Controls.Universal.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 +import QtQuick.Controls.Universal.impl 2.5 T.SwitchDelegate { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - Math.max(contentItem.implicitHeight, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding, + implicitIndicatorHeight + topPadding + bottomPadding) spacing: 12 diff --git a/src/imports/controls/universal/SwitchIndicator.qml b/src/imports/controls/universal/SwitchIndicator.qml index b1072b88..12a71f16 100644 --- a/src/imports/controls/universal/SwitchIndicator.qml +++ b/src/imports/controls/universal/SwitchIndicator.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 Item { implicitWidth: 44 diff --git a/src/imports/controls/universal/TabBar.qml b/src/imports/controls/universal/TabBar.qml index 81003b48..d2bdcfa1 100644 --- a/src/imports/controls/universal/TabBar.qml +++ b/src/imports/controls/universal/TabBar.qml @@ -34,16 +34,16 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.TabBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, contentHeight + topPadding + bottomPadding) contentItem: PathView { diff --git a/src/imports/controls/universal/TabButton.qml b/src/imports/controls/universal/TabButton.qml index 3a9e6d45..b512026a 100644 --- a/src/imports/controls/universal/TabButton.qml +++ b/src/imports/controls/universal/TabButton.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.TabButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 12 // PivotItemMargin spacing: 8 diff --git a/src/imports/controls/universal/TextArea.qml b/src/imports/controls/universal/TextArea.qml index 3e407160..2d5934df 100644 --- a/src/imports/controls/universal/TextArea.qml +++ b/src/imports/controls/universal/TextArea.qml @@ -34,20 +34,20 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.TextArea { id: control implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, - background ? background.implicitWidth : 0, + implicitBackgroundWidth + leftInset + rightInset, placeholder.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, + implicitBackgroundHeight + topInset + bottomInset, placeholder.implicitHeight + topPadding + bottomPadding) // TextControlThemePadding + 2 (border) @@ -61,6 +61,9 @@ T.TextArea { color: !enabled ? Universal.chromeDisabledLowColor : Universal.foreground selectionColor: Universal.accent selectedTextColor: Universal.chromeWhiteColor + placeholderTextColor: !enabled ? Universal.chromeDisabledLowColor : + activeFocus ? Universal.chromeBlackMediumLowColor : + Universal.baseMediumColor PlaceholderText { id: placeholder @@ -71,8 +74,7 @@ T.TextArea { text: control.placeholderText font: control.font - color: !control.enabled ? control.Universal.chromeDisabledLowColor : - control.activeFocus ? control.Universal.chromeBlackMediumLowColor : control.Universal.baseMediumColor + color: control.placeholderTextColor visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) verticalAlignment: control.verticalAlignment elide: Text.ElideRight diff --git a/src/imports/controls/universal/TextField.qml b/src/imports/controls/universal/TextField.qml index 0f3084ce..04e40fa5 100644 --- a/src/imports/controls/universal/TextField.qml +++ b/src/imports/controls/universal/TextField.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.TextField { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0) - || contentWidth + leftPadding + rightPadding - implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, - background ? background.implicitHeight : 0, + implicitWidth: implicitBackgroundWidth + leftInset + rightInset + || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding, placeholder.implicitHeight + topPadding + bottomPadding) // TextControlThemePadding + 2 (border) @@ -61,6 +60,9 @@ T.TextField { color: !enabled ? Universal.chromeDisabledLowColor : Universal.foreground selectionColor: Universal.accent selectedTextColor: Universal.chromeWhiteColor + placeholderTextColor: !enabled ? Universal.chromeDisabledLowColor : + activeFocus ? Universal.chromeBlackMediumLowColor : + Universal.baseMediumColor verticalAlignment: TextInput.AlignVCenter PlaceholderText { @@ -72,8 +74,7 @@ T.TextField { text: control.placeholderText font: control.font - color: !control.enabled ? control.Universal.chromeDisabledLowColor : - control.activeFocus ? control.Universal.chromeBlackMediumLowColor : control.Universal.baseMediumColor + color: control.placeholderTextColor visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) verticalAlignment: control.verticalAlignment elide: Text.ElideRight diff --git a/src/imports/controls/universal/ToolBar.qml b/src/imports/controls/universal/ToolBar.qml index 65dca3bb..539dcd2e 100644 --- a/src/imports/controls/universal/ToolBar.qml +++ b/src/imports/controls/universal/ToolBar.qml @@ -34,18 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.ToolBar { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) - - contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) - contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) background: Rectangle { implicitHeight: 48 // AppBarThemeCompactHeight diff --git a/src/imports/controls/universal/ToolButton.qml b/src/imports/controls/universal/ToolButton.qml index 118d4baa..62746461 100644 --- a/src/imports/controls/universal/ToolButton.qml +++ b/src/imports/controls/universal/ToolButton.qml @@ -34,20 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 +import QtQuick.Controls.Universal 2.5 T.ToolButton { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) - baselineOffset: contentItem.y + contentItem.baselineOffset + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) padding: 6 spacing: 8 diff --git a/src/imports/controls/universal/ToolSeparator.qml b/src/imports/controls/universal/ToolSeparator.qml index 2e7b6a01..630fa867 100644 --- a/src/imports/controls/universal/ToolSeparator.qml +++ b/src/imports/controls/universal/ToolSeparator.qml @@ -34,15 +34,17 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.ToolSeparator { id: control - implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) leftPadding: vertical ? 16 : 12 rightPadding: vertical ? 15 : 12 diff --git a/src/imports/controls/universal/ToolTip.qml b/src/imports/controls/universal/ToolTip.qml index 1c7c7b69..528d49b5 100644 --- a/src/imports/controls/universal/ToolTip.qml +++ b/src/imports/controls/universal/ToolTip.qml @@ -34,9 +34,9 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 T.ToolTip { id: control @@ -44,10 +44,10 @@ T.ToolTip { x: parent ? (parent.width - implicitWidth) / 2 : 0 y: -implicitHeight - 16 - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) margins: 8 padding: 8 diff --git a/src/imports/controls/universal/Tumbler.qml b/src/imports/controls/universal/Tumbler.qml index f0dbc163..cccd4224 100644 --- a/src/imports/controls/universal/Tumbler.qml +++ b/src/imports/controls/universal/Tumbler.qml @@ -34,17 +34,19 @@ ** ****************************************************************************/ -import QtQuick 2.11 -import QtQuick.Templates 2.4 as T -import QtQuick.Controls.Universal 2.4 -import QtQuick.Controls 2.4 -import QtQuick.Controls.impl 2.4 +import QtQuick 2.12 +import QtQuick.Templates 2.5 as T +import QtQuick.Controls.Universal 2.5 +import QtQuick.Controls 2.5 +import QtQuick.Controls.impl 2.5 T.Tumbler { id: control - implicitWidth: 60 - implicitHeight: 200 + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) || 60 // ### remove 60 in Qt 6 + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) || 200 // ### remove 200 in Qt 6 delegate: Text { text: modelData @@ -56,6 +58,8 @@ T.Tumbler { } contentItem: TumblerView { + implicitWidth: 60 + implicitHeight: 200 model: control.model delegate: control.delegate path: Path { diff --git a/src/imports/controls/universal/qmldir b/src/imports/controls/universal/qmldir index 6555626f..6870a4e1 100644 --- a/src/imports/controls/universal/qmldir +++ b/src/imports/controls/universal/qmldir @@ -1,4 +1,4 @@ module QtQuick.Controls.Universal plugin qtquickcontrols2universalstyleplugin classname QtQuickControls2UniversalStylePlugin -depends QtQuick.Controls 2.4 +depends QtQuick.Controls 2.5 diff --git a/src/imports/controls/universal/qquickuniversaltheme.cpp b/src/imports/controls/universal/qquickuniversaltheme.cpp index 549840b6..041dce9e 100644 --- a/src/imports/controls/universal/qquickuniversaltheme.cpp +++ b/src/imports/controls/universal/qquickuniversaltheme.cpp @@ -36,14 +36,17 @@ #include "qquickuniversaltheme_p.h" -#include <QtGui/qfont.h> #include <QtGui/qfontinfo.h> +#include <QtQuickTemplates2/private/qquicktheme_p.h> QT_BEGIN_NAMESPACE -QQuickUniversalTheme::QQuickUniversalTheme() - : QQuickTheme(QStringLiteral("Universal")) +void QQuickUniversalTheme::initialize(QQuickTheme *theme) { + QFont systemFont; + QFont groupBoxTitleFont; + QFont tabButtonFont; + const QFont font(QLatin1String("Segoe UI")); if (QFontInfo(font).family() == QLatin1String("Segoe UI")) { const QString family = font.family(); @@ -53,27 +56,15 @@ QQuickUniversalTheme::QQuickUniversalTheme() } systemFont.setPixelSize(15); - systemFont = resolveFont(systemFont); + theme->setFont(QQuickTheme::System, systemFont); groupBoxTitleFont.setPixelSize(15); groupBoxTitleFont.setWeight(QFont::DemiBold); - groupBoxTitleFont = resolveFont(groupBoxTitleFont); + theme->setFont(QQuickTheme::GroupBox, groupBoxTitleFont); tabButtonFont.setPixelSize(24); tabButtonFont.setWeight(QFont::Light); - tabButtonFont = resolveFont(tabButtonFont); -} - -const QFont *QQuickUniversalTheme::font(QPlatformTheme::Font type) const -{ - switch (type) { - case QPlatformTheme::GroupBoxTitleFont: - return &groupBoxTitleFont; - case QPlatformTheme::TabButtonFont: - return &tabButtonFont; - default: - return &systemFont; - } + theme->setFont(QQuickTheme::TabBar, tabButtonFont); } QT_END_NAMESPACE diff --git a/src/imports/controls/universal/qquickuniversaltheme_p.h b/src/imports/controls/universal/qquickuniversaltheme_p.h index f15dee3e..f762d0e3 100644 --- a/src/imports/controls/universal/qquickuniversaltheme_p.h +++ b/src/imports/controls/universal/qquickuniversaltheme_p.h @@ -48,22 +48,16 @@ // We mean it. // -#include <QtGui/qfont.h> -#include <QtQuickControls2/private/qquicktheme_p.h> +#include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE -class QQuickUniversalTheme : public QQuickTheme +class QQuickTheme; + +class QQuickUniversalTheme { public: - explicit QQuickUniversalTheme(); - - const QFont *font(Font type = SystemFont) const override; - -private: - QFont systemFont; - QFont groupBoxTitleFont; - QFont tabButtonFont; + static void initialize(QQuickTheme *theme); }; QT_END_NAMESPACE diff --git a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp index 139acab9..1265f636 100644 --- a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp +++ b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp @@ -42,14 +42,6 @@ #include "qquickuniversalstyle_p.h" #include "qquickuniversaltheme_p.h" -static inline void initResources() -{ - Q_INIT_RESOURCE(qtquickcontrols2universalstyleplugin); -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtQuick_Controls_2_Universal); -#endif -} - QT_BEGIN_NAMESPACE class QtQuickControls2UniversalStylePlugin: public QQuickStylePlugin @@ -63,12 +55,11 @@ public: void registerTypes(const char *uri) override; QString name() const override; - QQuickProxyTheme *createTheme() const override; + void initializeTheme(QQuickTheme *theme) override; }; QtQuickControls2UniversalStylePlugin::QtQuickControls2UniversalStylePlugin(QObject *parent) : QQuickStylePlugin(parent) { - initResources(); QQuickUniversalStyle::initGlobals(); } @@ -84,19 +75,19 @@ void QtQuickControls2UniversalStylePlugin::registerTypes(const char *uri) qmlRegisterType<QQuickUniversalBusyIndicator>(import, 2, 0, "BusyIndicatorImpl"); qmlRegisterType<QQuickUniversalProgressBar>(import, 2, 0, "ProgressBarImpl"); - qmlRegisterType(typeUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator"); - qmlRegisterType(typeUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 0, "RadioIndicator"); - qmlRegisterType(typeUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 0, "SwitchIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 0, "RadioIndicator"); + qmlRegisterType(resolvedUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 0, "SwitchIndicator"); } QString QtQuickControls2UniversalStylePlugin::name() const { - return QStringLiteral("universal"); + return QStringLiteral("Universal"); } -QQuickProxyTheme *QtQuickControls2UniversalStylePlugin::createTheme() const +void QtQuickControls2UniversalStylePlugin::initializeTheme(QQuickTheme *theme) { - return new QQuickUniversalTheme; + QQuickUniversalTheme::initialize(theme); } QT_END_NAMESPACE diff --git a/src/imports/controls/universal/universal.pro b/src/imports/controls/universal/universal.pro index c437328c..399de032 100644 --- a/src/imports/controls/universal/universal.pro +++ b/src/imports/controls/universal/universal.pro @@ -1,6 +1,6 @@ TARGET = qtquickcontrols2universalstyleplugin TARGETPATH = QtQuick/Controls.2/Universal -IMPORT_VERSION = 2.4 +IMPORT_VERSION = 2.5 QT += qml quick QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private @@ -19,8 +19,7 @@ SOURCES += \ RESOURCES += \ $$PWD/qtquickcontrols2universalstyleplugin.qrc -!static: CONFIG += qmlcache -CONFIG += no_cxx_module +CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler load(qml_plugin) requires(qtConfig(quickcontrols2-universal)) |