Skip to content

Commit

Permalink
Remove banner properties from GlobalDrawer
Browse files Browse the repository at this point in the history
The banner image was drop in the design of our apps a while ago,
today is not used anymore, remove the api for kf6
related issue: https://invent.kde.org/frameworks/kirigami/-/issues/64
  • Loading branch information
notmart committed Oct 4, 2023
1 parent ab82ee0 commit 41bdddb
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 85 deletions.
2 changes: 0 additions & 2 deletions Mainpage.dox
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ Kirigami.ApplicationWindow {
height: 400

globalDrawer: Kirigami.GlobalDrawer {
title: "Hello App"
titleIcon: "applications-graphics"
actions: [
Kirigami.Action {
text: "View"
Expand Down
3 changes: 0 additions & 3 deletions examples/applicationitemapp/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ Kirigami.ApplicationItem {
id: root

globalDrawer: Kirigami.GlobalDrawer {
title: "Hello App"
titleIcon: "applications-graphics"

actions: [
Kirigami.Action {
text: "View"
Expand Down
1 change: 0 additions & 1 deletion examples/simpleexamples/AbstractApplicationWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Kirigami.AbstractApplicationWindow {
globalDrawer: Kirigami.GlobalDrawer {
title: "Widget gallery"
titleIcon: "applications-graphics"

actions: [
Kirigami.Action {
text: "View"
Expand Down
3 changes: 0 additions & 3 deletions examples/simpleexamples/footer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ Kirigami.ApplicationWindow {
}
}
globalDrawer: Kirigami.GlobalDrawer {
title: "Hello App"
titleIcon: "applications-graphics"

actions: [
Kirigami.Action {
text: "View"
Expand Down
2 changes: 0 additions & 2 deletions examples/simpleexamples/layerOverDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Kirigami.ApplicationWindow {

Kirigami.GlobalDrawer {
id: drawer
title: "Hello App"
titleIcon: "applications-graphics"
modal: false

actions: [
Expand Down
3 changes: 0 additions & 3 deletions examples/simpleexamples/minimal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ Kirigami.ApplicationWindow {
id: root

globalDrawer: Kirigami.GlobalDrawer {
title: "Hello App"
titleIcon: "applications-graphics"

actions: [
Kirigami.Action {
text: "View"
Expand Down
2 changes: 0 additions & 2 deletions examples/simpleexamples/pagePoolDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Kirigami.ApplicationWindow {
}

globalDrawer: Kirigami.GlobalDrawer {
title: "Hello App"
titleIcon: "applications-graphics"
modal: !root.wideScreen
width: Kirigami.Units.gridUnit * 10

Expand Down
2 changes: 0 additions & 2 deletions examples/simpleexamples/pagePoolFirstColumn.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Kirigami.ApplicationWindow {
}

globalDrawer: Kirigami.GlobalDrawer {
title: "Hello App"
titleIcon: "applications-graphics"
}
contextDrawer: Kirigami.ContextDrawer {
id: contextDrawer
Expand Down
3 changes: 0 additions & 3 deletions examples/simpleexamples/pushpopclear.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ Kirigami.ApplicationWindow {
id: root

globalDrawer: Kirigami.GlobalDrawer {
title: "Hello App"
titleIcon: "applications-graphics"

actions: [
Kirigami.Action {
text: "push"
Expand Down
2 changes: 0 additions & 2 deletions examples/simpleexamples/simpleChatApp.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ Kirigami.ApplicationWindow {

globalDrawer: Kirigami.GlobalDrawer {
contentItem.implicitWidth: columnWidth
title: "Chat App"
titleIcon: "konversation"
modal: true
drawerOpen: false
isMenu: true
Expand Down
2 changes: 0 additions & 2 deletions examples/staticcmake/src/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Kirigami.ApplicationWindow {
pageStack.initialPage: Page1 {}

globalDrawer: Kirigami.GlobalDrawer {
title: "Hello App"
titleIcon: "applications-graphics"
actions: [
Kirigami.Action {
text: "View"
Expand Down
72 changes: 14 additions & 58 deletions src/controls/GlobalDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,15 @@ OverlayDrawer {
* @see org::kde::kirigami::private::BannerImage::title
* @property string title
*/
property alias title: bannerImage.title
property string title

/**
* @brief This property holds an icon to be displayed alongside the title.
* @see org::kde::kirigami::private::BannerImage::titleIcon
* @see org::kde::kirigami::Icon::source
* @property var titleIcon
*/
property alias titleIcon: bannerImage.titleIcon

/**
* @brief This property holds the banner image source.
* @see org::kde::kirigami::ShadowedImage::source
* @property url bannerImageSource
*/
property alias bannerImageSource: bannerImage.source
property var titleIcon

/**
* @brief This property holds the actions displayed in the drawer.
Expand Down Expand Up @@ -128,19 +121,15 @@ OverlayDrawer {
* @note This property is mainly intended for toolbars.
* @since 2.12
*/
property Item header

/**
* @brief This property sets drawers banner visibility.
*
* If true, the banner area (which can contain an image,
* an icon, and a title) will be visible.
*
* default: `the banner will be visible only on mobile platforms`
*
* @since 2.12
*/
property bool bannerVisible: Kirigami.Settings.isMobile
property Item header: RowLayout {
visible: root.title.length > 0 || root.titleIcon
Kirigami.Icon {
source: root.titleIcon
}
Kirigami.Heading {
text: root.title
}
}

/**
* @brief This property holds items that are displayed above the actions.
Expand Down Expand Up @@ -256,11 +245,6 @@ OverlayDrawer {
property bool collapseButtonVisible: true
//END properties

/**
* @brief This signal notifies that the banner has been clicked.
*/
signal bannerClicked()

/**
* @brief This function reverts the menu back to its initial state
*/
Expand All @@ -275,6 +259,9 @@ OverlayDrawer {

Kirigami.Theme.colorSet: modal ? Kirigami.Theme.Window : Kirigami.Theme.View

Component.onCompleted: {
headerChanged()
}
onHeaderChanged: {
if (header) {
header.parent = headerContainer
Expand Down Expand Up @@ -320,40 +307,9 @@ OverlayDrawer {
rightMargin: Math.min(0, -scrollView.width + mainFlickable.width)
}
spacing: 0
y: bannerImage.visible ? Math.max(headerContainer.height, -mainFlickable.contentY) - height : 0

Layout.fillWidth: true
// visible: !bannerImage.empty || root.collapsible

P.BannerImage {
id: bannerImage


visible: !bannerImage.empty && opacity > 0 && root.bannerVisible
opacity: !root.collapsed
fillMode: Image.PreserveAspectCrop

Behavior on opacity {
OpacityAnimator {
duration: Kirigami.Units.longDuration
easing.type: Easing.InOutQuad
}
}
// leftPadding: root.collapsible ? collapseButton.width + Kirigami.Units.smallSpacing*2 : topPadding
MouseArea {
anchors.fill: parent
onClicked: mouse => root.bannerClicked()
}
P.EdgeShadow {
edge: Qt.BottomEdge
visible: bannerImageSource != ""
anchors {
left: parent.left
right: parent.right
bottom: parent.top
}
}
}
RowLayout {
id: headerContainer
Kirigami.Theme.inherit: false
Expand Down
2 changes: 0 additions & 2 deletions templates/kirigami6/src/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Kirigami.ApplicationWindow {
property int counter: 0

globalDrawer: Kirigami.GlobalDrawer {
title: i18n("%{APPNAME}")
titleIcon: "applications-graphics"
isMenu: !Kirigami.Settings.isMobile
actions: [
Kirigami.Action {
Expand Down

0 comments on commit 41bdddb

Please sign in to comment.