Desktop mode updated

This commit is contained in:
Swapnil Tripathi 2021-05-28 15:29:45 +05:30 committed by Bart De Vries
parent 44bb387b54
commit 4f02d8676f
1 changed files with 17 additions and 2 deletions

View File

@ -21,6 +21,10 @@ Kirigami.ApplicationWindow {
property int tabBarHeight: Kirigami.Units.gridUnit * 2
property int bottomMessageSpacing: Kirigami.Units.largeSpacing * 9 + ( ( AudioManager.entry && Kirigami.Settings.isMobile ) ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + tabBarActive * tabBarHeight
property int tabBarActive: 0
property int originalWidth: Kirigami.Units.gridUnit * 10
property bool isWidescreen: root.width >= root.height
onIsWidescreenChanged: changeNavigation(!isWidescreen);
Kirigami.PagePool {
id: mainPagePool
@ -44,13 +48,13 @@ Kirigami.ApplicationWindow {
globalDrawer: Kirigami.GlobalDrawer {
isMenu: false
modal: Kirigami.Settings.isMobile
width: Kirigami.Settings.isMobile ? Layout.implicitWidth : Kirigami.Units.gridUnit * 10
collapsible: !Kirigami.Settings.isMobile
header: Kirigami.AbstractApplicationHeader {
visible: !Kirigami.Settings.isMobile
}
// make room at the bottom for miniplayer
handle.anchors.bottomMargin: (( AudioManager.entry && Kirigami.Settings.isMobile ) ? (footerLoader.item.contentY == 0 ? miniplayerSize : 0) : 0) + Kirigami.Units.smallSpacing + tabBarActive * tabBarHeight
handleVisible: !(AudioManager.entry && Kirigami.Settings.isMobile) || footerLoader.item.contentY === 0
showHeaderWhenCollapsed: true
actions: [
Kirigami.PagePoolAction {
text: i18n("Queue")
@ -107,6 +111,17 @@ Kirigami.ApplicationWindow {
]
}
function changeNavigation(isNarrow) {
if(isNarrow) {
globalDrawer.collapsed = true
globalDrawer.width = Layout.implicitWidth
}
else {
globalDrawer.collapsed = false
globalDrawer.width = originalWidth
}
}
Component {
id: aboutPage