Warning, /multimedia/kasts/src/qml/KastsGlobalDrawer.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2020 Tobias Fella <tobias.fella@kde.org> 0002 // SPDX-FileCopyrightText: 2021-2022 Bart De Vries <bart@mogwai.be> 0003 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 0005 import QtQuick 0006 import QtQuick.Controls as QQC2 0007 import QtQuick.Layouts 0008 0009 import org.kde.kirigami as Kirigami 0010 0011 import org.kde.kasts 0012 0013 Kirigami.OverlayDrawer { 0014 id: root 0015 modal: false 0016 closePolicy: QQC2.Popup.NoAutoClose 0017 edge: Qt.application.layoutDirection === Qt.RightToLeft ? Qt.RightEdge : Qt.LeftEdge 0018 0019 readonly property real pinnedWidth: Kirigami.Units.gridUnit * 3 0020 readonly property real widescreenBigWidth: Kirigami.Units.gridUnit * 10 0021 readonly property int buttonDisplayMode: kastsMainWindow.isWidescreen ? Kirigami.NavigationTabButton.TextBesideIcon : Kirigami.NavigationTabButton.IconOnly 0022 0023 width: showGlobalDrawer ? (kastsMainWindow.isWidescreen ? widescreenBigWidth : pinnedWidth) : 0 0024 0025 Kirigami.Theme.colorSet: Kirigami.Theme.Window 0026 Kirigami.Theme.inherit: false 0027 0028 leftPadding: 0 0029 rightPadding: 0 0030 topPadding: 0 0031 bottomPadding: 0 0032 0033 contentItem: Loader { 0034 id: sidebarColumn 0035 active: showGlobalDrawer 0036 0037 sourceComponent: ColumnLayout { 0038 spacing: 0 0039 0040 QQC2.ToolBar { 0041 Layout.fillWidth: true 0042 Layout.preferredHeight: pageStack.globalToolBar.preferredHeight 0043 0044 leftPadding: Kirigami.Units.smallSpacing 0045 rightPadding: Kirigami.Units.smallSpacing 0046 topPadding: Kirigami.Units.smallSpacing 0047 bottomPadding: Kirigami.Units.smallSpacing 0048 0049 contentItem: GlobalSearchField {} 0050 } 0051 0052 QQC2.ScrollView { 0053 id: scrollView 0054 Layout.fillWidth: true 0055 Layout.fillHeight: true 0056 0057 QQC2.ScrollBar.vertical.policy: QQC2.ScrollBar.AlwaysOff 0058 QQC2.ScrollBar.horizontal.policy: QQC2.ScrollBar.AlwaysOff 0059 contentWidth: -1 // disable horizontal scroll 0060 0061 ColumnLayout { 0062 id: column 0063 width: scrollView.width 0064 spacing: 0 0065 0066 Kirigami.NavigationTabButton { 0067 Layout.fillWidth: true 0068 display: root.buttonDisplayMode 0069 text: i18n("Queue") 0070 icon.name: "source-playlist" 0071 checked: currentPage == "QueuePage" 0072 onClicked: { 0073 pushPage("QueuePage") 0074 } 0075 } 0076 Kirigami.NavigationTabButton { 0077 Layout.fillWidth: true 0078 display: root.buttonDisplayMode 0079 text: i18n("Discover") 0080 icon.name: "search" 0081 checked: currentPage == "DiscoverPage" 0082 onClicked: { 0083 pushPage("DiscoverPage") 0084 } 0085 } 0086 Kirigami.NavigationTabButton { 0087 Layout.fillWidth: true 0088 display: root.buttonDisplayMode 0089 text: i18n("Subscriptions") 0090 icon.name: "bookmarks" 0091 checked: currentPage == "FeedListPage" 0092 onClicked: { 0093 pushPage("FeedListPage") 0094 } 0095 } 0096 Kirigami.NavigationTabButton { 0097 Layout.fillWidth: true 0098 display: root.buttonDisplayMode 0099 text: i18n("Episodes") 0100 icon.name: "rss" 0101 checked: currentPage == "EpisodeListPage" 0102 onClicked: { 0103 pushPage("EpisodeListPage") 0104 } 0105 } 0106 Kirigami.NavigationTabButton { 0107 Layout.fillWidth: true 0108 display: root.buttonDisplayMode 0109 text: i18n("Downloads") 0110 icon.name: "download" 0111 checked: currentPage == "DownloadListPage" 0112 onClicked: { 0113 pushPage("DownloadListPage") 0114 } 0115 } 0116 } 0117 } 0118 0119 Kirigami.Separator { 0120 Layout.fillWidth: true 0121 Layout.rightMargin: Kirigami.Units.smallSpacing 0122 Layout.leftMargin: Kirigami.Units.smallSpacing 0123 } 0124 0125 Kirigami.NavigationTabButton { 0126 Layout.fillWidth: true 0127 display: root.buttonDisplayMode 0128 0129 text: i18n("Settings") 0130 icon.name: "settings-configure" 0131 checked: currentPage == "SettingsPage" 0132 onClicked: { 0133 checked = false; 0134 pushPage("SettingsPage") 0135 } 0136 } 0137 } 0138 } 0139 }