Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/Header.qml
Show All 20 Lines | |||||
21 | import QtQuick 2.2 | 21 | import QtQuick 2.2 | ||
22 | import org.kde.plasma.components 2.0 as PlasmaComponents | 22 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
23 | import org.kde.plasma.core 2.0 as PlasmaCore | 23 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
24 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | 24 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | ||
25 | 25 | | |||
26 | PlasmaComponents.ListItem { | 26 | PlasmaComponents.ListItem { | ||
27 | id: header | 27 | id: header | ||
28 | 28 | | |||
29 | property alias text: headerLabel.text | 29 | height: devicesLine.height + units.smallSpacing | ||
30 | separatorVisible: false | ||||
30 | 31 | | |||
31 | height: headerLabel.height + units.gridUnit; width: parent.width | 32 | PlasmaCore.Svg { | ||
32 | sectionDelegate: true | 33 | id: lineSvg | ||
33 | 34 | imagePath: "widgets/line" | |||
34 | PlasmaNM.EnabledConnections { | | |||
35 | id: enabledConnections | | |||
36 | } | 35 | } | ||
37 | 36 | | |||
38 | PlasmaComponents.Label { | 37 | PlasmaCore.SvgItem { | ||
39 | id: headerLabel | 38 | id: devicesLine | ||
40 | | ||||
41 | anchors.centerIn: parent | | |||
42 | height: paintedHeight | | |||
43 | font.weight: Font.DemiBold | | |||
44 | } | | |||
45 | 39 | | |||
46 | Component.onCompleted: { | 40 | anchors { | ||
47 | if (header.text === i18n("Available connections")) { | 41 | horizontalCenter: parent.horizontalCenter | ||
48 | connectionView.availableConnectionsVisible = true | 42 | top: parent.top | ||
43 | topMargin: Math.round(units.smallSpacing / 2) - background.margins.top | ||||
49 | } | 44 | } | ||
45 | elementId: "horizontal-line" | ||||
46 | width: parent.width - units.gridUnit | ||||
47 | svg: lineSvg | ||||
50 | } | 48 | } | ||
51 | 49 | | |||
52 | Component.onDestruction: { | 50 | // Background margins metrics | ||
53 | connectionView.availableConnectionsVisible = false | 51 | PlasmaCore.FrameSvgItem { | ||
54 | } | 52 | id : background | ||
55 | 53 | imagePath: "widgets/listitem" | |||
56 | onVisibleChanged: { | 54 | prefix: "normal" | ||
57 | connectionView.availableConnectionsVisible = visible | 55 | visible: false | ||
58 | } | 56 | } | ||
59 | } | 57 | } |