9import QtQuick.Controls as QQC2
10import org.kde.kirigami as Kirigami
30 property int minimumHeight: 0
32 property int preferredHeight: mainItem.children.reduce((accumulator, item) => {
33 return Math.max(accumulator, item.implicitHeight);
34 }, 0) + topPadding + bottomPadding
35 property
int maximumHeight: Kirigami.Units.gridUnit * 3
37 property int position: QQC2.ToolBar.Header
39 property Kirigami.PageRow pageRow: __appWindow?.pageStack ?? null
40 property Kirigami.Page page: pageRow?.currentItem as Kirigami.Page ?? null
42 default property alias contentItem: mainItem.data
43 readonly
property int paintedHeight: headerItem.y + headerItem.height - 1
45 property int leftPadding: 0
46 property int topPadding: 0
47 property int rightPadding: 0
48 property int bottomPadding: 0
49 property bool separatorVisible:
true
55 property bool hideWhenTouchScrolling: root.pageRow?.globalToolBar.hideWhenTouchScrolling ??
false
57 LayoutMirroring.enabled:
Qt.application.layoutDirection ===
Qt.RightToLeft
58 LayoutMirroring.childrenInherit:
true
60 Kirigami.Theme.inherit:
true
63 property QtObject __appWindow: typeof applicationWindow !==
"undefined" ? applicationWindow() : null
64 implicitHeight: preferredHeight
65 height: Layout.preferredHeight
71 property Item background
73 onBackgroundChanged: {
75 background.parent = headerItem;
76 background.anchors.fill = headerItem;
79 Component.onCompleted: AppHeaderSizeGroup.items.push(
this)
81 onMinimumHeightChanged: implicitHeight = preferredHeight;
82 onPreferredHeightChanged: implicitHeight = preferredHeight;
84 opacity: height > 0 ? 1 : 0
89 property:
"implicitHeight"
90 duration: Kirigami.Units.longDuration
91 easing.type: Easing.InOutQuad
95 target: root.__appWindow
97 function onControlsVisibleChanged() {
98 heightAnim.from = root.implicitHeight;
99 heightAnim.to = root.__appWindow.controlsVisible ? root.preferredHeight : 0;
100 heightAnim.restart();
105 target: root.page?.Kirigami.ColumnView ?? null
107 function onScrollIntention(event) {
108 headerItem.scrollIntentHandler(event);
117 bottom: !Kirigami.Settings.isMobile || root.position === QQC2.ToolBar.Header ? parent.bottom : undefined
118 top: !Kirigami.Settings.isMobile || root.position === QQC2.ToolBar.Footer ? parent.top : undefined
121 height: Math.max(root.height, root.minimumHeight > 0 ? root.minimumHeight : root.preferredHeight)
123 function scrollIntentHandler(
event) {
124 if (!root.hideWhenTouchScrolling) {
129 && root.pageRow.globalToolBar.actualStyle !== Kirigami.ApplicationHeaderStyle.Breadcrumb) {
132 if (!root.page.flickable || (root.page.flickable.atYBeginning && root.page.flickable.atYEnd)) {
136 root.implicitHeight = Math.max(0, Math.min(root.preferredHeight, root.implicitHeight +
event.delta.y))
137 event.accepted = root.implicitHeight > 0 && root.implicitHeight < root.preferredHeight;
138 slideResetTimer.restart();
139 if ((root.page.flickable instanceof ListView) && root.page.flickable.verticalLayoutDirection === ListView.BottomToTop) {
140 root.page.flickable.contentY -=
event.delta.y;
145 target: root.page?.globalToolBarItem ?? null
147 function onImplicitHeightChanged() {
148 root.implicitHeight = root.page.globalToolBarItem.implicitHeight;
156 if ((root.pageRow?.wideMode ?? (root.__appWindow?.wideScreen ??
false)) || !Kirigami.Settings.isMobile) {
159 if (root.height > root.minimumHeight + (root.preferredHeight - root.minimumHeight) / 2) {
160 heightAnim.to = root.preferredHeight;
162 heightAnim.to = root.minimumHeight;
164 heightAnim.from = root.implicitHeight
165 heightAnim.restart();
171 function onCurrentItemChanged() {
176 heightAnim.from = root.implicitHeight;
177 heightAnim.to = root.preferredHeight;
179 heightAnim.restart();
185 clip: childrenRect.
width > width
188 for (
const child of children) {
189 child.anchors.verticalCenter = verticalCenter;
195 topMargin: root.topPadding
196 leftMargin: root.leftPadding
197 rightMargin: root.rightPadding
198 bottomMargin: root.bottomPadding
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)