mirror of https://github.com/KDE/kasts.git
Make sure that drawer handles don't overlap with bottom tabbars
This commit is contained in:
parent
c2e4822e85
commit
3a1c88038a
|
@ -37,13 +37,19 @@ Kirigami.Page {
|
||||||
id: tabBarComponent
|
id: tabBarComponent
|
||||||
Controls.TabBar {
|
Controls.TabBar {
|
||||||
id: tabBar
|
id: tabBar
|
||||||
position: Controls.TabBar.Footer
|
position: Kirigami.Settings.isMobile ? Controls.TabBar.Footer : Controls.TabBar.Header
|
||||||
currentIndex: swipeViewItem.currentIndex
|
currentIndex: swipeViewItem.currentIndex
|
||||||
|
contentHeight: tabBarHeight
|
||||||
|
|
||||||
Controls.TabButton {
|
Controls.TabButton {
|
||||||
width: parent.parent.width/parent.count
|
width: parent.parent.width/parent.count
|
||||||
height: Kirigami.Units.gridUnit * 2
|
height: tabBarHeight
|
||||||
text: i18n("Downloaded")
|
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
|
currentIndex: Kirigami.Settings.isMobile ? footerLoader.item.currentIndex : headerLoader.item.currentIndex
|
||||||
|
|
||||||
EpisodeListPage {
|
EpisodeListPage {
|
||||||
title: i18n("Downloaded")
|
title: i18n("Running")
|
||||||
|
episodeType: EpisodeModel.Downloading
|
||||||
|
}
|
||||||
|
|
||||||
|
EpisodeListPage {
|
||||||
|
title: i18n("Completed")
|
||||||
episodeType: EpisodeModel.Downloaded
|
episodeType: EpisodeModel.Downloaded
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/**
|
/**
|
||||||
* SPDX-FileCopyrightText: 2020 Tobias Fella <fella@posteo.de>
|
|
||||||
* SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be>
|
* SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
* 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
|
active: !Kirigami.Settings.isMobile
|
||||||
sourceComponent: tabBarComponent
|
sourceComponent: tabBarComponent
|
||||||
property var swipeViewItem: swipeView
|
property var swipeViewItem: swipeView
|
||||||
|
//height: tabBarHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
footer: Loader {
|
footer: Loader {
|
||||||
|
@ -38,22 +38,23 @@ Kirigami.Page {
|
||||||
id: tabBarComponent
|
id: tabBarComponent
|
||||||
Controls.TabBar {
|
Controls.TabBar {
|
||||||
id: tabBar
|
id: tabBar
|
||||||
position: Controls.TabBar.Footer
|
position: Kirigami.Settings.isMobile ? Controls.TabBar.Footer : Controls.TabBar.Header
|
||||||
currentIndex: swipeViewItem.currentIndex
|
currentIndex: swipeViewItem.currentIndex
|
||||||
|
contentHeight: tabBarHeight
|
||||||
|
|
||||||
Controls.TabButton {
|
Controls.TabButton {
|
||||||
width: parent.parent.width/parent.count
|
width: parent.parent.width/parent.count
|
||||||
height: Kirigami.Units.gridUnit * 2
|
height: tabBarHeight
|
||||||
text: i18n("New Episodes")
|
text: i18n("New Episodes")
|
||||||
}
|
}
|
||||||
Controls.TabButton {
|
Controls.TabButton {
|
||||||
width: parent.parent.width/parent.count
|
width: parent.parent.width/parent.count
|
||||||
height: Kirigami.Units.gridUnit * 2
|
height: tabBarHeight
|
||||||
text: i18n("Unread Episodes")
|
text: i18n("Unread Episodes")
|
||||||
}
|
}
|
||||||
Controls.TabButton {
|
Controls.TabButton {
|
||||||
width: parent.parent.width/parent.count
|
width: parent.parent.width/parent.count
|
||||||
height: Kirigami.Units.gridUnit * 2
|
height: tabBarHeight
|
||||||
text: i18n("All Episodes")
|
text: i18n("All Episodes")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,9 @@ Kirigami.ApplicationWindow {
|
||||||
title: "Alligator"
|
title: "Alligator"
|
||||||
|
|
||||||
property var miniplayerSize: Kirigami.Units.gridUnit * 3 + Kirigami.Units.gridUnit / 6
|
property var miniplayerSize: Kirigami.Units.gridUnit * 3 + Kirigami.Units.gridUnit / 6
|
||||||
|
property int tabBarHeight: Kirigami.Units.gridUnit * 2
|
||||||
|
property int tabBarActive: 0
|
||||||
|
|
||||||
Kirigami.PagePool {
|
Kirigami.PagePool {
|
||||||
id: mainPagePool
|
id: mainPagePool
|
||||||
cachePages: false
|
cachePages: false
|
||||||
|
@ -34,7 +37,7 @@ Kirigami.ApplicationWindow {
|
||||||
globalDrawer: Kirigami.GlobalDrawer {
|
globalDrawer: Kirigami.GlobalDrawer {
|
||||||
isMenu: false
|
isMenu: false
|
||||||
// make room at the bottom for miniplayer
|
// 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
|
handleVisible: !audio.entry || footerLoader.item.contentY == 0
|
||||||
actions: [
|
actions: [
|
||||||
Kirigami.PagePoolAction {
|
Kirigami.PagePoolAction {
|
||||||
|
@ -44,6 +47,7 @@ Kirigami.ApplicationWindow {
|
||||||
page: "qrc:/QueuePage.qml"
|
page: "qrc:/QueuePage.qml"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
SettingsManager.lastOpenedPage = "QueuePage" // for persistency
|
SettingsManager.lastOpenedPage = "QueuePage" // for persistency
|
||||||
|
tabBarActive = 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Kirigami.PagePoolAction {
|
Kirigami.PagePoolAction {
|
||||||
|
@ -53,6 +57,7 @@ Kirigami.ApplicationWindow {
|
||||||
page: "qrc:/EpisodeSwipePage.qml"
|
page: "qrc:/EpisodeSwipePage.qml"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
SettingsManager.lastOpenedPage = "EpisodeSwipePage" // for persistency
|
SettingsManager.lastOpenedPage = "EpisodeSwipePage" // for persistency
|
||||||
|
tabBarActive = 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Kirigami.PagePoolAction {
|
Kirigami.PagePoolAction {
|
||||||
|
@ -62,6 +67,7 @@ Kirigami.ApplicationWindow {
|
||||||
page: "qrc:/FeedListPage.qml"
|
page: "qrc:/FeedListPage.qml"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
SettingsManager.lastOpenedPage = "FeedListPage" // for persistency
|
SettingsManager.lastOpenedPage = "FeedListPage" // for persistency
|
||||||
|
tabBarActive = 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Kirigami.PagePoolAction {
|
Kirigami.PagePoolAction {
|
||||||
|
@ -71,6 +77,7 @@ Kirigami.ApplicationWindow {
|
||||||
page: "qrc:/DownloadSwipePage.qml"
|
page: "qrc:/DownloadSwipePage.qml"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
SettingsManager.lastOpenedPage = "DownloadSwipePage" // for persistency
|
SettingsManager.lastOpenedPage = "DownloadSwipePage" // for persistency
|
||||||
|
tabBarActive = 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Kirigami.PagePoolAction {
|
Kirigami.PagePoolAction {
|
||||||
|
@ -102,7 +109,7 @@ Kirigami.ApplicationWindow {
|
||||||
contextDrawer: Kirigami.ContextDrawer {
|
contextDrawer: Kirigami.ContextDrawer {
|
||||||
id: contextDrawer
|
id: contextDrawer
|
||||||
// make room at the bottom for miniplayer
|
// 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
|
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
|
// create space at the bottom to show miniplayer without it hiding stuff
|
||||||
// underneath
|
// underneath
|
||||||
pageStack.anchors.bottomMargin: (audio.entry) ? miniplayerSize : 0
|
pageStack.anchors.bottomMargin: (audio.entry) ? miniplayerSize : 0
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: footerLoader
|
id: footerLoader
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue