Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 39 additions & 32 deletions panels/notification/center/GroupNotify.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,52 @@ import org.deepin.ds.notificationcenter

NotifyItem {
id: root
implicitWidth: impl.implicitWidth
implicitHeight: impl.implicitHeight

signal collapse()

contentItem: RowLayout {
NotifyHeaderTitleText {
text: root.appName
Layout.alignment: Qt.AlignLeft
Layout.leftMargin: 18
tFont: DTK.fontManager.t5
}
Control {
id: impl
anchors.fill: parent

Item {
Layout.fillWidth: true
Layout.preferredHeight: 1
}
contentItem: RowLayout {
NotifyHeaderTitleText {
text: root.appName
Layout.alignment: Qt.AlignLeft
Layout.leftMargin: 18
tFont: DTK.fontManager.t5
}

SettingActionButton {
Layout.alignment: Qt.AlignRight
icon.name: "fold"
onClicked: {
console.log("collapse")
root.collapse()
Item {
Layout.fillWidth: true
Layout.preferredHeight: 1
}
}
SettingActionButton {
Layout.alignment: Qt.AlignRight
icon.name: "more"
onClicked: function () {
console.log("group setting", appName)
let pos = mapToItem(root, Qt.point(width / 2, height))
root.setting(pos)

SettingActionButton {
Layout.alignment: Qt.AlignRight
icon.name: "fold"
onClicked: {
console.log("collapse")
root.collapse()
}
}
}
AnimationSettingButton {
Layout.alignment: Qt.AlignRight
icon.name: "clean-group"
text: qsTr("Clear All")
onClicked: function () {
root.remove()
SettingActionButton {
Layout.alignment: Qt.AlignRight
icon.name: "more"
onClicked: function () {
console.log("group setting", root.appName)
let pos = mapToItem(root, Qt.point(width / 2, height))
root.setting(pos)
}
}
AnimationSettingButton {
Layout.alignment: Qt.AlignRight
icon.name: "clean-group"
text: qsTr("Clear All")
onClicked: function () {
root.remove()
}
}
}
}
Expand Down
57 changes: 32 additions & 25 deletions panels/notification/center/NormalNotify.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import org.deepin.ds.notificationcenter

NotifyItem {
id: root
implicitWidth: impl.implicitWidth
implicitHeight: impl.implicitHeight

property var removedCallback

Expand All @@ -35,34 +37,39 @@ NotifyItem {
}
}

contentItem: NotifyItemContent {
width: parent.width
appName: root.appName
iconName: root.iconName
content: root.content
title: root.title
date: root.date
actions: root.actions
defaultAction: root.defaultAction
closeVisible: root.hovered || root.activeFocus
strongInteractive: root.strongInteractive
contentIcon: root.contentIcon
contentRowCount: root.contentRowCount
Control {
id: impl
anchors.fill: parent

onRemove: function () {
root.removedCallback = function () {
root.remove()
contentItem: NotifyItemContent {
width: parent.width
appName: root.appName
iconName: root.iconName
content: root.content
title: root.title
date: root.date
actions: root.actions
defaultAction: root.defaultAction
closeVisible: impl.hovered || root.activeFocus
strongInteractive: root.strongInteractive
contentIcon: root.contentIcon
contentRowCount: root.contentRowCount

onRemove: function () {
root.removedCallback = function () {
root.remove()
}
root.state = "removing"
}
root.state = "removing"
}
onDismiss: function () {
root.removedCallback = function () {
root.dismiss()
onDismiss: function () {
root.removedCallback = function () {
root.dismiss()
}
root.state = "removing"
}
onActionInvoked: function (actionId) {
root.actionInvoked(actionId)
}
root.state = "removing"
}
onActionInvoked: function (actionId) {
root.actionInvoked(actionId)
}
}
}
2 changes: 1 addition & 1 deletion panels/notification/center/NotifyViewDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ DelegateChooser {
active: overlapNotify.activeFocus && NotifyAccessor.debugging

sourceComponent: FocusBoxBorder {
radius: overlapNotify.radius
radius: overlapNotify.overlapItemRadius
color: overlapNotify.palette.highlight
}
}
Expand Down
103 changes: 55 additions & 48 deletions panels/notification/center/OverlapNotify.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import org.deepin.ds.notificationcenter

NotifyItem {
id: root
implicitWidth: impl.implicitWidth
implicitHeight: impl.implicitHeight

property int count: 1
readonly property int overlapItemRadius: 12
Expand Down Expand Up @@ -40,62 +42,67 @@ NotifyItem {
}
}

contentItem: Item {
width: parent.width
implicitHeight: notifyContent.height + indicator.height
NotifyItemContent {
id: notifyContent
Control {
id: impl
anchors.fill: parent

contentItem: Item {
width: parent.width
appName: root.appName
iconName: root.iconName
content: root.content
title: root.title
date: root.date
actions: root.actions
defaultAction: root.defaultAction
closeVisible: root.hovered || root.activeFocus
strongInteractive: root.strongInteractive
contentIcon: root.contentIcon
contentRowCount: root.contentRowCount
enableDismissed: root.enableDismissed
implicitHeight: notifyContent.height + indicator.height
NotifyItemContent {
id: notifyContent
width: parent.width
appName: root.appName
iconName: root.iconName
content: root.content
title: root.title
date: root.date
actions: root.actions
defaultAction: root.defaultAction
closeVisible: impl.hovered || root.activeFocus
strongInteractive: root.strongInteractive
contentIcon: root.contentIcon
contentRowCount: root.contentRowCount
enableDismissed: root.enableDismissed

onRemove: function () {
root.removedCallback = function () {
root.remove()
onRemove: function () {
root.removedCallback = function () {
root.remove()
}
root.state = "removing"
}
root.state = "removing"
}
onDismiss: function () {
root.removedCallback = function () {
root.dismiss()
onDismiss: function () {
root.removedCallback = function () {
root.dismiss()
}
root.state = "removing"
}
onActionInvoked: function (actionId) {
root.actionInvoked(actionId)
}
root.state = "removing"
}
onActionInvoked: function (actionId) {
root.actionInvoked(actionId)
}
}

OverlapIndicator {
id: indicator
anchors {
bottom: parent.bottom
left: parent.left
leftMargin: overlapItemRadius
right: parent.right
rightMargin: overlapItemRadius
OverlapIndicator {
id: indicator
anchors {
bottom: parent.bottom
left: parent.left
leftMargin: overlapItemRadius
right: parent.right
rightMargin: overlapItemRadius
}
z: -1
count: root.count
}
z: -1
count: root.count
}
}

// expand
TapHandler {
enabled: !root.enableDismissed
acceptedButtons: Qt.LeftButton
onTapped: root.expand()
// expand
TapHandler {
enabled: !root.enableDismissed
acceptedButtons: Qt.LeftButton
onTapped: root.expand()
}
Keys.onEnterPressed: root.expand()
Keys.onReturnPressed: root.expand()
}
Keys.onEnterPressed: root.expand()
Keys.onReturnPressed: root.expand()
}
2 changes: 1 addition & 1 deletion panels/notification/plugin/NotifyItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import QtQuick.Layouts
import org.deepin.dtk 1.0
import org.deepin.ds.notification

Control {
FocusScope {
id: root

enum CloseReason {
Expand Down
Loading