Changeset View
Changeset View
Standalone View
Standalone View
src/controls/private/globaltoolbar/ToolBarPageHeader.qml
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 70 | anchors { | |||
---|---|---|---|---|---|
71 | verticalCenter: parent.verticalCenter | 71 | verticalCenter: parent.verticalCenter | ||
72 | right: ctxActionsButton.visible ? ctxActionsButton.left : parent.right | 72 | right: ctxActionsButton.visible ? ctxActionsButton.left : parent.right | ||
73 | } | 73 | } | ||
74 | 74 | | |||
75 | readonly property bool toobig: root.width - root.leftPadding - root.rightPadding - titleLoader.implicitWidth - Units.gridUnit < buttonTextMetrics.requiredWidth | 75 | readonly property bool toobig: root.width - root.leftPadding - root.rightPadding - titleLoader.implicitWidth - Units.gridUnit < buttonTextMetrics.requiredWidth | ||
76 | 76 | | |||
77 | Private.PrivateActionToolButton { | 77 | Private.PrivateActionToolButton { | ||
78 | Layout.alignment: Qt.AlignVCenter | 78 | Layout.alignment: Qt.AlignVCenter | ||
79 | kirigamiAction: page && page.actions ? page.actions.left : null | 79 | action: page && page.actions ? page.actions.left : null | ||
80 | showText: !parent.toobig | 80 | showText: !parent.toobig | ||
81 | } | 81 | } | ||
82 | Private.PrivateActionToolButton { | 82 | Private.PrivateActionToolButton { | ||
83 | Layout.alignment: Qt.AlignVCenter | 83 | Layout.alignment: Qt.AlignVCenter | ||
84 | Layout.rightMargin: Units.smallSpacing | 84 | Layout.rightMargin: Units.smallSpacing | ||
85 | kirigamiAction: page && page.actions ? page.actions.main : null | 85 | action: page && page.actions ? page.actions.main : null | ||
86 | showText: !parent.toobig | 86 | showText: !parent.toobig | ||
87 | } | 87 | } | ||
88 | Private.PrivateActionToolButton { | 88 | Private.PrivateActionToolButton { | ||
89 | Layout.alignment: Qt.AlignVCenter | 89 | Layout.alignment: Qt.AlignVCenter | ||
90 | kirigamiAction: page && page.actions ? page.actions.right : null | 90 | action: page && page.actions ? page.actions.right : null | ||
91 | showText: !parent.toobig | 91 | showText: !parent.toobig | ||
92 | } | 92 | } | ||
93 | } | 93 | } | ||
94 | 94 | | |||
95 | Private.PrivateActionToolButton { | 95 | Private.PrivateActionToolButton { | ||
96 | id: ctxActionsButton | 96 | id: ctxActionsButton | ||
97 | showMenuArrow: page.actions.contextualActions.length == 1 | 97 | showMenuArrow: page.actions.contextualActions.length == 1 | ||
98 | onMenuAboutToShow: page.contextualActionsAboutToShow(); | 98 | onMenuAboutToShow: page.contextualActionsAboutToShow(); | ||
99 | anchors { | 99 | anchors { | ||
100 | right: parent.right | 100 | right: parent.right | ||
101 | verticalCenter: parent.verticalCenter | 101 | verticalCenter: parent.verticalCenter | ||
102 | rightMargin: Units.smallSpacing | 102 | rightMargin: Units.smallSpacing | ||
103 | } | 103 | } | ||
104 | Action { | 104 | Action { | ||
105 | id: overflowAction | 105 | id: overflowAction | ||
106 | icon.name: "overflow-menu" | 106 | icon.name: "overflow-menu" | ||
107 | tooltip: qsTr("More Actions") | 107 | tooltip: qsTr("More Actions") | ||
108 | visible: visibleChildren.length > 0 | 108 | visible: visibleChildren.length > 0 | ||
109 | children: page && page.actions.contextualActions ? page.actions.contextualActions : null | 109 | children: page && page.actions.contextualActions ? page.actions.contextualActions : null | ||
110 | } | 110 | } | ||
111 | 111 | | |||
112 | kirigamiAction: page && page.actions.contextualActions.length === 1 ? page.actions.contextualActions[0] : overflowAction | 112 | action: page && page.actions.contextualActions.length === 1 ? page.actions.contextualActions[0] : overflowAction | ||
113 | } | 113 | } | ||
114 | } | 114 | } | ||
115 | 115 | |