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
5 changes: 5 additions & 0 deletions panels/notification/center/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

set_source_files_properties(NotifyStyle.qml PROPERTIES
QT_QML_SINGLETON_TYPE TRUE
)

qt_add_qml_module(notificationcenterpanel
PLUGIN_TARGET notificationcenterpanelplugin
URI org.deepin.ds.notificationcenter
VERSION 1.0
QML_FILES
NotifyCenter.qml
NotifyStyle.qml
NotifyStaging.qml
NotifyHeader.qml
NotifyView.qml
Expand Down
2 changes: 1 addition & 1 deletion panels/notification/center/NormalNotify.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ NotifyItem {
}

contentItem: NotifyItemContent {

width: parent.width
appName: root.appName
iconName: root.iconName
content: root.content
Expand Down
19 changes: 16 additions & 3 deletions panels/notification/center/NotifyItemContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import org.deepin.dtk 1.0
import org.deepin.dtk.style 1.0 as DStyle
import org.deepin.ds.notificationcenter

NotifyItem {
id: root

implicitHeight:Math.max(DStyle.Style.control.implicitHeight(root),
actionPlaceHolder.active ? root.miniContentHeight + actionPlaceHolder.height : 0)
property bool closeVisible: root.hovered || root.activeFocus
property int miniContentHeight: NotifyStyle.contentItem.miniHeight

// placeHolder to receive MouseEvent
Control {
id: closePlaceHolder
Expand Down Expand Up @@ -111,6 +116,12 @@ NotifyItem {

contentItem: RowLayout {
spacing: 0
Binding {
target: root
property: "miniContentHeight"
value: 26 + NotifyStyle.contentItem.topMargin + NotifyStyle.contentItem.bottomMargin
}

DciIcon {
name: root.iconName
sourceSize: Qt.size(24, 24)
Expand All @@ -127,13 +138,14 @@ NotifyItem {
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.rightMargin: 10
Layout.leftMargin: 10
Layout.topMargin: 4
Layout.bottomMargin: 8
Layout.topMargin: NotifyStyle.contentItem.topMargin
Layout.bottomMargin: NotifyStyle.contentItem.bottomMargin
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumHeight: 40
Layout.minimumHeight: NotifyStyle.contentItem.miniHeight
Layout.maximumHeight: 240
RowLayout {
id: firstLine
spacing: 0
Layout.fillWidth: true
Layout.preferredHeight: 24
Expand Down Expand Up @@ -213,6 +225,7 @@ NotifyItem {
Layout.minimumHeight: 16
Layout.alignment: Qt.AlignRight
active: root.contentIcon !== ""
visible: active
// TODO DciIcon's bounding can't be limit by maximumWidth.
sourceComponent: Image {
anchors.fill: parent
Expand Down
16 changes: 16 additions & 0 deletions panels/notification/center/NotifyStyle.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

import QtQuick
pragma Singleton

QtObject {
id: root

property QtObject contentItem: QtObject {
property int topMargin: 4
property int bottomMargin: 8
property int miniHeight: 40
}
}
Loading