Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/kdeconnect/kdeconnectplugin_config.qml
Show All 9 Lines | |||||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | Lesser General Public License for more details. | 12 | Lesser General Public License for more details. | ||
13 | 13 | | |||
14 | You should have received a copy of the GNU Lesser General Public | 14 | You should have received a copy of the GNU Lesser General Public | ||
15 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 15 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | import QtQuick 2.1 | 18 | import QtQuick 2.7 | ||
19 | import QtQuick.Layouts 1.1 | 19 | import QtQuick.Layouts 1.1 | ||
20 | import QtQuick.Controls 2.1 | 20 | import QtQuick.Controls 2.5 | ||
21 | import org.kde.kirigami 2.5 as Kirigami | ||||
21 | import org.kde.kdeconnect 1.0 | 22 | import org.kde.kdeconnect 1.0 | ||
22 | 23 | | |||
23 | ListView { | 24 | ColumnLayout { | ||
25 | | ||||
24 | id: root | 26 | id: root | ||
25 | property string device: "" | 27 | property string device: "" | ||
26 | Layout.fillWidth: true | | |||
27 | Layout.fillHeight: true | | |||
28 | 28 | | |||
29 | header: Label { | 29 | anchors.fill: parent | ||
apol: Use icon.name. | |||||
iconName comes from the DeviceModel. We just expose the name, not the actual ico from KDE Connect nicolasfella: iconName comes from the DeviceModel. We just expose the name, not the actual ico from KDE… | |||||
30 | anchors.bottomMargin: Kirigami.Units.smallSpacing | ||||
31 | | ||||
32 | Kirigami.Heading { | ||||
30 | text: i18nd("purpose_kdeconnect","Choose a device to send to:") | 33 | text: i18nd("purpose_kdeconnect", "Choose a device to send to:") | ||
34 | visible: root.count !== 0 | ||||
35 | level: 1 | ||||
31 | } | 36 | } | ||
37 | | ||||
38 | ScrollView { | ||||
39 | id: scroll | ||||
40 | | ||||
41 | Layout.fillWidth: true | ||||
42 | Layout.fillHeight: true | ||||
43 | | ||||
44 | Component.onCompleted: scroll.background.visible = true | ||||
45 | | ||||
46 | ListView { | ||||
47 | Layout.fillWidth: true | ||||
48 | Layout.fillHeight: true | ||||
49 | | ||||
32 | model: DevicesModel { | 50 | model: DevicesModel { | ||
33 | id: connectDeviceModel | 51 | id: connectDeviceModel | ||
34 | displayFilter: DevicesModel.Paired | DevicesModel.Reachable | 52 | displayFilter: DevicesModel.Paired | DevicesModel.Reachable | ||
35 | } | 53 | } | ||
36 | delegate: ItemDelegate { | 54 | | ||
55 | delegate: Kirigami.BasicListItem { | ||||
37 | width: parent.width | 56 | width: parent.width | ||
38 | text: model.display | 57 | text: model.display | ||
58 | icon: model.iconName | ||||
39 | onClicked: root.device = deviceId | 59 | onClicked: root.device = deviceId | ||
40 | checked: root.device === deviceId | 60 | checked: root.device === deviceId | ||
41 | highlighted: root.device === deviceId | 61 | highlighted: root.device === deviceId | ||
42 | } | 62 | } | ||
43 | 63 | | |||
44 | Label { | 64 | Label { | ||
45 | anchors.fill: parent | 65 | anchors.fill: parent | ||
46 | verticalAlignment: Qt.AlignVCenter | 66 | verticalAlignment: Qt.AlignVCenter | ||
47 | horizontalAlignment: Qt.AlignHCenter | 67 | horizontalAlignment: Qt.AlignHCenter | ||
48 | visible: root.count === 0 | 68 | visible: root.count === 0 | ||
49 | text: i18nd("purpose_kdeconnect","No devices found") | 69 | text: i18nd("purpose_kdeconnect","No devices found") | ||
50 | } | 70 | } | ||
51 | } | 71 | } | ||
72 | } | ||||
73 | } |
Use icon.name.