Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For horizontal panels, show tab bar instead of title bar #22050

Merged
merged 8 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 37 additions & 10 deletions src/appshell/qml/NotationPage/NotationPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ DockPage {
property NotationPageModel pageModel: NotationPageModel {}

property NavigationSection noteInputKeyNavSec: NavigationSection {
id: keynavSec
name: "NoteInputSection"
order: 2
}
Expand Down Expand Up @@ -124,8 +123,10 @@ DockPage {
alignment: DockToolBarAlignment.Center
contentBottomPadding: 2

navigationSection: root.topToolbarKeyNavSec

NotationToolBar {
navigationPanel.section: root.topToolbarKeyNavSec
navigationPanel.section: notationToolBar.navigationSection
navigationPanel.order: 2
}
},
Expand All @@ -146,8 +147,10 @@ DockPage {
{ "dock": notationToolBar, "dropLocation": Location.Right }
]

navigationSection: root.topToolbarKeyNavSec

PlaybackToolBar {
navigationPanelSection: root.topToolbarKeyNavSec
navigationPanelSection: playbackToolBar.navigationSection
navigationPanelOrder: 3

floating: playbackToolBar.floating
Expand All @@ -172,9 +175,13 @@ DockPage {
{ "dock": playbackToolBar, "dropLocation": Location.Right }
]

navigationSection: root.topToolbarKeyNavSec

ExtensionsToolBar {
id: extToolBar

navigationPanel.section: extDockToolBar.navigationSection
navigationPanel.order: 4

function updateVisible() {
if (!extDockToolBar.inited) {
Expand Down Expand Up @@ -207,6 +214,8 @@ DockPage {
},

DockToolBar {
id: undoRedoToolBar

objectName: root.pageModel.undoRedoToolBarName()
title: qsTrc("appshell", "Undo/redo")

Expand All @@ -218,15 +227,16 @@ DockPage {
alignment: DockToolBarAlignment.Right
contentBottomPadding: 2

navigationSection: root.topToolbarKeyNavSec

UndoRedoToolBar {
navigationPanel.section: root.topToolbarKeyNavSec
navigationPanel.order: 4
navigationPanel.section: undoRedoToolBar.navigationSection
navigationPanel.order: 5
}
}
]

toolBars: [

DockToolBar {
id: noteInputBar

Expand All @@ -242,14 +252,16 @@ DockPage {

thickness: orientation === Qt.Horizontal ? 40 : 76

navigationSection: root.noteInputKeyNavSec

NoteInputBar {
orientation: noteInputBar.orientation
floating: noteInputBar.floating

maximumWidth: noteInputBar.width
maximumHeight: noteInputBar.height

navigationPanel.section: root.noteInputKeyNavSec
navigationPanel.section: noteInputBar.navigationSection
navigationPanel.order: 1
}
}
Expand All @@ -274,6 +286,7 @@ DockPage {

PalettesPanel {
navigationSection: palettesPanel.navigationSection
navigationOrderStart: palettesPanel.contentNavigationPanelOrderStart

Component.onCompleted: {
palettesPanel.contextMenuModel = contextMenuModel
Expand All @@ -299,6 +312,7 @@ DockPage {

InstrumentsPanel {
navigationSection: instrumentsPanel.navigationSection
navigationOrderStart: instrumentsPanel.contentNavigationPanelOrderStart

Component.onCompleted: {
instrumentsPanel.contextMenuModel = contextMenuModel
Expand All @@ -324,6 +338,7 @@ DockPage {

InspectorForm {
navigationSection: inspectorPanel.navigationSection
navigationOrderStart: inspectorPanel.contentNavigationPanelOrderStart
notationView: root.notationView
}
},
Expand All @@ -349,6 +364,7 @@ DockPage {

SelectionFilterPanel {
navigationSection: selectionFilterPanel.navigationSection
navigationOrderStart: selectionFilterPanel.contentNavigationPanelOrderStart
}
},

Expand All @@ -373,6 +389,7 @@ DockPage {

UndoHistoryPanel {
navigationSection: undoHistoryPanel.navigationSection
navigationOrderStart: undoHistoryPanel.contentNavigationPanelOrderStart
}
},

Expand Down Expand Up @@ -403,9 +420,16 @@ DockPage {

MixerPanel {
navigationSection: mixerPanel.navigationSection
contentNavigationPanelOrderStart: mixerPanel.contentNavigationPanelOrderStart

Component.onCompleted: {
mixerPanel.contextMenuModel = contextMenuModel
mixerPanel.toolbarComponent = toolbarComponent
}

Component.onDestruction: {
mixerPanel.contextMenuModel = null
mixerPanel.toolbarComponent = null
}

onResizeRequested: function(newWidth, newHeight) {
Expand Down Expand Up @@ -437,6 +461,7 @@ DockPage {

PianoKeyboardPanel {
navigationSection: pianoKeyboardPanel.navigationSection
contentNavigationPanelOrderStart: pianoKeyboardPanel.contentNavigationPanelOrderStart

Component.onCompleted: {
pianoKeyboardPanel.contextMenuModel = contextMenuModel
Expand Down Expand Up @@ -467,6 +492,7 @@ DockPage {

Timeline {
navigationSection: timelinePanel.navigationSection
contentNavigationPanelOrderStart: timelinePanel.contentNavigationPanelOrderStart
}
},

Expand All @@ -491,7 +517,8 @@ DockPage {
navigationSection: root.navigationPanelSec(drumsetPanel.location)

DrumsetPanel {
navigationSection: timelinePanel.navigationSection
navigationSection: drumsetPanel.navigationSection
contentNavigationPanelOrderStart: drumsetPanel.contentNavigationPanelOrderStart
}
},

Expand All @@ -518,10 +545,10 @@ DockPage {

PercussionPanel {
navigationSection: percussionPanel.navigationSection
contentNavigationPanelOrderStart: percussionPanel.contentNavigationPanelOrderStart

// TODO: #22050 needed for this
/*
// contentNavigationPanelOrderStart: percussionPanel.contentNavigationPanelOrderStart

Component.onCompleted: {
percussionPanel.contextMenuModel = contextMenuModel
Expand Down Expand Up @@ -559,7 +586,7 @@ DockPage {
statusBar: DockStatusBar {
objectName: root.pageModel.statusBarName()

contentNavigationPanel: content.navigationPanel
navigationSection: content.navigationSection

NotationStatusBar {
id: content
Expand Down
15 changes: 8 additions & 7 deletions src/appshell/qml/NotationPage/NotationStatusBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ Item {
id: model
}

NavigationSection {
property NavigationSection navigationSection: NavigationSection {
id: navSec
name: "NotationStatusBar"
enabled: root.enabled && root.visible
order: 8
}

property NavigationPanel navigationPanel: NavigationPanel {
NavigationPanel {
id: navPanel
name: "NotationStatusBar"
enabled: root.enabled && root.visible
order: 0
Expand Down Expand Up @@ -112,7 +113,7 @@ Item {
transparent: true
visible: statusBarRow.remainingSpace > width + concertPitchControl.width

navigation.panel: root.navigationPanel
navigation.panel: navPanel
navigation.order: 1

onClicked: {
Expand All @@ -133,7 +134,7 @@ Item {
enabled: model.concertPitchItem.enabled
visible: statusBarRow.remainingSpace > width

navigation.panel: root.navigationPanel
navigation.panel: navPanel
navigation.order: 2

onToggleConcertPitchRequested: {
Expand All @@ -151,7 +152,7 @@ Item {
currentViewMode: model.currentViewMode
availableViewModeList: model.availableViewModeList

navigation.panel: root.navigationPanel
navigation.panel: navPanel
navigation.order: 3

onChangeCurrentViewModeRequested: function(newViewMode) {
Expand All @@ -170,7 +171,7 @@ Item {
maxZoomPercentage: model.maxZoomPercentage()
availableZoomList: model.availableZoomList

navigationPanel: root.navigationPanel
navigationPanel: navPanel
navigationOrderMin: 4

onChangeZoomPercentageRequested: function(newZoomPercentage) {
Expand Down Expand Up @@ -200,7 +201,7 @@ Item {
visible: !concertPitchControl.visible ||
!workspaceControl.visible

navigation.panel: root.navigationPanel
navigation.panel: navPanel
navigation.order: zoomControl.navigationOrderMax + 1

menuModel: {
Expand Down
25 changes: 20 additions & 5 deletions src/appshell/qml/PublishPage/PublishPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ DockPage {
alignment: DockToolBarAlignment.Center
contentBottomPadding: 2

navigationSection: root.topToolbarKeyNavSec

NotationToolBar {
navigationPanel.section: root.topToolbarKeyNavSec
navigationPanel.section: notationToolBar.navigationSection
navigationPanel.order: 2
}
},
Expand All @@ -78,8 +80,10 @@ DockPage {
alignment: DockToolBarAlignment.Right
contentBottomPadding: 2

navigationSection: root.topToolbarKeyNavSec

PlaybackToolBar {
navigationPanelSection: root.topToolbarKeyNavSec
navigationPanelSection: playbackToolBar.navigationSection
navigationPanelOrder: 3

floating: playbackToolBar.floating
Expand All @@ -100,21 +104,28 @@ DockPage {
alignment: DockToolBarAlignment.Right
contentBottomPadding: 2

navigationSection: root.topToolbarKeyNavSec

UndoRedoToolBar {
navigationPanel.section: root.topToolbarKeyNavSec
navigationPanel.section: undoRedoToolBar.navigationSection
navigationPanel.order: 4
}
}
]

toolBars: [
DockToolBar {
id: publishToolBar

objectName: "publishToolBar"
title: qsTrc("appshell", "Publish toolbar")

floatable: false

navigationSection: root.publishToolBarKeyNavSec

PublishToolBar {
navigationPanel.section: root.publishToolBarKeyNavSec
navigationPanel.section: publishToolBar.navigationSection
navigationPanel.order: 1
}
}
Expand All @@ -128,6 +139,10 @@ DockPage {
statusBar: DockStatusBar {
objectName: "publishStatusBar"

NotationStatusBar {}
navigationSection: content.navigationSection

NotationStatusBar {
id: content
}
}
}
4 changes: 3 additions & 1 deletion src/appshell/qml/WindowContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ DockWindow {
floatable: false
closable: false

navigationSection: topToolbarKeyNavSec

MainToolBar {
id: toolBar
navigation.section: topToolbarKeyNavSec
navigation.section: mainToolBar.navigationSection
navigation.order: 1

currentUri: root.currentPageUri
Expand Down
2 changes: 2 additions & 0 deletions src/framework/dockwindow/dock.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<file>qml/Muse/Dock/DockPanel.qml</file>
<file>qml/Muse/Dock/DockPanelTab.qml</file>
<file>qml/Muse/Dock/DockSeparator.qml</file>
<file>qml/Muse/Dock/DockTabBar.qml</file>
<file>qml/Muse/Dock/DockTitleBar.qml</file>
<file>qml/Muse/Dock/DockTitleBarMouseArea.qml</file>
<file>qml/Muse/Dock/DockToolBar.qml</file>
<file>qml/Muse/Dock/DockWidget.qml</file>
<file>qml/Muse/Dock/qmldir</file>
Expand Down
1 change: 1 addition & 0 deletions src/framework/dockwindow/docktypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace muse::dock {
inline const char* CONTEXT_MENU_MODEL_PROPERTY("contextMenuModel");
inline const char* DOCK_PANEL_PROPERTY("dockPanel");
inline const char* TITLEBAR_PROPERTY("titleBar");
inline const char* TOOLBAR_COMPONENT_PROPERTY("toolbarComponent");

//! NOTE: need to be synchronized with Window shadow(see DockFloatingWindow margins)
inline constexpr int DOCK_WINDOW_SHADOW(8);
Expand Down
Loading