Changeset View
Changeset View
Standalone View
Standalone View
src/controls/private/globaltoolbar/TitlesPageHeader.qml
Show All 21 Lines | |||||
22 | import QtQuick.Layouts 1.2 | 22 | import QtQuick.Layouts 1.2 | ||
23 | import org.kde.kirigami 2.4 | 23 | import org.kde.kirigami 2.4 | ||
24 | 24 | | |||
25 | 25 | | |||
26 | 26 | | |||
27 | AbstractPageHeader { | 27 | AbstractPageHeader { | ||
28 | id: root | 28 | id: root | ||
29 | 29 | | |||
30 | Heading { | 30 | Loader { | ||
31 | id: title | 31 | id: titleLoader | ||
32 | anchors.fill: parent | 32 | | ||
33 | leftPadding: Units.largeSpacing | 33 | anchors { | ||
34 | opacity: root.current ? 1 : 0.4 | 34 | verticalCenter: parent.verticalCenter | ||
35 | maximumLineCount: 1 | 35 | left: parent.left | ||
36 | verticalAlignment: Text.AlignVCenter | 36 | right: parent.right | ||
37 | color: Theme.textColor | 37 | leftMargin: Units.largeSpacing | ||
38 | elide: Text.ElideRight | | |||
39 | font.pointSize: -1 | | |||
40 | font.pixelSize: Math.max(1, height*0.6) | | |||
41 | text: page ? page.title : "" | | |||
42 | MouseArea { | | |||
43 | anchors.fill: parent | | |||
44 | onClicked: page.forceActiveFocus() | | |||
45 | } | 38 | } | ||
39 | height: Math.min(root.height, item | ||||
40 | ? (item.Layout.preferredHeight > 0 ? item.Layout.preferredHeight : item.implicitHeight) | ||||
41 | : 0) | ||||
42 | | ||||
43 | sourceComponent: page ? page.titleDelegate : null | ||||
46 | } | 44 | } | ||
47 | } | 45 | } | ||
48 | 46 | |