From 3a1c88038a874630dca42d271d71140b9f4a5309 Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Tue, 20 Apr 2021 14:17:38 +0200 Subject: [PATCH] Make sure that drawer handles don't overlap with bottom tabbars --- src/qml/DownloadSwipePage.qml | 19 +++++++++++++++---- src/qml/EpisodeSwipePage.qml | 11 ++++++----- src/qml/main.qml | 12 ++++++++++-- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/qml/DownloadSwipePage.qml b/src/qml/DownloadSwipePage.qml index 4a233349..4d0c7734 100644 --- a/src/qml/DownloadSwipePage.qml +++ b/src/qml/DownloadSwipePage.qml @@ -37,13 +37,19 @@ Kirigami.Page { id: tabBarComponent Controls.TabBar { id: tabBar - position: Controls.TabBar.Footer + position: Kirigami.Settings.isMobile ? Controls.TabBar.Footer : Controls.TabBar.Header currentIndex: swipeViewItem.currentIndex + contentHeight: tabBarHeight Controls.TabButton { width: parent.parent.width/parent.count - height: Kirigami.Units.gridUnit * 2 - text: i18n("Downloaded") + height: tabBarHeight + text: i18n("Running") + } + Controls.TabButton { + width: parent.parent.width/parent.count + height: tabBarHeight + text: i18n("Completed") } } } @@ -54,7 +60,12 @@ Kirigami.Page { currentIndex: Kirigami.Settings.isMobile ? footerLoader.item.currentIndex : headerLoader.item.currentIndex EpisodeListPage { - title: i18n("Downloaded") + title: i18n("Running") + episodeType: EpisodeModel.Downloading + } + + EpisodeListPage { + title: i18n("Completed") episodeType: EpisodeModel.Downloaded } } diff --git a/src/qml/EpisodeSwipePage.qml b/src/qml/EpisodeSwipePage.qml index d16c29c7..60379ecc 100644 --- a/src/qml/EpisodeSwipePage.qml +++ b/src/qml/EpisodeSwipePage.qml @@ -1,5 +1,4 @@ /** - * SPDX-FileCopyrightText: 2020 Tobias Fella * SPDX-FileCopyrightText: 2021 Bart De Vries * * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL @@ -25,6 +24,7 @@ Kirigami.Page { active: !Kirigami.Settings.isMobile sourceComponent: tabBarComponent property var swipeViewItem: swipeView + //height: tabBarHeight } footer: Loader { @@ -38,22 +38,23 @@ Kirigami.Page { id: tabBarComponent Controls.TabBar { id: tabBar - position: Controls.TabBar.Footer + position: Kirigami.Settings.isMobile ? Controls.TabBar.Footer : Controls.TabBar.Header currentIndex: swipeViewItem.currentIndex + contentHeight: tabBarHeight Controls.TabButton { width: parent.parent.width/parent.count - height: Kirigami.Units.gridUnit * 2 + height: tabBarHeight text: i18n("New Episodes") } Controls.TabButton { width: parent.parent.width/parent.count - height: Kirigami.Units.gridUnit * 2 + height: tabBarHeight text: i18n("Unread Episodes") } Controls.TabButton { width: parent.parent.width/parent.count - height: Kirigami.Units.gridUnit * 2 + height: tabBarHeight text: i18n("All Episodes") } } diff --git a/src/qml/main.qml b/src/qml/main.qml index 1159d064..bf6b4f8c 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -20,6 +20,9 @@ Kirigami.ApplicationWindow { title: "Alligator" property var miniplayerSize: Kirigami.Units.gridUnit * 3 + Kirigami.Units.gridUnit / 6 + property int tabBarHeight: Kirigami.Units.gridUnit * 2 + property int tabBarActive: 0 + Kirigami.PagePool { id: mainPagePool cachePages: false @@ -34,7 +37,7 @@ Kirigami.ApplicationWindow { globalDrawer: Kirigami.GlobalDrawer { isMenu: false // make room at the bottom for miniplayer - handle.anchors.bottomMargin: ( audio.entry ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + Kirigami.Units.smallSpacing + handle.anchors.bottomMargin: ( audio.entry ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + Kirigami.Units.smallSpacing + tabBarActive * tabBarHeight handleVisible: !audio.entry || footerLoader.item.contentY == 0 actions: [ Kirigami.PagePoolAction { @@ -44,6 +47,7 @@ Kirigami.ApplicationWindow { page: "qrc:/QueuePage.qml" onTriggered: { SettingsManager.lastOpenedPage = "QueuePage" // for persistency + tabBarActive = 0 } }, Kirigami.PagePoolAction { @@ -53,6 +57,7 @@ Kirigami.ApplicationWindow { page: "qrc:/EpisodeSwipePage.qml" onTriggered: { SettingsManager.lastOpenedPage = "EpisodeSwipePage" // for persistency + tabBarActive = 1 } }, Kirigami.PagePoolAction { @@ -62,6 +67,7 @@ Kirigami.ApplicationWindow { page: "qrc:/FeedListPage.qml" onTriggered: { SettingsManager.lastOpenedPage = "FeedListPage" // for persistency + tabBarActive = 0 } }, Kirigami.PagePoolAction { @@ -71,6 +77,7 @@ Kirigami.ApplicationWindow { page: "qrc:/DownloadSwipePage.qml" onTriggered: { SettingsManager.lastOpenedPage = "DownloadSwipePage" // for persistency + tabBarActive = 1 } }, Kirigami.PagePoolAction { @@ -102,7 +109,7 @@ Kirigami.ApplicationWindow { contextDrawer: Kirigami.ContextDrawer { id: contextDrawer // make room at the bottom for miniplayer - handle.anchors.bottomMargin: ( audio.entry ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + Kirigami.Units.smallSpacing + handle.anchors.bottomMargin: ( audio.entry ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + Kirigami.Units.smallSpacing + tabBarActive * tabBarHeight handleVisible: !audio.entry || footerLoader.item.contentY == 0 } @@ -125,6 +132,7 @@ Kirigami.ApplicationWindow { // create space at the bottom to show miniplayer without it hiding stuff // underneath pageStack.anchors.bottomMargin: (audio.entry) ? miniplayerSize : 0 + Loader { id: footerLoader