Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/Toolbar.qml
| Show All 20 Lines | |||||
| 21 | import QtQuick 2.2 | 21 | import QtQuick 2.2 | ||
| 22 | import QtQuick.Layouts 1.2 | 22 | import QtQuick.Layouts 1.2 | ||
| 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
| 24 | import org.kde.plasma.components 3.0 as PlasmaComponents3 | 24 | import org.kde.plasma.components 3.0 as PlasmaComponents3 | ||
| 25 | import org.kde.plasma.core 2.0 as PlasmaCore | 25 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
| 26 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | 26 | import org.kde.plasma.networkmanagement 0.2 as PlasmaNM | ||
| 27 | import org.kde.kquickcontrolsaddons 2.0 | 27 | import org.kde.kquickcontrolsaddons 2.0 | ||
| 28 | 28 | | |||
| 29 | GridLayout { | 29 | ColumnLayout { | ||
| 30 | id: toolbar | 30 | id: toolbar | ||
| 31 | spacing: units.smallSpacing | ||||
| 31 | 32 | | |||
| 32 | readonly property var displayWifiMessage: !wifiSwitchButton.checked && wifiSwitchButton.visible | 33 | readonly property var displayWifiMessage: !wifiSwitchButton.checked && wifiSwitchButton.visible | ||
| 33 | readonly property var displayWwanMessage: !wwanSwitchButton.checked && wwanSwitchButton.visible | 34 | readonly property var displayWwanMessage: !wwanSwitchButton.checked && wwanSwitchButton.visible | ||
| 34 | readonly property var displayplaneModeMessage: planeModeSwitchButton.checked && planeModeSwitchButton.visible | 35 | readonly property var displayplaneModeMessage: planeModeSwitchButton.checked && planeModeSwitchButton.visible | ||
| 35 | 36 | | |||
| 36 | function closeSearch() { | 37 | function closeSearch() { | ||
| 37 | searchToggleButton.checked = false | 38 | searchToggleButton.checked = false | ||
| 38 | } | 39 | } | ||
| 39 | 40 | | |||
| 40 | rows: 2 | | |||
| 41 | columns: 2 | | |||
| 42 | | ||||
| 43 | PlasmaCore.Svg { | 41 | PlasmaCore.Svg { | ||
| 44 | id: lineSvg | 42 | id: lineSvg | ||
| 45 | imagePath: "widgets/line" | 43 | imagePath: "widgets/line" | ||
| 46 | } | 44 | } | ||
| 47 | 45 | | |||
| 48 | PlasmaNM.EnabledConnections { | 46 | PlasmaNM.EnabledConnections { | ||
| 49 | id: enabledConnections | 47 | id: enabledConnections | ||
| 50 | 48 | | |||
| Show All 13 Lines | 61 | onWwanHwEnabledChanged: { | |||
| 64 | wwanSwitchButton.enabled = enabled && availableDevices.modemDeviceAvailable && !planeModeSwitchButton.airplaneModeEnabled | 62 | wwanSwitchButton.enabled = enabled && availableDevices.modemDeviceAvailable && !planeModeSwitchButton.airplaneModeEnabled | ||
| 65 | } | 63 | } | ||
| 66 | } | 64 | } | ||
| 67 | 65 | | |||
| 68 | PlasmaNM.Configuration { | 66 | PlasmaNM.Configuration { | ||
| 69 | id: configuration | 67 | id: configuration | ||
| 70 | } | 68 | } | ||
| 71 | 69 | | |||
| 72 | Row { | 70 | RowLayout { | ||
| 73 | Layout.fillWidth: true | 71 | spacing: units.smallSpacing | ||
| 74 | 72 | | |||
| 75 | SwitchButton { | 73 | SwitchButton { | ||
| 76 | id: wifiSwitchButton | 74 | id: wifiSwitchButton | ||
| 77 | 75 | | |||
| 78 | checked: enabled && enabledConnections.wirelessEnabled | 76 | checked: enabled && enabledConnections.wirelessEnabled | ||
| 79 | enabled: enabledConnections.wirelessHwEnabled && availableDevices.wirelessDeviceAvailable && !planeModeSwitchButton.airplaneModeEnabled | 77 | enabled: enabledConnections.wirelessHwEnabled && availableDevices.wirelessDeviceAvailable && !planeModeSwitchButton.airplaneModeEnabled | ||
| 80 | tooltip: i18n("Enable wireless") | 78 | tooltip: i18n("Enable wireless") | ||
| 81 | icon: enabled ? "network-wireless-on" : "network-wireless-off" | 79 | icon: enabled ? "network-wireless-on" : "network-wireless-off" | ||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 117 | Binding { | |||
| 123 | when: planeModeSwitchButton.initialized | 121 | when: planeModeSwitchButton.initialized | ||
| 124 | } | 122 | } | ||
| 125 | 123 | | |||
| 126 | Component.onCompleted: { | 124 | Component.onCompleted: { | ||
| 127 | airplaneModeEnabled = configuration.airplaneModeEnabled | 125 | airplaneModeEnabled = configuration.airplaneModeEnabled | ||
| 128 | initialized = true | 126 | initialized = true | ||
| 129 | } | 127 | } | ||
| 130 | } | 128 | } | ||
| 131 | } | | |||
| 132 | | ||||
| 133 | Row { | | |||
| 134 | Layout.column: 1 | | |||
| 135 | 129 | | |||
| 130 | Item { | ||||
| 131 | Layout.fillWidth: true | ||||
| 132 | } | ||||
| 136 | 133 | | |||
| 137 | PlasmaComponents3.ToolButton { | 134 | PlasmaComponents3.ToolButton { | ||
| 138 | id: hotspotButton | 135 | id: hotspotButton | ||
| 139 | 136 | | |||
| 140 | icon { | 137 | icon { | ||
| 141 | height: units.iconSizes.small | 138 | height: units.iconSizes.small | ||
| 142 | width: units.iconSizes.small | 139 | width: units.iconSizes.small | ||
| 143 | name: "network-wireless-on" | 140 | name: "network-wireless-on" | ||
| ▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 193 | PlasmaComponents3.ToolButton { | |||
| 207 | } | 204 | } | ||
| 208 | 205 | | |||
| 209 | onClicked: { | 206 | onClicked: { | ||
| 210 | KCMShell.open(mainWindow.kcm) | 207 | KCMShell.open(mainWindow.kcm) | ||
| 211 | } | 208 | } | ||
| 212 | } | 209 | } | ||
| 213 | } | 210 | } | ||
| 214 | 211 | | |||
| 212 | PlasmaCore.SvgItem { | ||||
| 213 | Layout.fillWidth: true | ||||
| 214 | elementId: "horizontal-line" | ||||
| 215 | Layout.leftMargin: - units.smallSpacing * 1.5 | ||||
| 216 | Layout.rightMargin: - units.smallSpacing * 1.5 | ||||
| 217 | svg: lineSvg | ||||
| 218 | } | ||||
| 219 | | ||||
| 215 | PlasmaComponents.TextField { | 220 | PlasmaComponents.TextField { | ||
| 216 | id: searchTextField | 221 | id: searchTextField | ||
| 217 | 222 | | |||
| 218 | Layout.row: 1 | | |||
| 219 | Layout.columnSpan: 2 | | |||
| 220 | Layout.fillWidth: true | 223 | Layout.fillWidth: true | ||
| 221 | Layout.leftMargin: units.smallSpacing | 224 | Layout.leftMargin: units.smallSpacing | ||
| 222 | Layout.rightMargin: units.smallSpacing | 225 | Layout.rightMargin: units.smallSpacing | ||
| 226 | Layout.topMargin: units.smallSpacing | ||||
| 223 | Layout.bottomMargin: units.smallSpacing | 227 | Layout.bottomMargin: units.smallSpacing | ||
| 224 | 228 | | |||
| 225 | focus: true | 229 | focus: true | ||
| 226 | clearButtonShown: true | 230 | clearButtonShown: true | ||
| 227 | placeholderText: i18ndc("plasma-nm", "text field placeholder text", "Search...") | 231 | placeholderText: i18ndc("plasma-nm", "text field placeholder text", "Search...") | ||
| 228 | 232 | | |||
| 229 | visible: searchToggleButton.checked | 233 | visible: searchToggleButton.checked | ||
| 230 | onVisibleChanged: { | 234 | onVisibleChanged: { | ||
| Show All 24 Lines | |||||