/* * SPDX-FileCopyrightText: 2021 Noah Davis * SPDX-License-Identifier: LGPL-2.0-or-later */ import QtQuick 2.15 import QtQuick.Templates 2.15 as T import QtQml 2.15 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PC3 EmptyPage { id: root property real preferredSideBarWidth: Math.max(footer.tabBar.implicitWidth, applicationsPage.implicitSideBarWidth) contentItem: HorizontalStackView { id: stackView focus: true reverseTransitions: footer.tabBar.currentIndex === 1 initialItem: ApplicationsPage { id: applicationsPage preferredSideBarWidth: root.preferredSideBarWidth + plasmoid.rootItem.backgroundMetrics.leftPadding } Component { id: placesPage PlacesPage { preferredSideBarWidth: root.preferredSideBarWidth + plasmoid.rootItem.backgroundMetrics.leftPadding preferredSideBarHeight: applicationsPage.implicitSideBarHeight } } Connections { target: footer.tabBar function onCurrentIndexChanged() { if (footer.tabBar.currentIndex === 0) { stackView.replace(applicationsPage) } else if (footer.tabBar.currentIndex === 1) { stackView.replace(placesPage) } } } } footer: Footer { id: footer preferredTabBarWidth: root.preferredSideBarWidth Binding { target: plasmoid.rootItem property: "footer" value: footer restoreMode: Binding.RestoreBinding } // Eat down events to prevent them from reaching the contentArea or searchField Keys.onDownPressed: {} } }