diff --git a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml index 5d4d281ff86..4cc82bc79cc 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml @@ -163,14 +163,14 @@ Item { id: tabBar x: 10 // left padding width: parent.width - 20 // right padding - height: DialogValues.projectViewHeaderHeight + height: DialogValues.presetViewHeaderHeight color: DialogValues.lightPaneColor function selectTab(tabIndex, selectLast = false) { var item = repeater.itemAt(tabIndex) tabBarRow.currIndex = tabIndex - projectView.selectLast = selectLast + presetView.selectLast = selectLast BackendApi.presetModel.setPage(tabIndex) // NOTE: it resets preset model } @@ -244,10 +244,10 @@ Item { } // Rectangle Rectangle { - id: projectViewFrame + id: presetViewFrame x: 10 // left padding width: parent.width - 20 // right padding - height: DialogValues.projectViewHeight + height: DialogValues.presetViewHeight color: DialogValues.darkPaneColor Item { @@ -255,7 +255,7 @@ Item { anchors.margins: DialogValues.gridMargins NewProjectView { - id: projectView + id: presetView anchors.fill: parent loader: projectDetailsLoader @@ -265,12 +265,12 @@ Item { target: rootDialog function onHeightChanged() { if (rootDialog.height < 720) { // 720 = minimum height big dialog - DialogValues.projectViewHeight = - DialogValues.projectItemHeight + DialogValues.presetViewHeight = + DialogValues.presetItemHeight + 2 * DialogValues.gridMargins } else { - DialogValues.projectViewHeight = - DialogValues.projectItemHeight * 2 + DialogValues.presetViewHeight = + DialogValues.presetItemHeight * 2 + DialogValues.gridSpacing + 2 * DialogValues.gridMargins } @@ -289,7 +289,7 @@ Item { lineHeight: DialogValues.defaultLineHeight lineHeightMode: Text.FixedHeight leftPadding: 14 - width: projectViewFrame.width + width: presetViewFrame.width color: DialogValues.textColor wrapMode: Text.WordWrap maximumLineCount: 4 diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml index 97a5ac2bf9e..b348a6da350 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml @@ -371,6 +371,9 @@ Item { if (widthField.realValue && heightField.realValue) { [widthField.realValue, heightField.realValue] = [heightField.realValue, widthField.realValue] orientationButton.checked = !orientationButton.checked + + if (widthField.realValue === heightField.realValue) + orientationButton.checked ? setVertical() : setHorizontal() } } diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml index 7c11f231fc7..d85093738d8 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml @@ -33,9 +33,9 @@ QtObject { readonly property int dialogWidth: 1522 readonly property int dialogHeight: 940 - readonly property int projectViewMinimumWidth: 600 - readonly property int projectViewMinimumHeight: root.gridCellHeight - readonly property int dialogContentHeight: root.projectViewHeight + 300 // i.e. dialog without header and footer + readonly property int presetViewMinimumWidth: 600 + readonly property int presetViewMinimumHeight: root.gridCellHeight + readonly property int dialogContentHeight: root.presetViewHeight + 300 // i.e. dialog without header and footer readonly property int loadedPanesWidth: root.detailsPaneWidth + root.stylesPaneWidth readonly property int detailsPaneWidth: 330 + root.detailsPanePadding * 2 readonly property int dialogTitleTextHeight: 85 @@ -62,14 +62,14 @@ QtObject { readonly property int styleTextHeight: 18 readonly property int footerHeight: 73 - readonly property int projectItemWidth: 136 - readonly property int projectItemHeight: 110 - property int projectViewHeight: root.projectItemHeight * 2 + root.gridSpacing + root.gridMargins * 2 - readonly property int projectViewHeaderHeight: 38 + readonly property int presetItemWidth: 136 + readonly property int presetItemHeight: 110 + property int presetViewHeight: root.presetItemHeight * 2 + root.gridSpacing + root.gridMargins * 2 + readonly property int presetViewHeaderHeight: 38 readonly property int gridMargins: 20 - readonly property int gridCellWidth: root.projectItemWidth + root.gridSpacing - readonly property int gridCellHeight: root.projectItemHeight + root.gridSpacing + readonly property int gridCellWidth: root.presetItemWidth + root.gridSpacing + readonly property int gridCellHeight: root.presetItemHeight + root.gridSpacing readonly property int gridSpacing: 2 readonly property int dialogButtonWidth: 100 diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml index aae984b069a..e8bb58cfa76 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml @@ -97,8 +97,8 @@ ScrollView { property bool hover: delegate.hovered || removeMouseArea.containsMouse - width: DialogValues.projectItemWidth - height: DialogValues.projectItemHeight + width: DialogValues.presetItemWidth + height: DialogValues.presetItemHeight onClicked: delegate.GridView.view.currentIndex = index @@ -107,7 +107,7 @@ ScrollView { width: parent.width height: parent.height color: delegate.hover ? scrollView.backgroundHoverColor : "transparent" - border.color: delegate.hover ? projectTypeName.color : "transparent" + border.color: delegate.hover ? presetName.color : "transparent" } function fontIconCode(index) { @@ -125,7 +125,7 @@ ScrollView { anchors.horizontalCenter: parent.horizontalCenter Label { - id: projectTypeIcon + id: presetIcon text: delegate.fontIconCode(index) color: DialogValues.textColor horizontalAlignment: Text.AlignHCenter @@ -137,25 +137,25 @@ ScrollView { } // Preset type icon Label Text { - id: projectTypeName + id: presetName color: DialogValues.textColor text: name font.pixelSize: DialogValues.defaultPixelSize lineHeight: DialogValues.defaultLineHeight lineHeightMode: Text.FixedHeight - width: DialogValues.projectItemWidth - 16 + width: DialogValues.presetItemWidth - 16 elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignTop Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: projectTypeName.width - Layout.minimumWidth: projectTypeName.width - Layout.maximumWidth: projectTypeName.width + Layout.preferredWidth: presetName.width + Layout.minimumWidth: presetName.width + Layout.maximumWidth: presetName.width ToolTip { id: toolTip y: -toolTip.height - visible: delegate.hovered && projectTypeName.truncated + visible: delegate.hovered && presetName.truncated text: name delay: 1000 height: 20 @@ -176,7 +176,7 @@ ScrollView { } Text { - id: projectTypeResolution + id: presetResolution color: DialogValues.textColor text: resolution font.pixelSize: DialogValues.defaultPixelSize @@ -219,7 +219,7 @@ ScrollView { : Qt.ArrowCursor onClicked: { - removePresetDialog.presetName = projectTypeName.text + removePresetDialog.presetName = presetName.text removePresetDialog.open() } } @@ -232,15 +232,15 @@ ScrollView { when: delegate.GridView.isCurrentItem PropertyChanges { - target: projectTypeName + target: presetName color: DialogValues.textColorInteraction } PropertyChanges { - target: projectTypeResolution + target: presetResolution color: DialogValues.textColorInteraction } PropertyChanges { - target: projectTypeIcon + target: presetIcon color: DialogValues.textColorInteraction } PropertyChanges {