Changeset View
Standalone View
applets/notifications/package/contents/ui/NotificationItem.qml
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 33 | ColumnLayout { | |||
---|---|---|---|---|---|
113 | 113 | | |||
114 | PlasmaExtras.PlasmoidHeading { | 114 | PlasmaExtras.PlasmoidHeading { | ||
115 | bottomInset: 0 | 115 | bottomInset: 0 | ||
116 | bottomPadding: 0 | 116 | bottomPadding: 0 | ||
117 | Layout.leftMargin: notificationItem.headingLeftPadding | 117 | Layout.leftMargin: notificationItem.headingLeftPadding | ||
118 | Layout.rightMargin: notificationItem.headingRightPadding | 118 | Layout.rightMargin: notificationItem.headingRightPadding | ||
119 | background.visible: !notificationItem.inGroup | 119 | background.visible: !notificationItem.inGroup | ||
120 | 120 | | |||
121 | contentHeight: notificationHeading.implicitHeight | ||||
122 | | ||||
121 | NotificationHeader { | 123 | NotificationHeader { | ||
broulik: Put `id` at the top | |||||
122 | id: notificationHeading | 124 | id: notificationHeading | ||
123 | anchors.fill: parent | 125 | anchors.fill: notificationItem.inGroup ? undefined : parent | ||
126 | Layout.fillWidth: true | ||||
broulik: Please use one of the `State` below for `inGroup` state | |||||
I originally did this but I had a problem. It displays and works just as good, but it will throw a "you are using anchors in layouts" error in the console. Even though I disable the anchors in the propertychanges, it seems like the property is updated after throwing the error. niccolove: I originally did this but I had a problem. It displays and works just as good, but it will… | |||||
broulik: hm, ok | |||||
I moved it in a RowLayout to remove the necessity of checking altogether (otherwise, I should've put anchors.margins AND layout.margins for each case and it would've have been quite ugly imo) niccolove: I moved it in a RowLayout to remove the necessity of checking altogether (otherwise, I… | |||||
When inGroup the height will be zero so you effectively leak the item contents outside? I don't get what this is supposed to do. broulik: When `inGroup` the height will be zero so you effectively leak the item contents outside? I… | |||||
124 | 127 | | |||
broulik: Use `"` | |||||
125 | inGroup: notificationItem.inGroup | 128 | inGroup: notificationItem.inGroup | ||
broulik: This item is pointless since there's only the `NotificationHeader` inside | |||||
broulik: You can group those
```
anchors {
fill: parent
topMargin: ...
...
}
``` | |||||
126 | 129 | | |||
127 | notificationType: notificationItem.notificationType | 130 | notificationType: notificationItem.notificationType | ||
128 | jobState: notificationItem.jobState | 131 | jobState: notificationItem.jobState | ||
129 | jobDetails: notificationItem.jobDetails | 132 | jobDetails: notificationItem.jobDetails | ||
130 | 133 | | |||
131 | onConfigureClicked: notificationItem.configureClicked() | 134 | onConfigureClicked: notificationItem.configureClicked() | ||
132 | onDismissClicked: notificationItem.dismissClicked() | 135 | onDismissClicked: notificationItem.dismissClicked() | ||
133 | onCloseClicked: notificationItem.closeClicked() | 136 | onCloseClicked: notificationItem.closeClicked() | ||
134 | } | 137 | } | ||
138 | | ||||
139 | MouseArea{ | ||||
ngraham: missing space before the curly brace | |||||
broulik: This `MouseArea` should not be necessary and it makes the close button unusable | |||||
Why shouldn't it be necessary? PlasmoidHeading inherits from the Control element, which does not let click events through according to the documentation, so I thought I'd need to catch them on top of it. Regarding the close button unusable, it's due to the order of the elements, I'll fix it immediately niccolove: Why shouldn't it be necessary? PlasmoidHeading inherits from the Control element, which does… | |||||
urgh, really?! Then we can't use it here. I will not accept having two competing MouseAreas doing the same thing. broulik: > inherits from the Control element, which does not let click events through
urgh, really?! | |||||
140 | anchors.fill: parent | ||||
141 | onClicked: notificationItem.bodyClicked(mouse) | ||||
142 | cursorShape: Qt.PointingHandCursor | ||||
143 | } | ||||
135 | } | 144 | } | ||
136 | 145 | | |||
137 | RowLayout { | 146 | RowLayout { | ||
138 | id: defaultHeaderContainer | 147 | id: defaultHeaderContainer | ||
139 | Layout.fillWidth: true | 148 | Layout.fillWidth: true | ||
140 | } | 149 | } | ||
141 | 150 | | |||
142 | // Notification body | 151 | // Notification body | ||
Show All 10 Lines | 161 | RowLayout { | |||
153 | id: summaryRow | 162 | id: summaryRow | ||
154 | Layout.fillWidth: true | 163 | Layout.fillWidth: true | ||
155 | visible: summaryLabel.text !== "" | 164 | visible: summaryLabel.text !== "" | ||
156 | 165 | | |||
157 | PlasmaExtras.Heading { | 166 | PlasmaExtras.Heading { | ||
158 | id: summaryLabel | 167 | id: summaryLabel | ||
159 | Layout.fillWidth: true | 168 | Layout.fillWidth: true | ||
160 | Layout.preferredHeight: implicitHeight | 169 | Layout.preferredHeight: implicitHeight | ||
161 | textFormat: Text.PlainText | 170 | textFormat: Text.PlainText | ||
broulik: Keep it where it was | |||||
162 | maximumLineCount: 3 | 171 | maximumLineCount: 3 | ||
163 | wrapMode: Text.WordWrap | 172 | wrapMode: Text.WordWrap | ||
164 | elide: Text.ElideRight | 173 | elide: Text.ElideRight | ||
165 | level: 4 | 174 | level: 4 | ||
166 | text: { | 175 | text: { | ||
167 | if (notificationItem.notificationType === NotificationManager.Notifications.JobType) { | 176 | if (notificationItem.notificationType === NotificationManager.Notifications.JobType) { | ||
168 | if (notificationItem.jobState === NotificationManager.Notifications.JobStateSuspended) { | 177 | if (notificationItem.jobState === NotificationManager.Notifications.JobStateSuspended) { | ||
169 | if (notificationItem.summary) { | 178 | if (notificationItem.summary) { | ||
▲ Show 20 Lines • Show All 255 Lines • ▼ Show 20 Line(s) | 428 | sourceComponent: ThumbnailStrip { | |||
425 | onOpenUrl: notificationItem.openUrl(url) | 434 | onOpenUrl: notificationItem.openUrl(url) | ||
426 | onFileActionInvoked: notificationItem.fileActionInvoked() | 435 | onFileActionInvoked: notificationItem.fileActionInvoked() | ||
427 | } | 436 | } | ||
428 | } | 437 | } | ||
429 | 438 | | |||
430 | states: [ | 439 | states: [ | ||
431 | State { | 440 | State { | ||
432 | when: notificationItem.inGroup | 441 | when: notificationItem.inGroup | ||
433 | PropertyChanges { | 442 | PropertyChanges { | ||
ngraham: unrelated change | |||||
434 | target: notificationHeading | 443 | target: notificationHeading | ||
435 | parent: summaryRow | 444 | parent: summaryRow | ||
436 | } | 445 | } | ||
437 | 446 | | |||
438 | PropertyChanges { | 447 | PropertyChanges { | ||
439 | target: summaryRow | 448 | target: summaryRow | ||
440 | visible: true | 449 | visible: true | ||
441 | } | 450 | } | ||
Show All 17 Lines |
Put id at the top