feat(notification): add scrollbar

pull/39/head
kate 5 years ago
parent 5290885d1c
commit ecd35df91a

@ -35,7 +35,7 @@ Item {
id: _background
anchors.fill: parent
color: FishUI.Theme.secondBackgroundColor
radius: NotificationDialog.width * 0.05 //FishUI.Theme.bigRadius
radius: NotificationDialog.width * 0.05
opacity: 0.7
border.width: 1 / FishUI.Units.devicePixelRatio
@ -94,10 +94,14 @@ Item {
ColumnLayout {
anchors.fill: parent
anchors.margins: FishUI.Units.largeSpacing
anchors.topMargin: FishUI.Units.largeSpacing
anchors.bottomMargin: FishUI.Units.largeSpacing
spacing: FishUI.Units.largeSpacing
RowLayout {
Layout.leftMargin: FishUI.Units.largeSpacing
Layout.rightMargin: FishUI.Units.largeSpacing
Label {
text: qsTr("Notification Center")
Layout.fillWidth: true
@ -141,6 +145,11 @@ Item {
highlightFollowsCurrentItem: true
clip: true
leftMargin: FishUI.Units.largeSpacing
rightMargin: FishUI.Units.largeSpacing
ScrollBar.vertical: ScrollBar {}
Label {
anchors.centerIn: parent
text: qsTr("No notifications")
@ -154,7 +163,7 @@ Item {
}
delegate: Item {
width: ListView.view.width
width: ListView.view.width - ListView.view.leftMargin - ListView.view.rightMargin
height: 70
Rectangle {
@ -175,7 +184,9 @@ Item {
RowLayout {
anchors.fill: parent
anchors.margins: FishUI.Units.smallSpacing
anchors.margins: FishUI.Units.largeSpacing
anchors.leftMargin: FishUI.Units.smallSpacing * 1.5
anchors.rightMargin: FishUI.Units.smallSpacing * 1.5
spacing: FishUI.Units.smallSpacing
Image {

@ -22,7 +22,7 @@ Item {
property int popupEdgeDistance: FishUI.Units.largeSpacing
property int popupSpacing: FishUI.Units.largeSpacing
readonly property real popupMaximumScreenFill: 0.8
readonly property real popupMaximumScreenFill: 0.4
readonly property rect screenRect: {
let rect = Qt.rect(screen.screenGeometry.x + screen.availableScreenRect.x,
@ -77,7 +77,7 @@ Item {
y += popup.height + (popup.height > 0 ? popupSpacing : 0)
// Horizontal
popup.x = screenRect.x + (screenRect.width - popup.width) / 2
// popup.x = screenRect.x + (screenRect.width - popup.width) / 2
// don't let notifications take more than popupMaximumScreenFill of the screen
var visible = true

Loading…
Cancel
Save