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