Changeset View
Changeset View
Standalone View
Standalone View
src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.6 | 20 | import QtQuick 2.6 | ||
21 | import QtQuick.Controls 2.0 as Controls | ||||
21 | import QtQuick.Layouts 1.2 | 22 | import QtQuick.Layouts 1.2 | ||
22 | import org.kde.kirigami 2.4 as Kirigami | 23 | import org.kde.kirigami 2.4 as Kirigami | ||
23 | import "../../templates/private" as TemplatesPrivate | 24 | import "../../templates/private" as TemplatesPrivate | ||
24 | 25 | | |||
25 | | ||||
26 | Kirigami.AbstractApplicationHeader { | 26 | Kirigami.AbstractApplicationHeader { | ||
27 | id: header | 27 | id: header | ||
28 | readonly property int leftReservedSpace: (buttonsLayout.visible && buttonsLayout.visibleChildren.length > 0 ? buttonsLayout.width : 0) + (leftHandleAnchor.visible ? leftHandleAnchor.width : 0) | 28 | readonly property int leftReservedSpace: (buttonsLayout.visible && buttonsLayout.visibleChildren.length > 0 ? buttonsLayout.width : 0) + (leftHandleAnchor.visible ? leftHandleAnchor.width : 0) + (menuButton.visible ? menuButton.width : 0) | ||
29 | readonly property int rightReservedSpace: rightHandleAnchor.visible ? backButton.background.implicitHeight : 0 | 29 | readonly property int rightReservedSpace: rightHandleAnchor.visible ? backButton.background.implicitHeight : 0 | ||
30 | 30 | | |||
31 | readonly property alias leftHandleAnchor: leftHandleAnchor | 31 | readonly property alias leftHandleAnchor: leftHandleAnchor | ||
32 | readonly property alias rightHandleAnchor: rightHandleAnchor | 32 | readonly property alias rightHandleAnchor: rightHandleAnchor | ||
33 | 33 | | |||
34 | readonly property bool breadcrumbVisible: layerIsMainRow && breadcrumbLoader.active | 34 | readonly property bool breadcrumbVisible: layerIsMainRow && breadcrumbLoader.active | ||
35 | readonly property bool layerIsMainRow: root.layers.currentItem == root.contentItem | 35 | readonly property bool layerIsMainRow: root.layers.currentItem == root.contentItem | ||
36 | readonly property Item currentItem: layerIsMainRow ? root.currentItem : root.layers.currentItem | 36 | readonly property Item currentItem: layerIsMainRow ? root.currentItem : root.layers.currentItem | ||
Show All 15 Lines | 48 | Item { | |||
52 | breadcrumbLoader.pageRow.firstVisibleItem && | 52 | breadcrumbLoader.pageRow.firstVisibleItem && | ||
53 | breadcrumbLoader.pageRow.firstVisibleItem.globalToolBarStyle == Kirigami.ApplicationHeaderStyle.ToolBar | 53 | breadcrumbLoader.pageRow.firstVisibleItem.globalToolBarStyle == Kirigami.ApplicationHeaderStyle.ToolBar | ||
54 | 54 | | |||
55 | 55 | | |||
56 | Layout.preferredHeight: Math.min(backButton.implicitHeight, parent.height) | 56 | Layout.preferredHeight: Math.min(backButton.implicitHeight, parent.height) | ||
57 | Layout.preferredWidth: height | 57 | Layout.preferredWidth: height | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | Controls.ToolButton { | ||||
mart: try using PrivateActiontoolbutton, it should give the complete correct behavior for free | |||||
61 | id: menuButton | ||||
62 | visible: !Kirigami.Settings.isMobile && applicationWindow().globalDrawer.isMenu | ||||
63 | icon.name: "application-menu" | ||||
64 | | ||||
65 | Layout.preferredHeight: Math.min(backButton.implicitHeight, parent.height) | ||||
66 | Layout.preferredWidth: height | ||||
67 | Layout.leftMargin: Kirigami.Units.smallSpacing | ||||
68 | | ||||
69 | onClicked: menu.popup() | ||||
70 | | ||||
71 | Controls.Menu { | ||||
72 | id: menu | ||||
mart: x: 0
y: menuButton.height ? | |||||
73 | contentData: applicationWindow().globalDrawer.actions | ||||
74 | } | ||||
75 | } | ||||
76 | | ||||
60 | RowLayout { | 77 | RowLayout { | ||
61 | id: buttonsLayout | 78 | id: buttonsLayout | ||
62 | Layout.fillHeight: true | 79 | Layout.fillHeight: true | ||
63 | 80 | | |||
64 | Layout.leftMargin: leftHandleAnchor.visible ? Kirigami.Units.smallSpacing : 0 | 81 | Layout.leftMargin: leftHandleAnchor.visible ? Kirigami.Units.smallSpacing : 0 | ||
65 | 82 | | |||
66 | visible: (globalToolBar.showNavigationButtons != Kirigami.ApplicationHeaderStyle.NoNavigationButtons || root.layers.depth > 1) && (globalToolBar.actualStyle != Kirigami.ApplicationHeaderStyle.None) | 83 | visible: (globalToolBar.showNavigationButtons != Kirigami.ApplicationHeaderStyle.NoNavigationButtons || root.layers.depth > 1) && (globalToolBar.actualStyle != Kirigami.ApplicationHeaderStyle.None) | ||
67 | 84 | | |||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |
try using PrivateActiontoolbutton, it should give the complete correct behavior for free