Changeset View
Standalone View
applets/notifications/package/contents/ui/NotificationItem.qml
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | 33 | ColumnLayout { | |||
---|---|---|---|---|---|
106 | signal fileActionInvoked | 106 | signal fileActionInvoked | ||
107 | 107 | | |||
108 | signal suspendJobClicked | 108 | signal suspendJobClicked | ||
109 | signal resumeJobClicked | 109 | signal resumeJobClicked | ||
110 | signal killJobClicked | 110 | signal killJobClicked | ||
111 | 111 | | |||
112 | spacing: 0 | 112 | spacing: 0 | ||
113 | 113 | | |||
114 | PlasmaExtras.PlasmoidHeading { | 114 | Item { | ||
115 | bottomInset: 0 | 115 | id: headingElement | ||
116 | bottomPadding: 0 | 116 | Layout.fillWidth: true | ||
117 | Layout.leftMargin: notificationItem.headingLeftPadding | 117 | Layout.preferredHeight: notificationHeading.implicitHeight | ||
118 | Layout.rightMargin: notificationItem.headingRightPadding | 118 | Layout.preferredWidth: notificationHeading.implicitWidth | ||
broulik: Put `id` at the top | |||||
119 | background.visible: !notificationItem.inGroup | 119 | | ||
120 | PlasmaCore.FrameSvgItem { | ||||
121 | imagePath: "widgets/plasmoidheading" | ||||
122 | prefix: "header" | ||||
broulik: Use `"` | |||||
123 | anchors { | ||||
broulik: You can group those
```
anchors {
fill: parent
topMargin: ...
...
}
``` | |||||
124 | fill: parent | ||||
125 | topMargin: -margins.top | ||||
126 | leftMargin: -margins.left | ||||
127 | rightMargin: -margins.right | ||||
128 | } | ||||
129 | visible: !notificationItem.inGroup && fromCurrentTheme | ||||
130 | } | ||||
120 | 131 | | |||
121 | NotificationHeader { | 132 | NotificationHeader { | ||
122 | id: notificationHeading | 133 | id: notificationHeading | ||
123 | anchors.fill: parent | 134 | anchors { | ||
135 | fill: parent | ||||
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… | |||||
136 | leftMargin: notificationItem.headingLeftPadding | ||||
137 | rightMargin: notificationItem.headingRightPadding | ||||
138 | } | ||||
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… | |||||
124 | 139 | | |||
125 | inGroup: notificationItem.inGroup | 140 | inGroup: notificationItem.inGroup | ||
broulik: This item is pointless since there's only the `NotificationHeader` inside | |||||
126 | 141 | | |||
127 | notificationType: notificationItem.notificationType | 142 | notificationType: notificationItem.notificationType | ||
128 | jobState: notificationItem.jobState | 143 | jobState: notificationItem.jobState | ||
129 | jobDetails: notificationItem.jobDetails | 144 | jobDetails: notificationItem.jobDetails | ||
130 | 145 | | |||
131 | onConfigureClicked: notificationItem.configureClicked() | 146 | onConfigureClicked: notificationItem.configureClicked() | ||
132 | onDismissClicked: notificationItem.dismissClicked() | 147 | onDismissClicked: notificationItem.dismissClicked() | ||
133 | onCloseClicked: notificationItem.closeClicked() | 148 | onCloseClicked: notificationItem.closeClicked() | ||
134 | } | 149 | } | ||
135 | } | 150 | } | ||
136 | 151 | | |||
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?! | |||||
137 | RowLayout { | 152 | RowLayout { | ||
138 | id: defaultHeaderContainer | 153 | id: defaultHeaderContainer | ||
139 | Layout.fillWidth: true | 154 | Layout.fillWidth: true | ||
140 | } | 155 | } | ||
141 | 156 | | |||
142 | // Notification body | 157 | // Notification body | ||
143 | RowLayout { | 158 | RowLayout { | ||
144 | id: bodyRow | 159 | id: bodyRow | ||
145 | Layout.fillWidth: true | 160 | Layout.fillWidth: true | ||
146 | spacing: units.smallSpacing | 161 | spacing: units.smallSpacing | ||
147 | 162 | | |||
148 | ColumnLayout { | 163 | ColumnLayout { | ||
149 | Layout.fillWidth: true | 164 | Layout.fillWidth: true | ||
150 | spacing: 0 | 165 | spacing: 0 | ||
151 | 166 | | |||
152 | RowLayout { | 167 | RowLayout { | ||
153 | id: summaryRow | 168 | id: summaryRow | ||
154 | Layout.fillWidth: true | 169 | Layout.fillWidth: true | ||
155 | visible: summaryLabel.text !== "" | 170 | visible: summaryLabel.text !== "" | ||
156 | 171 | | |||
157 | PlasmaExtras.Heading { | 172 | PlasmaExtras.Heading { | ||
158 | id: summaryLabel | 173 | id: summaryLabel | ||
159 | Layout.fillWidth: true | 174 | Layout.fillWidth: true | ||
160 | Layout.preferredHeight: implicitHeight | 175 | Layout.preferredHeight: implicitHeight | ||
161 | textFormat: Text.PlainText | 176 | textFormat: Text.PlainText | ||
broulik: Keep it where it was | |||||
162 | maximumLineCount: 3 | 177 | maximumLineCount: 3 | ||
163 | wrapMode: Text.WordWrap | 178 | wrapMode: Text.WordWrap | ||
164 | elide: Text.ElideRight | 179 | elide: Text.ElideRight | ||
165 | level: 4 | 180 | level: 4 | ||
166 | text: { | 181 | text: { | ||
167 | if (notificationItem.notificationType === NotificationManager.Notifications.JobType) { | 182 | if (notificationItem.notificationType === NotificationManager.Notifications.JobType) { | ||
168 | if (notificationItem.jobState === NotificationManager.Notifications.JobStateSuspended) { | 183 | if (notificationItem.jobState === NotificationManager.Notifications.JobStateSuspended) { | ||
169 | if (notificationItem.summary) { | 184 | if (notificationItem.summary) { | ||
▲ Show 20 Lines • Show All 255 Lines • ▼ Show 20 Line(s) | 434 | sourceComponent: ThumbnailStrip { | |||
425 | onOpenUrl: notificationItem.openUrl(url) | 440 | onOpenUrl: notificationItem.openUrl(url) | ||
426 | onFileActionInvoked: notificationItem.fileActionInvoked() | 441 | onFileActionInvoked: notificationItem.fileActionInvoked() | ||
427 | } | 442 | } | ||
428 | } | 443 | } | ||
429 | 444 | | |||
430 | states: [ | 445 | states: [ | ||
431 | State { | 446 | State { | ||
432 | when: notificationItem.inGroup | 447 | when: notificationItem.inGroup | ||
433 | PropertyChanges { | 448 | PropertyChanges { | ||
ngraham: unrelated change | |||||
434 | target: notificationHeading | 449 | target: headingElement | ||
435 | parent: summaryRow | 450 | parent: summaryRow | ||
436 | } | 451 | } | ||
437 | 452 | | |||
438 | PropertyChanges { | 453 | PropertyChanges { | ||
439 | target: summaryRow | 454 | target: summaryRow | ||
440 | visible: true | 455 | visible: true | ||
441 | } | 456 | } | ||
442 | PropertyChanges { | 457 | PropertyChanges { | ||
Show All 16 Lines |
Put id at the top