Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/FullRepresentation.qml
Show All 28 Lines | |||||
29 | import org.kde.kirigami 2.11 as Kirigami | 29 | import org.kde.kirigami 2.11 as Kirigami | ||
30 | 30 | | |||
31 | import org.kde.kcoreaddons 1.0 as KCoreAddons | 31 | import org.kde.kcoreaddons 1.0 as KCoreAddons | ||
32 | 32 | | |||
33 | import org.kde.notificationmanager 1.0 as NotificationManager | 33 | import org.kde.notificationmanager 1.0 as NotificationManager | ||
34 | 34 | | |||
35 | import "global" | 35 | import "global" | ||
36 | 36 | | |||
37 | ColumnLayout{ | 37 | PlasmaComponents3.Page { | ||
38 | // FIXME fix popup size when resizing panel smaller (so it collapses) | | |||
39 | //Layout.preferredWidth: units.gridUnit * 18 | | |||
40 | //Layout.preferredHeight: units.gridUnit * 24 | | |||
41 | //Layout.minimumWidth: units.gridUnit * 10 | | |||
42 | //Layout.minimumHeight: units.gridUnit * 15 | | |||
43 | Layout.fillHeight: plasmoid.formFactor === PlasmaCore.Types.Vertical | | |||
44 | | ||||
45 | spacing: units.smallSpacing | | |||
46 | | ||||
47 | // TODO these should be configurable in the future | 38 | // TODO these should be configurable in the future | ||
48 | readonly property int dndMorningHour: 6 | 39 | readonly property int dndMorningHour: 6 | ||
49 | readonly property int dndEveningHour: 20 | 40 | readonly property int dndEveningHour: 20 | ||
41 | Layout.fillHeight: plasmoid.formFactor === PlasmaCore.Types.Vertical | ||||
50 | 42 | | |||
51 | // HACK forward focus to the list | 43 | header: PlasmaExtras.PlasmoidHeading { | ||
52 | onActiveFocusChanged: { | | |||
53 | if (activeFocus) { | | |||
54 | list.forceActiveFocus(); | | |||
55 | } | | |||
56 | } | | |||
57 | | ||||
58 | Connections { | | |||
59 | target: plasmoid | | |||
60 | onExpandedChanged: { | | |||
61 | if (plasmoid.expanded) { | | |||
62 | list.positionViewAtBeginning(); | | |||
63 | list.currentIndex = -1; | | |||
64 | } | | |||
65 | } | | |||
66 | } | | |||
67 | | ||||
68 | // header | | |||
69 | ColumnLayout { | 44 | ColumnLayout { | ||
45 | anchors.fill: parent | ||||
70 | id: header | 46 | id: header | ||
71 | visible: !Kirigami.Settings.isMobile | 47 | visible: !Kirigami.Settings.isMobile | ||
72 | Layout.fillWidth: true | 48 | Layout.fillWidth: true | ||
73 | Layout.leftMargin: units.smallSpacing | 49 | Layout.leftMargin: units.smallSpacing | ||
74 | spacing: 0 | 50 | spacing: 0 | ||
75 | 51 | | |||
76 | RowLayout { | 52 | RowLayout { | ||
77 | Layout.fillWidth: true | 53 | Layout.fillWidth: true | ||
▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Line(s) | 230 | if (inhibitedByMirroredScreens) { | |||
255 | sections.push(i18nc("Do not disturb because external mirrored screens connected", "Screens are mirrored")) | 231 | sections.push(i18nc("Do not disturb because external mirrored screens connected", "Screens are mirrored")) | ||
256 | } | 232 | } | ||
257 | 233 | | |||
258 | return sections.join(" · "); | 234 | return sections.join(" · "); | ||
259 | } | 235 | } | ||
260 | visible: text !== "" | 236 | visible: text !== "" | ||
261 | } | 237 | } | ||
262 | } | 238 | } | ||
239 | } | ||||
263 | 240 | | |||
264 | PlasmaCore.SvgItem { | 241 | ColumnLayout{ | ||
265 | visible: header.visible | 242 | // FIXME fix popup size when resizing panel smaller (so it collapses) | ||
266 | elementId: "horizontal-line" | 243 | //Layout.preferredWidth: units.gridUnit * 18 | ||
267 | Layout.fillWidth: true | 244 | //Layout.preferredHeight: units.gridUnit * 24 | ||
268 | // why is this needed here but not in the delegate? | 245 | //Layout.minimumWidth: units.gridUnit * 10 | ||
269 | Layout.preferredHeight: naturalSize.height | 246 | //Layout.minimumHeight: units.gridUnit * 15 | ||
270 | svg: PlasmaCore.Svg { | 247 | anchors.fill: parent | ||
271 | id: lineSvg | 248 | | ||
272 | imagePath: "widgets/line" | 249 | spacing: units.smallSpacing | ||
250 | | ||||
251 | // HACK forward focus to the list | ||||
252 | onActiveFocusChanged: { | ||||
253 | if (activeFocus) { | ||||
254 | list.forceActiveFocus(); | ||||
255 | } | ||||
256 | } | ||||
257 | | ||||
258 | Connections { | ||||
259 | target: plasmoid | ||||
260 | onExpandedChanged: { | ||||
261 | if (plasmoid.expanded) { | ||||
262 | list.positionViewAtBeginning(); | ||||
263 | list.currentIndex = -1; | ||||
264 | } | ||||
273 | } | 265 | } | ||
274 | } | 266 | } | ||
275 | 267 | | |||
276 | // actual notifications | 268 | // actual notifications | ||
277 | PlasmaExtras.ScrollArea { | 269 | PlasmaExtras.ScrollArea { | ||
278 | Layout.fillWidth: true | 270 | Layout.fillWidth: true | ||
279 | Layout.fillHeight: true | 271 | Layout.fillHeight: true | ||
280 | Layout.preferredWidth: units.gridUnit * 18 | 272 | Layout.preferredWidth: units.gridUnit * 18 | ||
▲ Show 20 Lines • Show All 342 Lines • ▼ Show 20 Line(s) | 612 | text: currentOwner ? i18nc("Vendor and product name", | |||
623 | currentOwner.name) | 615 | currentOwner.name) | ||
624 | : "" | 616 | : "" | ||
625 | visible: currentOwner && currentOwner.vendor && currentOwner.name | 617 | visible: currentOwner && currentOwner.vendor && currentOwner.name | ||
626 | } | 618 | } | ||
627 | } | 619 | } | ||
628 | } | 620 | } | ||
629 | } | 621 | } | ||
630 | } | 622 | } | ||
623 | } |