Replaced the note input customise dialog to popup

This commit is contained in:
Eism 2021-09-28 15:39:08 +02:00 committed by Igor Korsukov
parent 87606476ea
commit 4db3f2fbcf
8 changed files with 37 additions and 11 deletions

View file

@ -149,6 +149,8 @@ DockPage {
navigation.section: root.noteInputKeyNavSec
navigation.order: 1
floating: noteInputBar.floating
}
}
]

View file

@ -159,6 +159,11 @@ void SelectableItemListModel::removeSelection()
onRowsRemoved();
}
void SelectableItemListModel::clearSelection()
{
m_selection->clearSelection();
}
bool SelectableItemListModel::moveRows(const QModelIndex& sourceParent,
int sourceRow,
int count,

View file

@ -66,6 +66,7 @@ public:
Q_INVOKABLE void moveSelectionUp();
Q_INVOKABLE void moveSelectionDown();
Q_INVOKABLE void removeSelection();
Q_INVOKABLE void clearSelection();
signals:
void countChanged();

View file

@ -148,9 +148,6 @@ void NotationModule::resolveImports()
ir->registerUri(Uri("musescore://notation/parts"),
ContainerMeta(ContainerType::QmlDialog, "MuseScore/NotationScene/PartsDialog.qml"));
ir->registerUri(Uri("musescore://notation/noteinputbar/customise"),
ContainerMeta(ContainerType::QmlDialog, "MuseScore/NotationScene/NoteInputBarCustomiseDialog.qml"));
ir->registerUri(Uri("musescore://notation/selectmeasurescount"),
ContainerMeta(ContainerType::QmlDialog, "MuseScore/NotationScene/SelectMeasuresCountDialog.qml"));

View file

@ -19,7 +19,6 @@
<file>view/resources/icons/go-next.svg</file>
<file>view/resources/icons/go-previous.svg</file>
<file>qml/MuseScore/NotationScene/NoteInputBar.qml</file>
<file>qml/MuseScore/NotationScene/NoteInputBarCustomiseDialog.qml</file>
<file>qml/MuseScore/NotationScene/internal/NoteInputBarActionDelegate.qml</file>
<file>qml/MuseScore/NotationScene/SelectMeasuresCountDialog.qml</file>
<file>qml/MuseScore/NotationScene/UndoRedoToolBar.qml</file>
@ -31,5 +30,6 @@
<file>qml/MuseScore/NotationScene/internal/PartsBottomPanel.qml</file>
<file>qml/MuseScore/NotationScene/internal/CustomiseControlPanel.qml</file>
<file>qml/MuseScore/NotationScene/internal/CustomiseView.qml</file>
<file>qml/MuseScore/NotationScene/internal/NoteInputBarCustomisePopup.qml</file>
</qresource>
</RCC>

View file

@ -26,6 +26,8 @@ import MuseScore.NotationScene 1.0
import MuseScore.UiComponents 1.0
import MuseScore.Ui 1.0
import "internal"
Rectangle {
id: root
@ -33,6 +35,8 @@ Rectangle {
property alias navigation: keynavSub
property bool floating: false
color: ui.theme.backgroundPrimaryColor
QtObject {
@ -196,7 +200,14 @@ Rectangle {
navigation.order: 100
onClicked: {
api.launcher.open("musescore://notation/noteinputbar/customise")
customizePopup.toggleOpened()
}
NoteInputBarCustomisePopup {
id: customizePopup
anchorItem: !root.floating ? ui.rootItem : null
navigationParentControl: customizeButton.navigation
}
}

View file

@ -35,6 +35,7 @@ ListView {
clip: true
signal selectRowRequested(int index)
signal clearSelectionRequested()
function positionViewAtSelectedItems() {
var selectedIndexes = root.model.selectionModel.selectedIndexes
@ -54,10 +55,13 @@ ListView {
root.positionViewAtSelectedItems()
}
function clearFocus() {
root.clearSelectionRequested()
}
property NavigationPanel navigationPanel: NavigationPanel {
name: "CostomiseView"
direction: NavigationPanel.Both
accessible.name: qsTrc("notation", "Costomise view")
onActiveChanged: {
if (active) {
root.forceActiveFocus()

View file

@ -27,17 +27,13 @@ import MuseScore.Ui 1.0
import MuseScore.UiComponents 1.0
import MuseScore.NotationScene 1.0
import "internal"
StyledDialogView {
StyledPopupView {
id: root
contentWidth: 280
contentHeight: 600
margins: 12
modal: true
NoteInputBarCustomiseModel {
id: customiseModel
}
@ -50,12 +46,17 @@ StyledDialogView {
view.focusOnFirst()
}
onClosed: {
view.clearFocus()
}
ColumnLayout {
anchors.fill: parent
spacing: 0
StyledTextLabel {
id: titleLabel
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
Layout.topMargin: 8
@ -107,10 +108,15 @@ StyledDialogView {
navigationPanel.section: root.navigationSection
navigationPanel.order: 2
navigationPanel.accessible.name: titleLabel.text
onSelectRowRequested: {
customiseModel.selectRow(index)
}
onClearSelectionRequested: {
customiseModel.clearSelection()
}
}
}
}