From 8a0bba77d12b405c7bded1c8911dab1e1f1f1c4c Mon Sep 17 00:00:00 2001 From: rekols Date: Sat, 5 Jun 2021 18:10:51 +0800 Subject: [PATCH] Update version --- src/images/rot180.svg | 256 +++++---------------------- src/images/rot270.svg | 256 +++++---------------------- src/images/rot90.svg | 256 +++++---------------------- src/images/rotnormal.svg | 252 +++++--------------------- src/images/sidebar/light/battery.svg | 4 +- src/qml/About/Main.qml | 2 +- src/qml/Bluetooth/Main.qml | 117 ++++++++++++ src/qml/SideBar.qml | 3 +- src/qml/main.qml | 5 +- src/resources.qrc | 1 + 10 files changed, 288 insertions(+), 864 deletions(-) create mode 100644 src/qml/Bluetooth/Main.qml diff --git a/src/images/rot180.svg b/src/images/rot180.svg index e40253a..4ac0743 100644 --- a/src/images/rot180.svg +++ b/src/images/rot180.svg @@ -1,228 +1,54 @@ - - + + - + image/svg+xml - - + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - + + + - - - - - + + + + + - + - - + + \ No newline at end of file diff --git a/src/images/rot270.svg b/src/images/rot270.svg index d614554..455670f 100644 --- a/src/images/rot270.svg +++ b/src/images/rot270.svg @@ -1,228 +1,54 @@ - - + + - + image/svg+xml - - + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - + + + - - - - - + + + + + - + - - + + \ No newline at end of file diff --git a/src/images/rot90.svg b/src/images/rot90.svg index a35044b..c87cf8a 100644 --- a/src/images/rot90.svg +++ b/src/images/rot90.svg @@ -1,228 +1,54 @@ - - + + - + image/svg+xml - - + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - + + + - - - - - + + + + + - + - - + + \ No newline at end of file diff --git a/src/images/rotnormal.svg b/src/images/rotnormal.svg index c6d8bd7..713202f 100644 --- a/src/images/rotnormal.svg +++ b/src/images/rotnormal.svg @@ -1,224 +1,52 @@ - - + + - + image/svg+xml - - + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - + + + - - - - + + + + - - - + + + \ No newline at end of file diff --git a/src/images/sidebar/light/battery.svg b/src/images/sidebar/light/battery.svg index 50793c5..9da12b3 100644 --- a/src/images/sidebar/light/battery.svg +++ b/src/images/sidebar/light/battery.svg @@ -36,14 +36,14 @@ inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="2160" - inkscape:window-height="1247" + inkscape:window-height="1221" id="namedview12" showgrid="false" inkscape:zoom="22.96875" inkscape:cx="-3.3873744" inkscape:cy="10.426984" inkscape:window-x="0" - inkscape:window-y="35" + inkscape:window-y="42" inkscape:window-maximized="1" inkscape:current-layer="svg10" inkscape:document-rotation="0" /> diff --git a/src/qml/About/Main.qml b/src/qml/About/Main.qml index 446a621..2225585 100644 --- a/src/qml/About/Main.qml +++ b/src/qml/About/Main.qml @@ -78,7 +78,7 @@ ItemPage { RoundedItem { StandardItem { key: qsTr("System Version") - value: "0.1 Beta" + value: "0.2" } StandardItem { diff --git a/src/qml/Bluetooth/Main.qml b/src/qml/Bluetooth/Main.qml new file mode 100644 index 0000000..d07d85e --- /dev/null +++ b/src/qml/Bluetooth/Main.qml @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2021 CutefishOS Team. + * + * Author: revenmartin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 +import QtQuick.Controls 2.4 +import QtQuick.Layouts 1.3 +import Cutefish.Settings 1.0 +import FishUI 1.0 as FishUI +//import org.kde.bluezqt 1.0 as BluezQt +//import org.kde.plasma.private.bluetooth 1.0 + +import Cutefish.Bluez 1.0 as Bluez +import "../" + +ItemPage { + headerTitle: qsTr("Bluetooth") + + function setBluetoothEnabled(enabled) { + Bluez.Manager.bluetoothBlocked = !enabled + + for (var i = 0; i < Bluez.Manager.adapters.length; ++i) { + var adapter = Bluez.Manager.adapters[i]; + adapter.powered = enabled; + } + } + +// Label { +// id: noBluetoothMessage +// anchors.centerIn: parent +// visible: BluezQt.Manager.rfkill.state === BluezQt.Rfkill.Unknown +// text: qsTr("No Bluetooth adapters found") +// } + +// Label { +// anchors.centerIn: parent +// text: qsTr("Bluetooth is disabled") +// visible: Bluez.Manager.operational && !Bluez.Manager.bluetoothOperational // && !noBluetoothMessage.visible +// } + + Scrollable { + anchors.fill: parent + contentHeight: layout.implicitHeight + + ColumnLayout { + id: layout + anchors.fill: parent + anchors.bottomMargin: FishUI.Units.largeSpacing + + RoundedItem { + id: mainItem + spacing: FishUI.Units.largeSpacing + + RowLayout { + Label { + text: qsTr("Bluetooth") + color: FishUI.Theme.disabledTextColor + } + + Item { + Layout.fillWidth: true + } + + Switch { + id: bluetoothSwitch + Layout.fillHeight: true + rightPadding: 0 + onCheckedChanged: setBluetoothEnabled(checked) + Component.onCompleted: bluetoothSwitch.checked = Bluez.Manager.operational + } + } + + ListView { + property var itemHeight: 50 + + Layout.fillWidth: true + Layout.preferredHeight: itemHeight * count + ((count - 1) * spacing) + + Bluez.DevicesProxyModel { + id: devicesModel + sourceModel: Bluez.DevicesModel { } + } + + model: Bluez.Manager.bluetoothOperational ? devicesModel : [] + + delegate: Item { + width: ListView.view.itemHeight + height: 50 + + ColumnLayout { + anchors.fill: parent + + Label { + text: model.DeviceFullName + } + } + } + } + } + } + } +} diff --git a/src/qml/SideBar.qml b/src/qml/SideBar.qml index 6458792..fe72a1a 100644 --- a/src/qml/SideBar.qml +++ b/src/qml/SideBar.qml @@ -34,8 +34,7 @@ Item { Rectangle { anchors.fill: parent - - color: FishUI.Theme.darkMode ? "#333333" : "#E5E5EB" + color: rootWindow.sideBarColor Behavior on color { ColorAnimation { diff --git a/src/qml/main.qml b/src/qml/main.qml index 4643d61..65e344b 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -34,8 +34,9 @@ FishUI.Window { minimumWidth: 900 minimumHeight: 600 headerBarHeight: 50 + backgroundColor: FishUI.Theme.darkMode ? "#262626" : "#F3F4F9" - backgroundColor: FishUI.Theme.darkMode ? "#262626" : "#F2F2F7" + property var sideBarColor: FishUI.Theme.darkMode ? "#333333" : "#EBECF2" headerBar: Item { Rectangle { @@ -44,7 +45,7 @@ FishUI.Window { anchors.top: parent.top anchors.bottom: parent.bottom implicitWidth: sideBar.width - color: FishUI.Theme.darkMode ? "#333333" : "#E5E5EB" + color: rootWindow.sideBarColor Behavior on color { ColorAnimation { diff --git a/src/resources.qrc b/src/resources.qrc index 6ae99df..349a788 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -101,5 +101,6 @@ qml/WLAN/WirelessDetailsDialog.qml images/sidebar/light/wlan.svg images/sidebar/dark/wlan.svg + qml/Bluetooth/Main.qml