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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
35 changes: 29 additions & 6 deletions src/appshell/qml/NotationPage/NotationPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ DockPage {
objectName: "notationToolBar"
title: qsTrc("appshell", "Notation toolbar")

navigationSection: root.topToolKeyNavSec

floatable: false
closable: false
resizable: false
Expand All @@ -124,7 +126,7 @@ DockPage {
contentBottomPadding: 2

NotationToolBar {
navigationPanel.section: root.topToolKeyNavSec
navigationPanel.section: notationToolBar.navigationSection
navigationPanel.order: 2
}
},
Expand All @@ -135,6 +137,8 @@ DockPage {
objectName: pageModel.playbackToolBarName()
title: qsTrc("appshell", "Playback controls")

navigationSection: root.topToolKeyNavSec

separatorsVisible: false
alignment: DockToolBarAlignment.Right

Expand All @@ -146,17 +150,20 @@ DockPage {
]

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

floating: playbackToolBar.floating
}
},

DockToolBar {
id: undoRedoToolBar
objectName: pageModel.undoRedoToolBarName()
title: qsTrc("appshell", "Undo/redo")

navigationSection: root.topToolKeyNavSec

floatable: false
closable: false
resizable: false
Expand All @@ -166,7 +173,7 @@ DockPage {
contentBottomPadding: 2

UndoRedoToolBar {
navigationPanel.section: root.topToolKeyNavSec
navigationPanel.section: undoRedoToolBar.navigationSection
navigationPanel.order: 4
}
}
Expand All @@ -179,6 +186,8 @@ DockPage {
objectName: pageModel.noteInputBarName()
title: qsTrc("appshell", "Note input")

navigationSection: root.noteInputKeyNavSec

dropDestinations: [
root.toolBarTopDropDestination,
root.toolBarBottomDropDestination,
Expand All @@ -195,7 +204,7 @@ DockPage {
maximumWidth: noteInputBar.width
maximumHeight: noteInputBar.height

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

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

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

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

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

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

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

Expand Down Expand Up @@ -325,9 +338,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 @@ -359,6 +379,7 @@ DockPage {

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

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

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

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

DrumsetPanel {
navigationSection: timelinePanel.navigationSection
navigationSection: drumsetPanel.navigationSection
contentNavigationPanelOrderStart: drumsetPanel.contentNavigationPanelOrderStart
}
}
]
Expand All @@ -440,7 +463,7 @@ DockPage {
statusBar: DockStatusBar {
objectName: 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
23 changes: 18 additions & 5 deletions src/appshell/qml/PublishPage/PublishPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ DockPage {
objectName: root.objectName + "_notationToolBar"
title: qsTrc("appshell", "Notation toolbar")

navigationSection: root.topToolKeyNavSec

floatable: false
closable: false
resizable: false
Expand All @@ -63,7 +65,7 @@ DockPage {
contentBottomPadding: 2

NotationToolBar {
navigationPanel.section: root.topToolKeyNavSec
navigationPanel.section: notationToolBar.navigationSection
navigationPanel.order: 2
}
},
Expand All @@ -74,12 +76,14 @@ DockPage {
objectName: root.objectName + "_playbackToolBar"
title: qsTrc("appshell", "Playback controls")

navigationSection: root.topToolKeyNavSec

separatorsVisible: false
alignment: DockToolBarAlignment.Right
contentBottomPadding: 2

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

floating: playbackToolBar.floating
Expand All @@ -92,6 +96,8 @@ DockPage {
objectName: root.objectName + "_undoRedoToolBar"
title: qsTrc("appshell", "Undo/redo toolbar")

navigationSection: root.topToolKeyNavSec

floatable: false
closable: false
resizable: false
Expand All @@ -101,20 +107,23 @@ DockPage {
contentBottomPadding: 2

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

toolBars: [
DockToolBar {
id: publishToolBar
objectName: "publishToolBar"

navigationSection: root.publishToolBarKeyNavSec

floatable: false

PublishToolBar {
navigationPanel.section: root.publishToolBarKeyNavSec
navigationPanel.section: publishToolBar.navigationSection
navigationPanel.order: 1
}
}
Expand All @@ -128,6 +137,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 @@ -65,9 +65,11 @@ DockWindow {
floatable: false
closable: false

navigationSection: root.topToolKeyNavSec

MainToolBar {
id: toolBar
navigation.section: root.topToolKeyNavSec
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 @@ -30,6 +30,7 @@
namespace muse::dock {
inline const char* CONTEXT_MENU_MODEL_PROPERTY("contextMenuModel");
inline const char* DOCK_PANEL_PROPERTY("dockPanel");
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
31 changes: 21 additions & 10 deletions src/framework/dockwindow/internal/dockbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,24 @@ void DockBase::setFloating(bool floating)
m_dockWidget->setFloating(floating);
}

void DockBase::setContentNavigationPanel(ui::NavigationPanel* panel)
void DockBase::setNavigationSection(ui::NavigationSection* section)
{
if (m_contentNavigationPanel == panel) {
if (m_navigationSection == section) {
return;
}

m_contentNavigationPanel = panel;
emit contentNavigationPanelChanged();
m_navigationSection = section;
emit navigationSectionChanged();
}

void DockBase::setContentNavigationPanelOrderStart(int order)
{
if (m_contentNavigationPanelOrderStart == order) {
return;
}

m_contentNavigationPanelOrderStart = order;
emit contentNavigationPanelOrderStartChanged();
}

void DockBase::init()
Expand Down Expand Up @@ -539,9 +549,14 @@ void DockBase::resize(int width, int height)
applySizeConstraints();
}

muse::ui::NavigationPanel* DockBase::contentNavigationPanel() const
muse::ui::NavigationSection* DockBase::navigationSection() const
{
return m_contentNavigationPanel;
return m_navigationSection;
}

int DockBase::contentNavigationPanelOrderStart() const
{
return m_contentNavigationPanelOrderStart;
}

void DockBase::componentComplete()
Expand Down Expand Up @@ -586,10 +601,6 @@ void DockBase::componentComplete()
connect(this, &DockBase::minimumSizeChanged, this, &DockBase::applySizeConstraints);
connect(this, &DockBase::maximumSizeChanged, this, &DockBase::applySizeConstraints);

connect(this, &DockBase::visibleChanged, [this](){
emit reorderNavigationRequested();
});

m_defaultVisibility = isVisible();
}

Expand Down
Loading
Loading