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 + * * toolbarActionAlignment: How to horizontally align the actions when using the ToolBar style. Note that anything but Qt.AlignRight will cause the title to be hidden (default: Qt.AlignRight) * * 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 int toolbarActionAlignment: Qt.AlignRight 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 @@ -43,12 +43,12 @@ anchors { verticalCenter: parent.verticalCenter left: parent.left - right: actionsLayout.left + right: parent.right leftMargin: Units.largeSpacing rightMargin: Units.smallSpacing } - visible: width > item.Layout.minimumWidth + visible: pageRow.globalToolBar.toolbarActionAlignment == Qt.AlignRight && width > item.Layout.minimumWidth sourceComponent: page ? page.titleDelegate : null @@ -69,11 +69,16 @@ id: actionsLayout anchors { verticalCenter: parent.verticalCenter + left: parent.left right: ctxActionsButton.visible ? ctxActionsButton.left : parent.right } readonly property bool toobig: root.width - root.leftPadding - root.rightPadding - titleLoader.implicitWidth - Units.gridUnit < buttonTextMetrics.requiredWidth + Item { + Layout.fillWidth: true + visible: pageRow.globalToolBar.toolbarActionAlignment != Qt.AlignLeft + } Private.PrivateActionToolButton { Layout.alignment: Qt.AlignVCenter kirigamiAction: page && page.actions ? page.actions.left : null @@ -90,6 +95,10 @@ kirigamiAction: page && page.actions ? page.actions.right : null showText: !parent.toobig } + Item { + Layout.fillWidth: true + visible: pageRow.globalToolBar.toolbarActionAlignment != Qt.AlignRight + } } Private.PrivateActionToolButton {