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..2e0a2fd55230b 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabBar.qml @@ -30,5 +30,39 @@ StyledTabBar { background: Item { implicitHeight: 28 + + SeparatorLine { + id: underlineStroke + anchors.bottom: parent.bottom + } + } + + // 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 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) + 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 38e1d40b2be51..c5f8d3a9f764d 100644 --- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml +++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelTabButton.qml @@ -24,6 +24,10 @@ import QtQuick import Muse.UiComponents StyledTabButton { - fillWidth: true + required property real maxWidth + font: ui.theme.bodyBoldFont + width: Math.min(implicitWidth, maxWidth) + leftPadding: 4 + rightPadding: 4 } 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..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,8 @@ Column { id: tabBar PropertiesPanelTabButton { - text: qsTrc("propertiespanel", "Position") + text: "A long truncated title" // qsTrc("propertiespanel", "Position") + maxWidth: tabBar.truncatedItemWidth navigation.name: "PositionTab" navigation.panel: root.navigationPanel @@ -60,7 +61,8 @@ Column { } PropertiesPanelTabButton { - text: qsTrc("propertiespanel", "Style") + text: "Short" // qsTrc("propertiespanel", "Style") + maxWidth: tabBar.truncatedItemWidth navigation.name: "StyleTab" navigation.panel: root.navigationPanel @@ -68,7 +70,8 @@ Column { } PropertiesPanelTabButton { - text: qsTrc("propertiespanel", "Text") + text: "Another long title" // 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..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,8 @@ Column { } PropertiesPanelTabButton { - text: root.headModel?.title ?? "" + text: "Cabeza" //root.headModel?.title ?? "" + maxWidth: tabBar.truncatedItemWidth navigation.name: "HeadTab" navigation.panel: root.navigationPanel @@ -78,7 +79,8 @@ 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" navigation.panel: root.navigationPanel @@ -87,7 +89,8 @@ 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" navigation.panel: root.navigationPanel