Move notifications button to space drawer.
Since this means that the space drawer can no longer be hidden when there are no spaces, also make it less empty by adding a button for creating new spaces. More things will come in the future. BUG: 479051
This commit is contained in:
@@ -13,7 +13,7 @@ import org.kde.kirigamiaddons.labs.components as KirigamiComponents
|
|||||||
Delegates.RoundedItemDelegate {
|
Delegates.RoundedItemDelegate {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property url source
|
property url source
|
||||||
|
|
||||||
signal contextMenuRequested()
|
signal contextMenuRequested()
|
||||||
signal selected()
|
signal selected()
|
||||||
|
|||||||
@@ -129,24 +129,6 @@ Kirigami.Page {
|
|||||||
|
|
||||||
topMargin: Math.round(Kirigami.Units.smallSpacing / 2)
|
topMargin: Math.round(Kirigami.Units.smallSpacing / 2)
|
||||||
|
|
||||||
KirigamiComponents.FloatingButton {
|
|
||||||
icon.name: "notifications"
|
|
||||||
text: i18n("View notifications")
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Kirigami.Units.largeSpacing
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.bottomMargin: Kirigami.Units.largeSpacing
|
|
||||||
width: Kirigami.Units.gridUnit * 2
|
|
||||||
height: width
|
|
||||||
visible: !root.collapsed
|
|
||||||
QQC2.ToolTip.text: text
|
|
||||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
|
||||||
QQC2.ToolTip.visible: hovered
|
|
||||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/NotificationsView.qml", {connection: root.connection}, {
|
|
||||||
title: i18nc("@title", "Notifications")
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
header: QQC2.ItemDelegate {
|
header: QQC2.ItemDelegate {
|
||||||
width: visible ? ListView.view.width : 0
|
width: visible ? ListView.view.width : 0
|
||||||
height: visible ? Kirigami.Units.gridUnit * 2 : 0
|
height: visible ? Kirigami.Units.gridUnit * 2 : 0
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ QQC2.Control {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property real pinnedWidth: Kirigami.Units.gridUnit * 6
|
readonly property real pinnedWidth: Kirigami.Units.gridUnit * 6
|
||||||
property bool drawerEnabled: true
|
|
||||||
|
|
||||||
required property NeoChatConnection connection
|
required property NeoChatConnection connection
|
||||||
|
|
||||||
leftPadding: 0
|
leftPadding: 0
|
||||||
@@ -27,7 +25,6 @@ QQC2.Control {
|
|||||||
|
|
||||||
contentItem: Loader {
|
contentItem: Loader {
|
||||||
id: sidebarColumn
|
id: sidebarColumn
|
||||||
active: root.drawerEnabled
|
|
||||||
z: 0
|
z: 0
|
||||||
|
|
||||||
sourceComponent: ColumnLayout {
|
sourceComponent: ColumnLayout {
|
||||||
@@ -52,6 +49,30 @@ QQC2.Control {
|
|||||||
width: scrollView.width
|
width: scrollView.width
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
|
AvatarTabButton {
|
||||||
|
id: notificationsButton
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: width - Kirigami.Units.smallSpacing
|
||||||
|
Layout.maximumHeight: width - Kirigami.Units.smallSpacing
|
||||||
|
Layout.topMargin: Kirigami.Units.smallSpacing / 2
|
||||||
|
Layout.bottomMargin: Kirigami.Units.smallSpacing / 2
|
||||||
|
text: i18n("View notifications")
|
||||||
|
contentItem: Kirigami.Icon {
|
||||||
|
source: "notifications"
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/NotificationsView.qml", {connection: root.connection}, {
|
||||||
|
title: i18nc("@title", "Notifications")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Kirigami.Separator {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.leftMargin: Kirigami.Units.smallSpacing
|
||||||
|
Layout.rightMargin: Kirigami.Units.smallSpacing
|
||||||
|
}
|
||||||
|
|
||||||
AvatarTabButton {
|
AvatarTabButton {
|
||||||
id: allRoomButton
|
id: allRoomButton
|
||||||
|
|
||||||
@@ -61,8 +82,6 @@ QQC2.Control {
|
|||||||
Layout.topMargin: Kirigami.Units.smallSpacing / 2
|
Layout.topMargin: Kirigami.Units.smallSpacing / 2
|
||||||
|
|
||||||
text: i18n("All Rooms")
|
text: i18n("All Rooms")
|
||||||
source: "globe"
|
|
||||||
|
|
||||||
contentItem: Kirigami.Icon {
|
contentItem: Kirigami.Icon {
|
||||||
source: "globe"
|
source: "globe"
|
||||||
}
|
}
|
||||||
@@ -78,12 +97,10 @@ QQC2.Control {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
onCountChanged: {
|
onCountChanged: {
|
||||||
root.enabled = count > 0
|
|
||||||
if (!root.connection.room(root.selectedSpaceId)) {
|
if (!root.connection.room(root.selectedSpaceId)) {
|
||||||
root.selectedSpaceId = ""
|
root.selectedSpaceId = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component.onCompleted: root.enabled = count > 0
|
|
||||||
|
|
||||||
delegate: AvatarTabButton {
|
delegate: AvatarTabButton {
|
||||||
id: spaceDelegate
|
id: spaceDelegate
|
||||||
@@ -105,6 +122,27 @@ QQC2.Control {
|
|||||||
onContextMenuRequested: root.createContextMenu(currentRoom)
|
onContextMenuRequested: root.createContextMenu(currentRoom)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Kirigami.Separator {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: Kirigami.Units.smallSpacing / 2
|
||||||
|
Layout.bottomMargin: Kirigami.Units.smallSpacing / 2
|
||||||
|
Layout.leftMargin: Kirigami.Units.smallSpacing
|
||||||
|
Layout.rightMargin: Kirigami.Units.smallSpacing
|
||||||
|
}
|
||||||
|
|
||||||
|
AvatarTabButton {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: width - Kirigami.Units.smallSpacing
|
||||||
|
Layout.maximumHeight: width - Kirigami.Units.smallSpacing
|
||||||
|
|
||||||
|
text: i18n("Create a space")
|
||||||
|
contentItem: Kirigami.Icon {
|
||||||
|
source: "list-add"
|
||||||
|
}
|
||||||
|
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {connection: root.connection, isSpace: true, title: i18nc("@title", "Create a Space")}, {title: i18nc("@title", "Create a Space")})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user