diff --git a/src/controls/PageRow.qml b/src/controls/PageRow.qml --- a/src/controls/PageRow.qml +++ b/src/controls/PageRow.qml @@ -143,6 +143,7 @@ * * * actualStyle: this will represent the actual style of the toolbar: it can be different from style in the case style is Auto * * showNavigationButtons: OR flags combination of ApplicationHeaderStyle.ShowBackButton and ApplicationHeaderStyle.ShowForwardButton + * * toolbarButtonsCenteredWithNoTitle: When using the ToolBar style, center the actions and don't show a title * * minimumHeight: (int) minimum height of the header, which will be resized when scrolling, only in Mobile mode (default: preferredHeight, sliding but no scaling) property int preferredHeight: (int) the height the toolbar will usually have property int maximumHeight: (int) The height the toolbar will have in mobile mode when the app is in reachable mode (default: preferredHeight * 1.5) diff --git a/src/controls/private/globaltoolbar/PageRowGlobalToolBarStyleGroup.qml b/src/controls/private/globaltoolbar/PageRowGlobalToolBarStyleGroup.qml --- a/src/controls/private/globaltoolbar/PageRowGlobalToolBarStyleGroup.qml +++ b/src/controls/private/globaltoolbar/PageRowGlobalToolBarStyleGroup.qml @@ -42,6 +42,7 @@ property var showNavigationButtons: (style != Kirigami.ApplicationHeaderStyle.TabBar && (!Kirigami.Settings.isMobile || Qt.platform.os == "ios")) ? (Kirigami.ApplicationHeaderStyle.ShowBackButton | Kirigami.ApplicationHeaderStyle.ShowForwardButton) : Kirigami.ApplicationHeaderStyle.NoNavigationButtons property bool separatorVisible: true + property bool toolbarButtonsCenteredWithNoTitle: false property int minimumHeight: 0 property int preferredHeight: (actualStyle == Kirigami.ApplicationHeaderStyle.ToolBar diff --git a/src/controls/private/globaltoolbar/ToolBarPageHeader.qml b/src/controls/private/globaltoolbar/ToolBarPageHeader.qml --- a/src/controls/private/globaltoolbar/ToolBarPageHeader.qml +++ b/src/controls/private/globaltoolbar/ToolBarPageHeader.qml @@ -48,7 +48,7 @@ rightMargin: Units.smallSpacing } - visible: width > item.Layout.minimumWidth + visible: !pageRow.globalToolBar.toolbarButtonsCenteredWithNoTitle && width > item.Layout.minimumWidth sourceComponent: page ? page.titleDelegate : null @@ -69,7 +69,8 @@ id: actionsLayout anchors { verticalCenter: parent.verticalCenter - right: ctxActionsButton.visible ? ctxActionsButton.left : parent.right + horizontalCenter: pageRow.globalToolBar.toolbarButtonsCenteredWithNoTitle ? parent.horizontalCenter : undefined + right: pageRow.globalToolBar.toolbarButtonsCenteredWithNoTitle ? undefined : ctxActionsButton.visible ? ctxActionsButton.left : parent.right } readonly property bool toobig: root.width - root.leftPadding - root.rightPadding - titleLoader.implicitWidth - Units.gridUnit < buttonTextMetrics.requiredWidth