diff --git a/src/notationscene/qml/MuseScore/NotationScene/NoteInputBar.qml b/src/notationscene/qml/MuseScore/NotationScene/NoteInputBar.qml
index 00cb0ec849d0d..f778de5cacc11 100644
--- a/src/notationscene/qml/MuseScore/NotationScene/NoteInputBar.qml
+++ b/src/notationscene/qml/MuseScore/NotationScene/NoteInputBar.qml
@@ -178,7 +178,7 @@ Item {
}
}
- FlatButton {
+ PopupButton {
id: customizeButton
anchors.margins: 4
@@ -198,15 +198,8 @@ Item {
navigation.order: 100
navigation.accessible.name: qsTrc("notation", "Customize toolbar")
- onClicked: {
- customizePopup.toggleOpened()
- }
-
- NoteInputBarCustomisePopup {
- id: customizePopup
-
- anchorItem: !root.floating ? ui.rootItem : null
- }
+ popupAnchorItem: root.floating ? null : ui.rootItem
+ popupComponent: NoteInputBarCustomisePopup {}
}
states: [
diff --git a/src/palette/qml/MuseScore/Palette/internal/PalettesPanelHeader.qml b/src/palette/qml/MuseScore/Palette/internal/PalettesPanelHeader.qml
index b625600d1e3f0..77d46d083b571 100644
--- a/src/palette/qml/MuseScore/Palette/internal/PalettesPanelHeader.qml
+++ b/src/palette/qml/MuseScore/Palette/internal/PalettesPanelHeader.qml
@@ -35,7 +35,7 @@ Item {
readonly property bool isSearchFieldFocused: searchField.activeFocus
readonly property string searchText: searchField.searchText
- property alias popupMaxHeight: addPalettesPopup.maxHeight
+ property int popupMaxHeight: 400
property var popupAnchorItem: null
property alias navigation: navPanel
@@ -68,46 +68,7 @@ Item {
}
}
- QtObject {
- id: prv
-
- property var openedPopup: null
- property bool isPopupOpened: Boolean(openedPopup) && openedPopup.isOpened
-
- function openPopup(popup, model) {
- if (isPopupOpened) {
- if (openedPopup === popup) {
- resetOpenedPopup()
- return
- }
-
- resetOpenedPopup()
- }
-
- if (Boolean(popup)) {
- openedPopup = popup
-
- if (Boolean(model)) {
- popup.model = model
- }
-
- popup.open()
- }
- }
-
- function closeOpenedPopup() {
- if (isPopupOpened) {
- resetOpenedPopup()
- }
- }
-
- function resetOpenedPopup() {
- openedPopup.close()
- openedPopup = null
- }
- }
-
- FlatButton {
+ PopupButton {
id: addPalettesButton
objectName: "AddPalettesBtn"
@@ -122,30 +83,31 @@ Item {
visible: !root.isSearchOpened
enabled: visible
- onClicked: {
- prv.openPopup(addPalettesPopup, root.paletteProvider.availableExtraPalettesModel())
- }
+ popupAnchorItem: root.popupAnchorItem
- AddPalettesPopup {
- id: addPalettesPopup
+ popupComponent: AddPalettesPopup {
paletteProvider: root.paletteProvider
-
+ model: root.paletteProvider ? root.paletteProvider.availableExtraPalettesModel() : null
popupAvailableWidth: root.width
- anchorItem: root.popupAnchorItem
+ maxHeight: root.popupMaxHeight
onAddCustomPaletteRequested: {
- prv.openPopup(createCustomPalettePopup)
+ addPalettesButton.close()
+ createCustomPalettePopupLoader.toggleOpened()
}
}
- CreateCustomPalettePopup {
- id: createCustomPalettePopup
+ StyledPopupLoader {
+ id: createCustomPalettePopupLoader
- popupAvailableWidth: root.width
- anchorItem: root.popupAnchorItem
+ popupAnchorItem: root.popupAnchorItem
+
+ sourceComponent: CreateCustomPalettePopup {
+ popupAvailableWidth: root.width
- onAddCustomPaletteRequested: function(paletteName) {
- root.addCustomPaletteRequested(paletteName)
+ onAddCustomPaletteRequested: function(paletteName) {
+ root.addCustomPaletteRequested(paletteName)
+ }
}
}
}
@@ -165,7 +127,8 @@ Item {
enabled: visible
onClicked: {
- prv.closeOpenedPopup()
+ addPalettesButton.close()
+ createCustomPalettePopupLoader.close()
root.startSearch()
}
}
diff --git a/src/playback/qml/MuseScore/Playback/internal/PlaybackToolBarActions.qml b/src/playback/qml/MuseScore/Playback/internal/PlaybackToolBarActions.qml
index e2dd789a9bdd1..279eb9051ce92 100644
--- a/src/playback/qml/MuseScore/Playback/internal/PlaybackToolBarActions.qml
+++ b/src/playback/qml/MuseScore/Playback/internal/PlaybackToolBarActions.qml
@@ -213,12 +213,13 @@ Item {
Component {
id: tempoButtonComponent
- FlatButton {
+ PopupButton {
+ id: playbackSpeedButton
+
implicitWidth: tempoLoader.tempoViewWidth
implicitHeight: root.height
- accentButton: playbackSpeedPopup.isOpened
- transparent: !accentButton
+ transparent: !root.isPopupOpened
toolTipTitle: qsTrc("playback", "Speed")
@@ -236,14 +237,10 @@ Item {
tempoValueFont: timeField.font
}
- onClicked: {
- playbackSpeedPopup.toggleOpened()
- }
-
- PlaybackSpeedPopup {
- id: playbackSpeedPopup
+ property PlaybackToolBarModel playbackModel: root.playbackModel
- playbackModel: root.playbackModel
+ popupComponent: PlaybackSpeedPopup {
+ playbackModel: playbackSpeedButton.playbackModel
}
}
}
diff --git a/src/project/qml/MuseScore/Project/internal/NewScore/KeySignatureSettings.qml b/src/project/qml/MuseScore/Project/internal/NewScore/KeySignatureSettings.qml
index 455d87916066a..34435c5778c64 100644
--- a/src/project/qml/MuseScore/Project/internal/NewScore/KeySignatureSettings.qml
+++ b/src/project/qml/MuseScore/Project/internal/NewScore/KeySignatureSettings.qml
@@ -19,24 +19,21 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-import QtQuick
+import QtQuick
import QtQuick.Layouts
import Muse.Ui
import Muse.UiComponents
import MuseScore.Project
-FlatButton {
+PopupButton {
id: root
property var model: null
- readonly property var mode: bar.currentIndex === 0 ? "major" : "minor"
+ property string mode: "major"
property string currentValueAccessibleName: title.text
- property alias popupAnchorItem: popup.anchorItem
-
height: 96
- accentButton: popup.isOpened
KeySignature {
id: title
@@ -44,15 +41,7 @@ FlatButton {
text: root.mode === "major" ? root.model.keySignature.titleMajor : root.model.keySignature.titleMinor
}
- onClicked: {
- if (!popup.isOpened) {
- popup.open()
- } else {
- popup.close()
- }
- }
-
- StyledPopupView {
+ popupComponent: StyledPopupView {
id: popup
margins: 20
@@ -73,6 +62,12 @@ FlatButton {
id: bar
Layout.alignment: Qt.AlignHCenter
+ currentIndex: root.mode === "major" ? 0 : 1
+
+ onCurrentIndexChanged: {
+ root.mode = currentIndex === 0 ? "major" : "minor"
+ }
+
onCurrentItemChanged: {
if (currentItem && currentItem.navigation) {
currentItemNavigationIndex = [currentItem.navigation.row, currentItem.navigation.column]
diff --git a/src/project/qml/MuseScore/Project/internal/NewScore/MeasuresSettings.qml b/src/project/qml/MuseScore/Project/internal/NewScore/MeasuresSettings.qml
index e24aae3ab2290..351b55b719662 100644
--- a/src/project/qml/MuseScore/Project/internal/NewScore/MeasuresSettings.qml
+++ b/src/project/qml/MuseScore/Project/internal/NewScore/MeasuresSettings.qml
@@ -19,9 +19,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
-pragma ComponentBehavior: Bound
-
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
@@ -30,16 +27,13 @@ import Muse.Ui
import Muse.UiComponents
import MuseScore.Project
-FlatButton {
+PopupButton {
id: root
property var model: null
property string currentValueAccessibleName: title.text
- property alias popupAnchorItem: popup.anchorItem
-
height: 96
- accentButton: popup.isOpened
StyledTextLabel {
id: title
@@ -48,7 +42,7 @@ FlatButton {
anchors.verticalCenter: parent.verticalCenter
property string pickupMessage: {
- if (withPickupMeasure.checked) {
+ if (root.model.withPickupMeasure) {
return qsTrc("project/newscore", "pickup:") + " " +
root.model.pickupTimeSignature.numerator + "/" + root.model.pickupTimeSignature.denominator
}
@@ -60,15 +54,7 @@ FlatButton {
text: qsTrc("project/newscore", "%Ln measure(s),", "", root.model.measureCount) + "\n" + pickupMessage
}
- onClicked: {
- if (!popup.isOpened) {
- popup.open()
- } else {
- popup.close()
- }
- }
-
- StyledPopupView {
+ popupComponent: StyledPopupView {
id: popup
margins: 0
diff --git a/src/project/qml/MuseScore/Project/internal/NewScore/TempoSettings.qml b/src/project/qml/MuseScore/Project/internal/NewScore/TempoSettings.qml
index afd12d7028ddd..f5969efd73272 100644
--- a/src/project/qml/MuseScore/Project/internal/NewScore/TempoSettings.qml
+++ b/src/project/qml/MuseScore/Project/internal/NewScore/TempoSettings.qml
@@ -19,9 +19,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
-pragma ComponentBehavior: Bound
-
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
@@ -31,17 +28,14 @@ import Muse.UiComponents
import MuseScore.Project
import MuseScore.NotationScene
-FlatButton {
+PopupButton {
id: root
property AdditionalInfoModel model: null
property string currentValueAccessibleName: model.tempoAccessibleName(root.model.tempo.noteIcon,
root.model.tempo.withDot) + " " + root.model.tempo.value
- property alias popupAnchorItem: popup.anchorItem
-
height: 96
- accentButton: popup.isOpened
TempoView {
anchors.centerIn: parent
@@ -55,15 +49,7 @@ FlatButton {
noteSymbolTopPadding: 22
}
- onClicked: {
- if (!popup.isOpened) {
- popup.open()
- } else {
- popup.close()
- }
- }
-
- StyledPopupView {
+ popupComponent: StyledPopupView {
id: popup
margins: 0
diff --git a/src/project/qml/MuseScore/Project/internal/NewScore/TimeSignatureSettings.qml b/src/project/qml/MuseScore/Project/internal/NewScore/TimeSignatureSettings.qml
index 21126595c8ccc..53cc78b14d62b 100644
--- a/src/project/qml/MuseScore/Project/internal/NewScore/TimeSignatureSettings.qml
+++ b/src/project/qml/MuseScore/Project/internal/NewScore/TimeSignatureSettings.qml
@@ -27,7 +27,7 @@ import Muse.Ui
import Muse.UiComponents
import MuseScore.Project
-FlatButton {
+PopupButton {
id: root
property var model: null
@@ -35,10 +35,7 @@ FlatButton {
root.model.timeSignature.numerator,
root.model.timeSignature.denominator)
- property alias popupAnchorItem: popup.anchorItem
-
height: 96
- accentButton: popup.isOpened
TimeSignatureView {
id: timeSignatureView
@@ -51,15 +48,7 @@ FlatButton {
type: root.model.timeSignatureType
}
- onClicked: {
- if (!popup.isOpened) {
- popup.open()
- } else {
- popup.close()
- }
- }
-
- StyledPopupView {
+ popupComponent: StyledPopupView {
id: popup
margins: 36
@@ -119,72 +108,72 @@ FlatButton {
}
}
}
- }
- Component {
- id: fractionComp
+ Component {
+ id: fractionComp
- TimeSignatureFraction {
- anchors.fill: parent
+ TimeSignatureFraction {
+ anchors.fill: parent
- property string accessibleName: root.model.timeSignatureAccessibleName(AdditionalInfoModel.Fraction,
- numerator, denominator)
+ property string accessibleName: root.model.timeSignatureAccessibleName(AdditionalInfoModel.Fraction,
+ numerator, denominator)
- enabled: (root.model.timeSignatureType === AdditionalInfoModel.Fraction)
- availableDenominators: root.model.timeSignatureDenominators()
+ enabled: (root.model.timeSignatureType === AdditionalInfoModel.Fraction)
+ availableDenominators: root.model.timeSignatureDenominators()
- numerator: enabled ? root.model.timeSignature.numerator : numerator
- denominator: enabled ? root.model.timeSignature.denominator : denominator
+ numerator: enabled ? root.model.timeSignature.numerator : numerator
+ denominator: enabled ? root.model.timeSignature.denominator : denominator
- navigationSection: popup.navigationSection
- navigationPanelOrderStart: 2
+ navigationSection: popup.navigationSection
+ navigationPanelOrderStart: 2
- onNumeratorSelected: function(value) {
- root.model.setTimeSignatureNumerator(value)
- }
+ onNumeratorSelected: function(value) {
+ root.model.setTimeSignatureNumerator(value)
+ }
- onDenominatorSelected: function(value) {
- root.model.setTimeSignatureDenominator(value)
+ onDenominatorSelected: function(value) {
+ root.model.setTimeSignatureDenominator(value)
+ }
}
}
- }
- Component {
- id: commonComp
+ Component {
+ id: commonComp
- Item {
- property string accessibleName: root.model.timeSignatureAccessibleName(AdditionalInfoModel.Common)
+ Item {
+ property string accessibleName: root.model.timeSignatureAccessibleName(AdditionalInfoModel.Common)
- implicitWidth: commonLabel.implicitWidth
- implicitHeight: 30
+ implicitWidth: commonLabel.implicitWidth
+ implicitHeight: 30
- StyledIconLabel {
- id: commonLabel
- anchors.verticalCenter: parent.verticalCenter
- font.family: ui.theme.musicalFont.family
- font.pixelSize: 30
- horizontalAlignment: Text.AlignLeft
- iconCode: MusicalSymbolCodes.TIMESIG_COMMON
+ StyledIconLabel {
+ id: commonLabel
+ anchors.verticalCenter: parent.verticalCenter
+ font.family: ui.theme.musicalFont.family
+ font.pixelSize: 30
+ horizontalAlignment: Text.AlignLeft
+ iconCode: MusicalSymbolCodes.TIMESIG_COMMON
+ }
}
}
- }
- Component {
- id: cutComp
+ Component {
+ id: cutComp
- Item {
- property string accessibleName: root.model.timeSignatureAccessibleName(AdditionalInfoModel.Cut)
+ Item {
+ property string accessibleName: root.model.timeSignatureAccessibleName(AdditionalInfoModel.Cut)
- implicitWidth: cutLabel.implicitWidth
- implicitHeight: 30
+ implicitWidth: cutLabel.implicitWidth
+ implicitHeight: 30
- StyledIconLabel {
- id: cutLabel
- anchors.verticalCenter: parent.verticalCenter
- font.family: ui.theme.musicalFont.family
- font.pixelSize: 30
- horizontalAlignment: Text.AlignLeft
- iconCode: MusicalSymbolCodes.TIMESIG_CUT
+ StyledIconLabel {
+ id: cutLabel
+ anchors.verticalCenter: parent.verticalCenter
+ font.family: ui.theme.musicalFont.family
+ font.pixelSize: 30
+ horizontalAlignment: Text.AlignLeft
+ iconCode: MusicalSymbolCodes.TIMESIG_CUT
+ }
}
}
}
diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/CMakeLists.txt b/src/propertiespanel/qml/MuseScore/PropertiesPanel/CMakeLists.txt
index 795c400d779b2..9d23fb3f23987 100644
--- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/CMakeLists.txt
+++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/CMakeLists.txt
@@ -250,7 +250,7 @@ qt_add_qml_module(propertiespanel_qml
common/PropertiesPanelTabButton.qml
common/OffsetSection.qml
common/PlacementSection.qml
- common/PopupViewButton.qml
+ common/PropertiesPanelPopupButton.qml
common/PropertyCheckBox.qml
common/PropertyResetButton.qml
common/PropertyToggle.qml
diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PopupViewButton.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PopupViewButton.qml
deleted file mode 100644
index dc6a6ee2c2318..0000000000000
--- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PopupViewButton.qml
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * SPDX-License-Identifier: GPL-3.0-only
- * MuseScore-Studio-CLA-applies
- *
- * MuseScore Studio
- * Music Composition & Notation
- *
- * Copyright (C) 2021 MuseScore Limited and others
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-import QtQuick
-import QtQuick.Layouts
-
-import Muse.Ui
-import Muse.UiComponents
-import MuseScore.PropertiesPanel
-
-FlatButton {
- id: root
-
- property bool isOpened: popup.isOpened
-
- property alias popupNavigationPanel: popup.navigationPanel
-
- property Component popupContent
-
- property int popupAvailableWidth: parent ? parent.width : 0
- property var anchorItem: null
-
- signal ensureContentVisibleRequested(int invisibleContentHeight)
-
- Layout.fillWidth: true
- Layout.minimumWidth: (popupAvailableWidth - 4) / 2
-
- function closePopup() {
- popup.close()
- }
-
- QtObject {
- id: prv
-
- property bool needActiveFirstItem: false
- }
-
- onClicked: {
- prv.needActiveFirstItem = root.navigation.highlight
- contentLoader.active = !contentLoader.active
- popup.toggleOpened()
- }
-
- PropertiesPanelPopupControllerModel {
- id: popupController
- }
-
- StyledPopupView {
- id: popup
-
- anchorItem: root.anchorItem
-
- contentWidth: contentLoader.width
- contentHeight: contentLoader.height
-
- placementPolicies: PopupView.PreferBelow | PopupView.IgnoreFit
-
- closePolicies: PopupView.NoAutoClose
-
- openPolicies: PopupView.Default | PopupView.OpenOnContentReady
- isContentReady: false
-
- contentData: Loader {
- id: contentLoader
-
- active: false
-
- width: root.popupAvailableWidth - 2 * popup.margins
- height: implicitHeight
-
- sourceComponent: root.popupContent
-
- onStatusChanged: {
- if (contentLoader.status == Loader.Ready) {
- Qt.callLater(popup.markContentIsReady)
- }
- }
- }
-
- onContentHeightChanged: {
- if (contentHeight > 0) {
- Qt.callLater(checkForInsufficientSpace)
- }
- }
-
- onOpened: {
- if (contentHeight > 0) {
- Qt.callLater(checkForInsufficientSpace)
- }
-
- if (prv.needActiveFirstItem) {
- forceFocusIn()
- }
-
- popupController.setPopup(popup, root)
- }
-
- onClosed: {
- contentLoader.active = false
- popup.isContentReady = false
- }
-
- function forceFocusIn() {
- contentLoader.item?.forceFocusIn?.()
- }
-
- function checkForInsufficientSpace() {
- var buttonGlobalPos = root.mapToItem(root.anchorItem, Qt.point(0, 0))
- var popupHeight = contentHeight + padding*2 + margins*2
-
- var buttonBottom = buttonGlobalPos.y + root.height
- var spaceBelow = root.anchorItem.height - buttonBottom
- if (spaceBelow > popupHeight) {
- return
- }
-
- var invisibleContentHeight = spaceBelow - popupHeight
-
- root.ensureContentVisibleRequested(invisibleContentHeight)
- }
-
- function markContentIsReady() {
- popup.isContentReady = true
- }
-
- property NavigationPanel navigationPanel: NavigationPanel {
- name: root.navigation.name + " Popup"
- section: popup.navigationSection
- order: 1
- direction: NavigationPanel.Vertical
- }
- }
-}
diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelPopupButton.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelPopupButton.qml
new file mode 100644
index 0000000000000..1419604e31c51
--- /dev/null
+++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/common/PropertiesPanelPopupButton.qml
@@ -0,0 +1,144 @@
+/*
+ * SPDX-License-Identifier: GPL-3.0-only
+ * MuseScore-Studio-CLA-applies
+ *
+ * MuseScore Studio
+ * Music Composition & Notation
+ *
+ * Copyright (C) 2021 MuseScore Limited and others
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+import QtQuick
+import QtQuick.Layouts
+
+import Muse.Ui
+import Muse.UiComponents
+import MuseScore.PropertiesPanel
+
+FlatButton {
+ id: root
+
+ readonly property bool isOpened: popupLoader.isOpened
+ readonly property var popupNavigationPanel: popupLoader.popup ? popupLoader.popup.navigationPanel : null
+
+ property Component popupContent
+ property int popupAvailableWidth: parent ? parent.width : 0
+ property var anchorItem: null
+
+ signal ensureContentVisibleRequested(int invisibleContentHeight)
+
+ Layout.fillWidth: true
+ Layout.minimumWidth: (popupAvailableWidth - 4) / 2
+
+ accentButton: root.isOpened
+
+ function close() {
+ popupLoader.close()
+ }
+
+ QtObject {
+ id: prv
+ property bool needActiveFirstItem: false
+ }
+
+ PropertiesPanelPopupControllerModel {
+ id: popupController
+ }
+
+ onClicked: {
+ prv.needActiveFirstItem = root.navigation.highlight
+ popupLoader.toggleOpened()
+ }
+
+ StyledPopupLoader {
+ id: popupLoader
+
+ popupAnchorItem: root.anchorItem
+
+ sourceComponent: StyledPopupView {
+ id: popup
+
+ contentWidth: contentLoader.width
+ contentHeight: contentLoader.height
+
+ placementPolicies: PopupView.PreferBelow | PopupView.IgnoreFit
+ closePolicies: PopupView.NoAutoClose
+ openPolicies: PopupView.Default | PopupView.OpenOnContentReady
+ isContentReady: false
+
+ contentData: Loader {
+ id: contentLoader
+
+ width: root.popupAvailableWidth - 2 * popup.margins
+ height: implicitHeight
+
+ sourceComponent: root.popupContent
+
+ onStatusChanged: {
+ if (status == Loader.Ready) {
+ Qt.callLater(popup.markContentIsReady)
+ }
+ }
+ }
+
+ onContentHeightChanged: {
+ if (contentHeight > 0) {
+ Qt.callLater(checkForInsufficientSpace)
+ }
+ }
+
+ onOpened: {
+ if (contentHeight > 0) {
+ Qt.callLater(checkForInsufficientSpace)
+ }
+
+ if (prv.needActiveFirstItem) {
+ forceFocusIn()
+ }
+
+ popupController.setPopup(popup, root)
+ }
+
+ function forceFocusIn() {
+ contentLoader.item?.forceFocusIn?.()
+ }
+
+ function checkForInsufficientSpace() {
+ if (!root.anchorItem) {
+ return
+ }
+
+ var buttonGlobalPos = root.mapToItem(root.anchorItem, Qt.point(0, 0))
+ var popupHeight = contentHeight + padding * 2 + margins * 2
+ var buttonBottom = buttonGlobalPos.y + root.height
+ var spaceBelow = root.anchorItem.height - buttonBottom
+ if (spaceBelow > popupHeight) {
+ return
+ }
+ root.ensureContentVisibleRequested(spaceBelow - popupHeight)
+ }
+
+ function markContentIsReady() {
+ popup.isContentReady = true
+ }
+
+ property NavigationPanel navigationPanel: NavigationPanel {
+ name: root.navigation.name + " Popup"
+ section: popup.navigationSection
+ order: 1
+ direction: NavigationPanel.Vertical
+ }
+ }
+ }
+}
diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/general/GeneralSection.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/general/GeneralSection.qml
index b8ebcc7ffb892..4a2666b004355 100644
--- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/general/GeneralSection.qml
+++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/general/GeneralSection.qml
@@ -115,7 +115,7 @@ PropertiesPanelSection {
columns: 2
columnSpacing: 4
- PopupViewButton {
+ PropertiesPanelPopupButton {
id: playbackButton
popupAvailableWidth: parent ? parent.width : 0
@@ -141,7 +141,7 @@ PropertiesPanelSection {
}
}
- PopupViewButton {
+ PropertiesPanelPopupButton {
id: appearanceButton
popupAvailableWidth: parent ? parent.width : 0
diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/measures/MeasuresSection.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/measures/MeasuresSection.qml
index 067e6c38c2f5f..1d0db146976f3 100644
--- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/measures/MeasuresSection.qml
+++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/measures/MeasuresSection.qml
@@ -47,7 +47,7 @@ PropertiesPanelSection {
width: parent.width
spacing: 4
- PopupViewButton {
+ PropertiesPanelPopupButton {
id: insertMeasuresPopupButton
anchorItem: root.anchorItem
diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/NotationMultiElementView.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/NotationMultiElementView.qml
index 683cae25c7bfd..e1832e38608c8 100644
--- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/NotationMultiElementView.qml
+++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/notation/NotationMultiElementView.qml
@@ -47,7 +47,7 @@ PropertiesPanelSection {
Repeater {
model: root.model ? root.model.models : []
- delegate: PopupViewButton {
+ delegate: PropertiesPanelPopupButton {
id: button
required property PropertiesPanelAbstractModel modelData
diff --git a/src/propertiespanel/qml/MuseScore/PropertiesPanel/score/ScoreAppearanceSection.qml b/src/propertiespanel/qml/MuseScore/PropertiesPanel/score/ScoreAppearanceSection.qml
index 64a9cc3e85b4d..30e9183bc0253 100644
--- a/src/propertiespanel/qml/MuseScore/PropertiesPanel/score/ScoreAppearanceSection.qml
+++ b/src/propertiespanel/qml/MuseScore/PropertiesPanel/score/ScoreAppearanceSection.qml
@@ -65,7 +65,7 @@ PropertiesPanelSection {
}
}
- PopupViewButton {
+ PropertiesPanelPopupButton {
id: hideEmptyStavesSettingsPopupButton
Layout.fillWidth: false
Layout.minimumWidth: implicitWidth