Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/bluetooth/bluetoothplugin_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 | 22 | | |||
22 | import org.kde.bluezqt 1.0 as BluezQt | 23 | import org.kde.bluezqt 1.0 as BluezQt | ||
23 | 24 | | |||
24 | ListView { | 25 | ColumnLayout { | ||
26 | | ||||
25 | id: root | 27 | id: root | ||
26 | property string device: "" | 28 | property string device: "" | ||
27 | Layout.fillWidth: true | | |||
28 | Layout.fillHeight: true | | |||
29 | 29 | | |||
30 | header: Label { | 30 | anchors.fill: parent | ||
31 | anchors.bottomMargin: Kirigami.Units.smallSpacing | ||||
32 | | ||||
33 | Kirigami.Heading { | ||||
31 | text: i18n("Choose a device to send to:") | 34 | text: i18n("Choose a device to send to:") | ||
32 | visible: root.count !== 0 | 35 | visible: root.count !== 0 | ||
36 | level: 1 | ||||
33 | } | 37 | } | ||
38 | | ||||
39 | ScrollView { | ||||
40 | id: scroll | ||||
41 | | ||||
42 | Layout.fillWidth: true | ||||
43 | Layout.fillHeight: true | ||||
44 | | ||||
45 | Component.onCompleted: scroll.background.visible = true | ||||
46 | | ||||
47 | ListView { | ||||
48 | Layout.fillWidth: true | ||||
49 | Layout.fillHeight: true | ||||
50 | | ||||
34 | model: BluezQt.DevicesModel { } | 51 | model: BluezQt.DevicesModel { } | ||
35 | 52 | | |||
36 | delegate: ItemDelegate { | 53 | delegate: Kirigami.BasicListItem { | ||
37 | width: parent.width | 54 | width: parent.width | ||
38 | text: Name | 55 | text: Name | ||
56 | icon: Icon | ||||
39 | onClicked: root.device = Ubi | 57 | onClicked: root.device = Ubi | ||
40 | checked: root.device === Ubi | 58 | checked: root.device === Ubi | ||
41 | highlighted: root.device === Ubi | 59 | highlighted: root.device === Ubi | ||
42 | } | 60 | } | ||
43 | 61 | | |||
44 | Label { | 62 | Label { | ||
45 | anchors.fill: parent | 63 | anchors.fill: parent | ||
46 | verticalAlignment: Qt.AlignVCenter | 64 | verticalAlignment: Qt.AlignVCenter | ||
47 | horizontalAlignment: Qt.AlignHCenter | 65 | horizontalAlignment: Qt.AlignHCenter | ||
48 | visible: root.count === 0 | 66 | visible: root.count === 0 | ||
49 | text: i18n("No devices found") | 67 | text: i18n("No devices found") | ||
50 | } | 68 | } | ||
51 | } | 69 | } | ||
70 | } | ||||
71 | } |