Commit ea0929a8 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Adapt again to the smaller form factor

Use the standard application header when not wide.
Show the context drawer.
parent f14ba01c
/***************************************************************************
* Copyright © 2018 Aleix Pol Gonzalez <aleixpol@blue-systems.com> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License or (at your option) version 3 or any later version *
* accepted by the membership of KDE e.V. (or its successor approved *
* by the membership of KDE e.V.), which shall act as a proxy *
* defined in Section 14 of version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
import QtQuick 2.1
QtObject
{
id: root
property Component componentTrue
property Component componentFalse
property bool condition
onConditionChanged: {
if (object)
object.destroy(100)
var component = (condition ? componentTrue : componentFalse)
object = component ? component.createObject(root) : null
}
property QtObject object
}
......@@ -28,11 +28,14 @@ Kirigami.ApplicationWindow
objectName: "DiscoverMainWindow"
title: leftPage ? leftPage.title : ""
header: Kirigami.ToolBarApplicationHeader {}
// header: (window.wideScreen ? desktopHeader : mobileHeader).createObject()
//
// Component { id: desktopHeader; Kirigami.ToolBarApplicationHeader {} }
// Component { id: mobileHeader; Kirigami.ApplicationHeader {} }
ConditionalObject {
id: whichToolbar
condition: window.wideScreen
componentTrue: Component { id: desktopHeader; Kirigami.ToolBarApplicationHeader {} }
componentFalse: Component { id: mobileHeader; Kirigami.ApplicationHeader {} }
}
header: whichToolbar.object
visible: true
......@@ -218,6 +221,13 @@ Kirigami.ApplicationWindow
}
}
ConditionalObject {
id: drawerObject
condition: window.wideScreen
componentFalse: Kirigami.ContextDrawer {}
}
contextDrawer: drawerObject.object
globalDrawer: DiscoverDrawer {
wideScreen: window.wideScreen
}
......
......@@ -21,6 +21,7 @@
<file>qml/ReviewDelegate.qml</file>
<file>qml/AddSourceDialog.qml</file>
<file>qml/ConditionalLoader.qml</file>
<file>qml/ConditionalObject.qml</file>
<file>qml/LinkButton.qml</file>
<file>qml/ApplicationScreenshots.qml</file>
<file>qml/LabelBackground.qml</file>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment