From 9c168357a58700f649a1d31691fcac0ea78020fe Mon Sep 17 00:00:00 2001 From: ajuncosa Date: Tue, 23 Jun 2026 17:44:35 +0200 Subject: [PATCH 1/4] Re-design PropertiesPanelTabButtons to hug contents instead of having equal widths --- muse | 2 +- .../common/PropertiesPanelTabBar.qml | 25 +++++++++++++++++++ .../common/PropertiesPanelTabButton.qml | 4 ++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/muse b/muse index 8c223d87b982e..5ddfe95b55233 160000 --- a/muse +++ b/muse @@ -1 +1 @@ -Subproject commit 8c223d87b982edf135a8a21da61189201a7ec5a6 +Subproject commit 5ddfe95b55233d2b766a1fce69db5dc2c3871ecc diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml index be5a67032a0d8..86d42710d570d 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml @@ -31,4 +31,29 @@ StyledTabBar { background: Item { implicitHeight: 28 } + + // Equally divided share given to overflowing tabs, or Infinity when everything fits: + readonly property real truncatedItemWidth: { + let items = contentChildren.filter(i => i.visible) + if (items.length === 0) { + return Infinity + } + + let totalSpacing = (items.length - 1) * root.spacing + let totalContent = items.reduce((s, i) => s + i.implicitWidth, 0) + if (totalContent + totalSpacing <= root.width) { + return Infinity + } + + let share = (root.width - totalSpacing) / items.length + let prev = -1 + while (share !== prev) { + prev = share + let fittedItems = items.filter(i => i.implicitWidth < share) + let totalFittedWidth = fittedItems.reduce((s, i) => s + i.implicitWidth, 0) + share = (root.width - totalFittedWidth - totalSpacing) / (items.length - fittedItems.length) + } + return share + } + } diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml index 38e1d40b2be51..4e7ff1c60db44 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml @@ -24,6 +24,8 @@ import QtQuick import Muse.UiComponents StyledTabButton { - fillWidth: true + readonly property PropertiesPanelTabBar propertiesTabBar: tabBar as PropertiesPanelTabBar + font: ui.theme.bodyBoldFont + width: propertiesTabBar ? Math.min(implicitWidth, propertiesTabBar.truncatedItemWidth) : implicitWidth } From 3e0b90123d3d9570c461ec21577c8b2b8d34e26b Mon Sep 17 00:00:00 2001 From: ajuncosa Date: Wed, 24 Jun 2026 09:42:58 +0200 Subject: [PATCH 2/4] Refactor PropertiesPanelTabButton to receive the maximum truncated width as a property instead of casting the StyledTabButton tabBar. --- .../PropertiesPanel/common/PropertiesPanelTabButton.qml | 4 ++-- .../PropertiesPanel/notation/frames/FretFrameSettings.qml | 2 ++ .../notation/fretdiagrams/internal/FretDiagramTabPanel.qml | 2 ++ .../notation/lines/GradualTempoChangeSettings.qml | 3 +++ .../PropertiesPanel/notation/lines/HairpinLineSettings.qml | 3 +++ .../MuseScore/PropertiesPanel/notation/lines/LineSettings.qml | 2 ++ .../MuseScore/PropertiesPanel/notation/notes/NoteSettings.qml | 3 +++ 7 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml index 4e7ff1c60db44..230e0c81e814a 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml @@ -24,8 +24,8 @@ import QtQuick import Muse.UiComponents StyledTabButton { - readonly property PropertiesPanelTabBar propertiesTabBar: tabBar as PropertiesPanelTabBar + required property real maxWidth font: ui.theme.bodyBoldFont - width: propertiesTabBar ? Math.min(implicitWidth, propertiesTabBar.truncatedItemWidth) : implicitWidth + width: Math.min(implicitWidth, maxWidth) } diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/frames/FretFrameSettings.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/frames/FretFrameSettings.qml index 388b6be26fbc5..97e22faa7bbef 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/frames/FretFrameSettings.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/frames/FretFrameSettings.qml @@ -56,6 +56,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Chords") + maxWidth: tabBar.truncatedItemWidth navigation.name: "ChordsTab" navigation.panel: root.navigationPanel @@ -64,6 +65,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Frame") + maxWidth: tabBar.truncatedItemWidth navigation.name: "FrameTab" navigation.panel: root.navigationPanel diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/fretdiagrams/internal/FretDiagramTabPanel.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/fretdiagrams/internal/FretDiagramTabPanel.qml index 44d522f9a3900..9c78c1b8b53c0 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/fretdiagrams/internal/FretDiagramTabPanel.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/fretdiagrams/internal/FretDiagramTabPanel.qml @@ -48,6 +48,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "General") + maxWidth: tabBar.truncatedItemWidth navigation.name: "GeneralTab" navigation.panel: root.navigationPanel @@ -56,6 +57,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Settings") + maxWidth: tabBar.truncatedItemWidth navigation.name: "SettingsTab" navigation.panel: root.navigationPanel diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/GradualTempoChangeSettings.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/GradualTempoChangeSettings.qml index 82b4b1faccf60..5bfd6b562b8fa 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/GradualTempoChangeSettings.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/GradualTempoChangeSettings.qml @@ -51,6 +51,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Position") + maxWidth: tabBar.truncatedItemWidth navigation.name: "PositionTab" navigation.panel: root.navigationPanel @@ -59,6 +60,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Style") + maxWidth: tabBar.truncatedItemWidth navigation.name: "StyleTab" navigation.panel: root.navigationPanel @@ -67,6 +69,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Text") + maxWidth: tabBar.truncatedItemWidth navigation.name: "TextTab" navigation.panel: root.navigationPanel diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/HairpinLineSettings.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/HairpinLineSettings.qml index 20a7de092ec8f..5ca6c7766f779 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/HairpinLineSettings.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/HairpinLineSettings.qml @@ -53,6 +53,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Position") + maxWidth: tabBar.truncatedItemWidth navigation.name: "PositionTab" navigation.panel: root.navigationPanel @@ -61,6 +62,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Style") + maxWidth: tabBar.truncatedItemWidth navigation.name: "StyleTab" navigation.panel: root.navigationPanel @@ -69,6 +71,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Text") + maxWidth: tabBar.truncatedItemWidth navigation.name: "TextTab" navigation.panel: root.navigationPanel diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/LineSettings.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/LineSettings.qml index 890714cb07878..5e237045d907f 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/LineSettings.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/LineSettings.qml @@ -53,6 +53,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Style") + maxWidth: tabBar.truncatedItemWidth navigation.name: "StyleTab" navigation.panel: root.navigationPanel @@ -61,6 +62,7 @@ Column { PropertiesPanelTabButton { text: qsTrc("propertiespanel", "Text") + maxWidth: tabBar.truncatedItemWidth navigation.name: "TextTab" navigation.panel: root.navigationPanel diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/NoteSettings.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/NoteSettings.qml index 95cc020652be5..34a097624bd69 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/NoteSettings.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/NoteSettings.qml @@ -70,6 +70,7 @@ Column { PropertiesPanelTabButton { text: root.headModel?.title ?? "" + maxWidth: tabBar.truncatedItemWidth navigation.name: "HeadTab" navigation.panel: root.navigationPanel @@ -79,6 +80,7 @@ Column { PropertiesPanelTabButton { visible: root.headModel ? !root.headModel.isTrillCueNote : true text: root.stemModel ? root.stemModel.title : "" + maxWidth: tabBar.truncatedItemWidth navigation.name: "StemTab" navigation.panel: root.navigationPanel @@ -88,6 +90,7 @@ Column { PropertiesPanelTabButton { visible: root.headModel ? !root.headModel.isTrillCueNote : true text: root.beamModel ? root.beamModel.title : "" + maxWidth: tabBar.truncatedItemWidth navigation.name: "BeamTab" navigation.panel: root.navigationPanel From 150fd2ac2b474a0e1a73aad50153c5f428830055 Mon Sep 17 00:00:00 2001 From: ajuncosa Date: Wed, 24 Jun 2026 11:07:42 +0200 Subject: [PATCH 3/4] Add padding to PropertiesPanelTabButton and an underline stroke to the PropertiesPanelTabBar. Protect truncatedItemWidth computation against negative values. --- .../common/PropertiesPanelTabBar.qml | 13 +++++++++++-- .../common/PropertiesPanelTabButton.qml | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml index 86d42710d570d..2e0a2fd55230b 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml @@ -30,6 +30,11 @@ StyledTabBar { background: Item { implicitHeight: 28 + + SeparatorLine { + id: underlineStroke + anchors.bottom: parent.bottom + } } // Equally divided share given to overflowing tabs, or Infinity when everything fits: @@ -45,13 +50,17 @@ StyledTabBar { return Infinity } - let share = (root.width - totalSpacing) / items.length + let availableWidth = Math.max(0, root.width - totalSpacing) + let share = availableWidth / items.length let prev = -1 while (share !== prev) { prev = share let fittedItems = items.filter(i => i.implicitWidth < share) let totalFittedWidth = fittedItems.reduce((s, i) => s + i.implicitWidth, 0) - share = (root.width - totalFittedWidth - totalSpacing) / (items.length - fittedItems.length) + let remaining = items.length - fittedItems.length + share = remaining > 0 + ? Math.max(0, (root.width - totalFittedWidth - totalSpacing) / remaining) + : 0 } return share } diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml index 230e0c81e814a..c5f8d3a9f764d 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml @@ -28,4 +28,6 @@ StyledTabButton { font: ui.theme.bodyBoldFont width: Math.min(implicitWidth, maxWidth) + leftPadding: 4 + rightPadding: 4 } From 4e8e266753d0395b9730bc284ba0e2353206ff87 Mon Sep 17 00:00:00 2001 From: ajuncosa Date: Fri, 26 Jun 2026 17:22:32 +0200 Subject: [PATCH 4/4] tmp: add longer properties panel tab button names --- .../PropertiesPanel/notation/lines/HairpinLineSettings.qml | 6 +++--- .../PropertiesPanel/notation/notes/NoteSettings.qml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/HairpinLineSettings.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/HairpinLineSettings.qml index 5ca6c7766f779..cdc5e8d2f8290 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/HairpinLineSettings.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/lines/HairpinLineSettings.qml @@ -52,7 +52,7 @@ Column { id: tabBar PropertiesPanelTabButton { - text: qsTrc("propertiespanel", "Position") + text: "A long truncated title" // qsTrc("propertiespanel", "Position") maxWidth: tabBar.truncatedItemWidth navigation.name: "PositionTab" @@ -61,7 +61,7 @@ Column { } PropertiesPanelTabButton { - text: qsTrc("propertiespanel", "Style") + text: "Short" // qsTrc("propertiespanel", "Style") maxWidth: tabBar.truncatedItemWidth navigation.name: "StyleTab" @@ -70,7 +70,7 @@ Column { } PropertiesPanelTabButton { - text: qsTrc("propertiespanel", "Text") + text: "Another long title" // qsTrc("propertiespanel", "Text") maxWidth: tabBar.truncatedItemWidth navigation.name: "TextTab" diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/NoteSettings.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/NoteSettings.qml index 34a097624bd69..1c22a961cca6e 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/NoteSettings.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/notes/NoteSettings.qml @@ -69,7 +69,7 @@ Column { } PropertiesPanelTabButton { - text: root.headModel?.title ?? "" + text: "Cabeza" //root.headModel?.title ?? "" maxWidth: tabBar.truncatedItemWidth navigation.name: "HeadTab" @@ -79,7 +79,7 @@ Column { PropertiesPanelTabButton { visible: root.headModel ? !root.headModel.isTrillCueNote : true - text: root.stemModel ? root.stemModel.title : "" + text: "Plica" // root.stemModel ? root.stemModel.title : "" maxWidth: tabBar.truncatedItemWidth navigation.name: "StemTab" @@ -89,7 +89,7 @@ Column { PropertiesPanelTabButton { visible: root.headModel ? !root.headModel.isTrillCueNote : true - text: root.beamModel ? root.beamModel.title : "" + text: "Barra de agrupación but with a longer title" // root.beamModel ? root.beamModel.title : "" maxWidth: tabBar.truncatedItemWidth navigation.name: "BeamTab"