From 70f7a0132c5e76d99c793b530be0272703197cb9 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Thu, 9 Feb 2023 19:41:58 +0100 Subject: [PATCH 1/5] Fix QML warning in "How would you like to save?" dialog parent is null for some reason --- .../qml/MuseScore/Project/AskSaveLocationTypeDialog.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/project/qml/MuseScore/Project/AskSaveLocationTypeDialog.qml b/src/project/qml/MuseScore/Project/AskSaveLocationTypeDialog.qml index e73fc7e084f07..38b94ad412d54 100644 --- a/src/project/qml/MuseScore/Project/AskSaveLocationTypeDialog.qml +++ b/src/project/qml/MuseScore/Project/AskSaveLocationTypeDialog.qml @@ -62,12 +62,13 @@ StyledDialogView { } RowLayout { + id: optionsRowLayout spacing: 24 NavigationPanel { id: optionsNavPanel name: "SaveLocationOptionsButtons" - enabled: parent.enabled && parent.visible + enabled: optionsRowLayout.enabled && optionsRowLayout.visible direction: NavigationPanel.Horizontal section: root.navigationSection order: 1 From c2373dcf259fa304d2890e1a9586d9ae9b3f372d Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:23:21 +0100 Subject: [PATCH 2/5] Fix text wrap in Score Upload Success dialog --- .../Project/ProjectUploadedDialog.qml | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/project/qml/MuseScore/Project/ProjectUploadedDialog.qml b/src/project/qml/MuseScore/Project/ProjectUploadedDialog.qml index b64541af65298..7249869fa5ba2 100644 --- a/src/project/qml/MuseScore/Project/ProjectUploadedDialog.qml +++ b/src/project/qml/MuseScore/Project/ProjectUploadedDialog.qml @@ -103,16 +103,23 @@ StyledDialogView { StyledTextLabel { id: titleLabel + Layout.fillWidth: true + text: qsTrc("global", "Success!") font: ui.theme.tabBoldFont + horizontalAlignment: Text.AlignLeft + wrapMode: Text.Wrap } StyledTextLabel { id: subtitleLabel + Layout.fillWidth: true Layout.topMargin: 6 text: qsTrc("project", "All saved changes will now update to the cloud") + horizontalAlignment: Text.AlignLeft + wrapMode: Text.Wrap } Item { @@ -137,8 +144,12 @@ StyledDialogView { StyledTextLabel { id: publishTitleLabel + Layout.fillWidth: true + text: qsTrc("project", "Publish your finished scores on MuseScore.com") font: ui.theme.largeBodyBoldFont + horizontalAlignment: Text.AlignLeft + wrapMode: Text.Wrap } Column { @@ -165,14 +176,13 @@ StyledDialogView { qsTrc("project", "Share your projects and collaborate with other musicians") ] - Row { + RowLayout { + width: parent.width spacing: 10 property string title: modelData Rectangle { - anchors.verticalCenter: parent.verticalCenter - width: 9 height: width radius: width / 2 @@ -181,7 +191,11 @@ StyledDialogView { } StyledTextLabel { + Layout.fillWidth: true + text: title + horizontalAlignment: Text.AlignLeft + wrapMode: Text.Wrap } } } From 6415538c9ce18600231a8644d9ba9168a31bc855 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:28:49 +0100 Subject: [PATCH 3/5] Fix vertical spacing in Score Upload Success dialog --- .../Project/ProjectUploadedDialog.qml | 156 ++++++++++-------- 1 file changed, 83 insertions(+), 73 deletions(-) diff --git a/src/project/qml/MuseScore/Project/ProjectUploadedDialog.qml b/src/project/qml/MuseScore/Project/ProjectUploadedDialog.qml index 7249869fa5ba2..b6da220b5e511 100644 --- a/src/project/qml/MuseScore/Project/ProjectUploadedDialog.qml +++ b/src/project/qml/MuseScore/Project/ProjectUploadedDialog.qml @@ -124,114 +124,124 @@ StyledDialogView { Item { Layout.fillWidth: true - Layout.preferredHeight: 228 + Layout.fillHeight: true Layout.topMargin: 24 - Rectangle { - anchors.fill: parent - - color: ui.theme.buttonColor - opacity: 0.4 - radius: 3 - } + implicitHeight: bodyItem.implicitHeight - ColumnLayout { - anchors.fill: parent - anchors.margins: 28 + Item { + id: bodyItem - z: 1000 + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right - StyledTextLabel { - id: publishTitleLabel + implicitHeight: bodyColumn.implicitHeight + 2 * bodyColumn.anchors.margins - Layout.fillWidth: true + Rectangle { + anchors.fill: parent - text: qsTrc("project", "Publish your finished scores on MuseScore.com") - font: ui.theme.largeBodyBoldFont - horizontalAlignment: Text.AlignLeft - wrapMode: Text.Wrap + color: ui.theme.buttonColor + opacity: 0.4 + radius: 3 } - Column { - Layout.fillWidth: true + ColumnLayout { + id: bodyColumn - spacing: 14 + anchors.fill: parent + anchors.margins: 28 - Repeater { - id: repeater + spacing: 24 - function contentText() { - var result = "" - for (var i = 0; i < repeater.count; ++i) { - var item = itemAt(i) - result += item.title + "; " - } + StyledTextLabel { + id: publishTitleLabel - return result - } + Layout.fillWidth: true - model: [ - qsTrc("project", "Create a portfolio to showcase your music"), - qsTrc("project", "Gain followers and receive score comments and ratings"), - qsTrc("project", "Share your projects and collaborate with other musicians") - ] + text: qsTrc("project", "Publish your finished scores on MuseScore.com") + font: ui.theme.largeBodyBoldFont + horizontalAlignment: Text.AlignLeft + wrapMode: Text.Wrap + } + + Column { + Layout.fillWidth: true - RowLayout { - width: parent.width - spacing: 10 + spacing: 12 - property string title: modelData + Repeater { + id: repeater - Rectangle { - width: 9 - height: width - radius: width / 2 + function contentText() { + var result = "" + for (var i = 0; i < repeater.count; ++i) { + var item = itemAt(i) + result += item.title + "; " + } - color: ui.theme.accentColor + return result } - StyledTextLabel { - Layout.fillWidth: true + model: [ + qsTrc("project", "Create a portfolio to showcase your music"), + qsTrc("project", "Gain followers and receive score comments and ratings"), + qsTrc("project", "Share your projects and collaborate with other musicians") + ] + + RowLayout { + width: parent.width + spacing: 10 + + property string title: modelData + + Rectangle { + width: 9 + height: width + radius: width / 2 - text: title - horizontalAlignment: Text.AlignLeft - wrapMode: Text.Wrap + color: ui.theme.accentColor + } + + StyledTextLabel { + Layout.fillWidth: true + + text: title + horizontalAlignment: Text.AlignLeft + wrapMode: Text.Wrap + } } } } - } - FlatButton { - id: watchVideoButton + FlatButton { + id: watchVideoButton - Layout.alignment: Qt.AlignLeft + Layout.alignment: Qt.AlignLeft - accentButton: true - text: qsTrc("project", "Watch video") + accentButton: true + text: qsTrc("project", "Watch video") - navigation.panel: buttonsNavPanel - navigation.column: 1 - navigation.accessible.ignored: true - navigation.onActiveChanged: { - if (!navigation.active) { - accessible.ignored = false - accessible.focused = true - accessibleInfo.resetFocus() + navigation.panel: buttonsNavPanel + navigation.column: 1 + navigation.accessible.ignored: true + navigation.onActiveChanged: { + if (!navigation.active) { + accessible.ignored = false + accessible.focused = true + accessibleInfo.resetFocus() + } } - } - onClicked: { - Qt.openUrlExternally("https://youtu.be/6LP4U_BF23w") - root.hide() + onClicked: { + Qt.openUrlExternally("https://youtu.be/6LP4U_BF23w") + root.hide() + } } } } } - Item { - Layout.fillHeight: true - } - Row { Layout.alignment: Qt.AlignRight From 8b126a25cf539d28de1084953da55f067bb8a97b Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:52:31 +0100 Subject: [PATCH 4/5] Fix width of checkboxes in New Workspace dialog --- .../qml/MuseScore/Workspace/NewWorkspaceDialog.qml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/workspace/qml/MuseScore/Workspace/NewWorkspaceDialog.qml b/src/workspace/qml/MuseScore/Workspace/NewWorkspaceDialog.qml index 969d38a695ae9..512ed8d74b799 100644 --- a/src/workspace/qml/MuseScore/Workspace/NewWorkspaceDialog.qml +++ b/src/workspace/qml/MuseScore/Workspace/NewWorkspaceDialog.qml @@ -101,7 +101,7 @@ StyledDialogView { Layout.topMargin: 12 Layout.fillWidth: true - horizontalAlignment: Qt.AlignLeft + horizontalAlignment: Text.AlignLeft text: workspaceModel.errorMessage } @@ -113,7 +113,7 @@ StyledDialogView { text: qsTrc("workspace", "Select the options you want remembered in your new workspace") - horizontalAlignment: Qt.AlignLeft + horizontalAlignment: Text.AlignLeft } Grid { @@ -123,9 +123,11 @@ StyledDialogView { columns: 2 rowSpacing: 20 - columnSpacing: rowSpacing * 4 + columnSpacing: rowSpacing CheckBox { + width: (parent.width - parent.columnSpacing) / 2 + checked: workspaceModel.useUiPreferences text: qsTrc("workspace", "UI preferences (colors, canvas style, etc.)") @@ -141,6 +143,8 @@ StyledDialogView { } CheckBox { + width: (parent.width - parent.columnSpacing) / 2 + checked: workspaceModel.useUiArrangement text: qsTrc("workspace", "UI arrangement") @@ -155,6 +159,8 @@ StyledDialogView { } CheckBox { + width: (parent.width - parent.columnSpacing) / 2 + checked: workspaceModel.usePalettes text: qsTrc("workspace", "Palettes") @@ -169,6 +175,8 @@ StyledDialogView { } CheckBox { + width: (parent.width - parent.columnSpacing) / 2 + checked: workspaceModel.useToolbarCustomization text: qsTrc("workspace", "Toolbar customizations") From 39ed2a5b5eca57ad4cad5470b8732465a672c9f9 Mon Sep 17 00:00:00 2001 From: Casper Jeukendrup <48658420+cbjeukendrup@users.noreply.github.com> Date: Thu, 9 Feb 2023 23:44:18 +0100 Subject: [PATCH 5/5] Elide text at the borders of FlatButton --- .../Gallery/GeneralComponentsGallery.qml | 24 +++++++++++++++++++ .../qml/MuseScore/UiComponents/FlatButton.qml | 13 +++++++--- .../internal/AudioResourceControl.qml | 3 ++- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/appshell/qml/DevTools/Gallery/GeneralComponentsGallery.qml b/src/appshell/qml/DevTools/Gallery/GeneralComponentsGallery.qml index f9658ff278231..ecdd2abc2316a 100644 --- a/src/appshell/qml/DevTools/Gallery/GeneralComponentsGallery.qml +++ b/src/appshell/qml/DevTools/Gallery/GeneralComponentsGallery.qml @@ -366,12 +366,36 @@ Rectangle { text: "Text with icon" } + FlatButton { + icon: IconCode.SAVE + text: "Suuuuuuuuuuuuuper long text with icon" + } + + FlatButton { + icon: IconCode.SAVE + text: "Elided suuuuuuuuuuuuuper long text with icon" + width: 132 + } + FlatButton { icon: IconCode.SAVE text: "Text with icon" orientation: Qt.Horizontal } + FlatButton { + icon: IconCode.SAVE + text: "Suuuuuuuuuuuuuper long text with icon" + orientation: Qt.Horizontal + } + + FlatButton { + icon: IconCode.SAVE + text: "Elided suuuuuuuuuuuuuper long text with icon" + orientation: Qt.Horizontal + width: 132 + } + FlatButton { text: "Just text" } diff --git a/src/framework/uicomponents/qml/MuseScore/UiComponents/FlatButton.qml b/src/framework/uicomponents/qml/MuseScore/UiComponents/FlatButton.qml index a24cc68f88b9f..8fbc48adaeaa2 100644 --- a/src/framework/uicomponents/qml/MuseScore/UiComponents/FlatButton.qml +++ b/src/framework/uicomponents/qml/MuseScore/UiComponents/FlatButton.qml @@ -98,8 +98,8 @@ FocusScope { objectName: root.text - implicitWidth: contentLoader.implicitWidth + 2 * margins - implicitHeight: Math.max(contentLoader.implicitHeight, ui.theme.defaultButtonSize) + implicitWidth: contentLoader.itemImplicitWidth + 2 * margins + implicitHeight: Math.max(contentLoader.itemImplicitHeight, ui.theme.defaultButtonSize) opacity: root.enabled ? 1.0 : ui.theme.itemOpacityDisabled @@ -177,6 +177,9 @@ FocusScope { anchors.verticalCenter: parent ? parent.verticalCenter : undefined anchors.horizontalCenter: parent ? parent.horizontalCenter : undefined + readonly property real itemImplicitWidth: item ? item.implicitWidth : 0 + readonly property real itemImplicitHeight: item ? item.implicitHeight : 0 + sourceComponent: root.contentItem ? root.contentItem : defaultContentComponent readonly property Component defaultContentComponent: root.isVertical ? verticalContentComponent : horizontalContentComponent } @@ -185,6 +188,7 @@ FocusScope { id: verticalContentComponent ColumnLayout { + width: Math.min(implicitWidth, root.width) spacing: 4 StyledIconLabel { @@ -195,6 +199,7 @@ FocusScope { } StyledTextLabel { + Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter text: root.text font: root.textFont @@ -209,6 +214,7 @@ FocusScope { id: horizontalContentComponent RowLayout { + width: Math.min(implicitWidth, root.width) spacing: 8 StyledIconLabel { @@ -219,6 +225,7 @@ FocusScope { } StyledTextLabel { + Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter text: root.text font: root.textFont @@ -247,7 +254,7 @@ FocusScope { PropertyChanges { target: root - implicitWidth: Math.max(contentLoader.implicitWidth + 2 * root.margins, + implicitWidth: Math.max(contentLoader.itemImplicitWidth + 2 * root.margins, root.minWidth) implicitHeight: ui.theme.defaultButtonSize } diff --git a/src/playback/qml/MuseScore/Playback/internal/AudioResourceControl.qml b/src/playback/qml/MuseScore/Playback/internal/AudioResourceControl.qml index ef2a3565c40f3..cd8019d0a78d7 100644 --- a/src/playback/qml/MuseScore/Playback/internal/AudioResourceControl.qml +++ b/src/playback/qml/MuseScore/Playback/internal/AudioResourceControl.qml @@ -230,8 +230,9 @@ Item { } contentItem: StyledTextLabel { - height: root.height + // To do: this causes a binding loop warning width: titleLoader.width - 8 // 4px padding on each side + height: root.height text: root.title }