Commit 09746fb4 authored by Marco Martin's avatar Marco Martin
Browse files

control to show/hide the banner

parent 59ea5685
......@@ -20,17 +20,33 @@
import QtQuick 2.1
import QtQuick.Controls 2.0 as Controls
import QtQuick.Layouts 1.2
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kirigami 2.11 as Kirigami
import "gallery"
Kirigami.ApplicationWindow {
id: root
globalDrawer: Kirigami.GlobalDrawer {
id: globalDrawer
title: "Widget gallery"
titleIcon: "applications-graphics"
bannerImageSource: "banner.jpg"
showHeaderWhenCollapsed: true
header: RowLayout {
Layout.fillWidth: true
Controls.ToolButton {
icon.name: "application-menu"
visible: globalDrawer.collapsible
checked: !globalDrawer.collapsed
onClicked: globalDrawer.collapsed = !globalDrawer.collapsed
}
Kirigami.SearchField {
visible: !globalDrawer.collapsed
Layout.fillWidth: true
}
}
actions: [
Kirigami.Action {
text: "Top Bar Style..."
......@@ -133,10 +149,16 @@ Kirigami.ApplicationWindow {
Kirigami.Action {
text: "Title style..."
iconName: "format-border-set-top"
Kirigami.Action {
text: qsTr("Show Banner")
checked: globalDrawer.bannerVisible
onTriggered: globalDrawer.bannerVisible = !globalDrawer.bannerVisible
}
Kirigami.Action {
text: "Title And Image"
checked: root.globalDrawer.title.length > 0 &&
root.globalDrawer.bannerImageSource.toString().length > 0
enabled: globalDrawer.bannerVisible
onTriggered: {
root.globalDrawer.title = "Widget gallery"
root.globalDrawer.titleIcon = "applications-graphics"
......@@ -147,6 +169,7 @@ Kirigami.ApplicationWindow {
text: "Title Only"
checked: root.globalDrawer.title.length > 0 &&
root.globalDrawer.bannerImageSource.toString().length == 0
enabled: globalDrawer.bannerVisible
onTriggered: {
root.globalDrawer.title = "Widget gallery"
root.globalDrawer.titleIcon = "applications-graphics"
......@@ -157,6 +180,7 @@ Kirigami.ApplicationWindow {
text: "None"
checked: root.globalDrawer.title.length == 0 &&
root.globalDrawer.bannerImageSource.toString().length == 0
enabled: globalDrawer.bannerVisible
onTriggered: {
root.globalDrawer.title = ""
root.globalDrawer.titleIcon = "";
......
Markdown is supported
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