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: 3 additions & 2 deletions panels/notification/center/NotifyCenter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import org.deepin.dtk 1.0
import org.deepin.dtk.style 1.0 as DS
import org.deepin.ds.notification
import org.deepin.ds.notificationcenter

Expand All @@ -32,7 +33,7 @@ FocusScope {
left: parent.left
}
height: 40
width: parent.width
width: NotifyStyle.contentItem.width
notifyModel: notifyModel
z: 1
}
Expand All @@ -46,7 +47,7 @@ FocusScope {
bottom: parent.bottom
}

width: parent.width
width: NotifyStyle.contentItem.width + DS.Style.scrollBar.padding + DS.Style.scrollBar.width + NotifyStyle.scrollBarPadding
height: Math.min(maxViewHeight, viewHeight)
notifyModel: notifyModel
}
Expand Down
6 changes: 3 additions & 3 deletions panels/notification/center/NotifyViewDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DelegateChooser {
GroupNotify {
id: groupNotify
objectName: "group-" + model.appName
width: 360
width: NotifyStyle.contentItem.width
appName: model.appName
activeFocusOnTab: true

Expand Down Expand Up @@ -61,7 +61,7 @@ DelegateChooser {
NormalNotify {
id: normalNotify
objectName: "normal-" + model.appName
width: 360
width: NotifyStyle.contentItem.width
activeFocusOnTab: true

appName: model.appName
Expand Down Expand Up @@ -120,7 +120,7 @@ DelegateChooser {
OverlapNotify {
id: overlapNotify
objectName: "overlap-" + model.appName
width: 360
width: NotifyStyle.contentItem.width
activeFocusOnTab: true

count: model.overlapCount
Expand Down
13 changes: 8 additions & 5 deletions panels/notification/center/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import QtQuick.Controls
import QtQuick.Layouts
import org.deepin.dtk 1.0
import org.deepin.ds 1.0
import org.deepin.ds.notification
import org.deepin.ds.notificationcenter

Window {
Expand All @@ -33,7 +34,8 @@ Window {
visible: Panel.visible
flags: Qt.Tool

width: 360 + view.anchors.leftMargin + view.anchors.rightMargin
property int contentPadding: 20
width: NotifyStyle.contentItem.width + contentPadding * 2
// height: 800
DLayerShellWindow.layer: DLayerShellWindow.LayerOverlay
DLayerShellWindow.anchors: DLayerShellWindow.AnchorRight | DLayerShellWindow.AnchorTop | DLayerShellWindow.AnchorBottom
Expand Down Expand Up @@ -80,13 +82,13 @@ Window {

Item {
id: view
width: parent.width
// clear focus when NotificationCenter is closed.
focus: root.visible
anchors {
top: parent.top
left: parent.left
margins: 20
leftMargin: contentPadding
right: parent.right
bottom: parent.bottom
}

Expand All @@ -95,8 +97,9 @@ Window {
anchors {
top: parent.top
left: parent.left
right: parent.right
rightMargin: contentPadding
}
implicitWidth: 360
Connections {
target: Panel
function onVisibleChanged() {
Expand All @@ -114,6 +117,7 @@ Window {
anchors {
top: notifyStaging.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}

Expand All @@ -128,7 +132,6 @@ Window {
}
}

implicitWidth: 360
maxViewHeight: root.height
stagingViewCount: notifyStaging.viewCount
}
Expand Down
2 changes: 2 additions & 0 deletions panels/notification/plugin/NotifyStyle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ QtObject {
property int topMargin: 4
property int bottomMargin: 8
property int miniHeight: 40
property int width: 360
}
property int scrollBarPadding: 2
}