had opencode fix my weird animation issues, now the bar loads correctly from a coldstart
This commit is contained in:
@@ -11,6 +11,7 @@ Singleton {
|
||||
property double batteryPercentage: root.mainBattery.percentage || 0
|
||||
property bool batteryPresent: root.mainBattery.ready || false
|
||||
property UPowerDevice mainBattery: UPower.displayDevice || undefined
|
||||
property bool hasLaptopBattery: root.mainBattery && root.mainBattery.isLaptopBattery
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,19 +9,11 @@ Singleton {
|
||||
property BluetoothAdapter defaultAdapter: Bluetooth.defaultAdapter || null
|
||||
property string defaultAdapterName: defaultAdapter ? defaultAdapter.adapterId : ""
|
||||
|
||||
property bool anyConnected: root.defaultAdapter != null
|
||||
&& root.defaultAdapter.devices.values.some(device => device.connected)
|
||||
|
||||
function getConnected() {
|
||||
let deviceList = getDevicesList();
|
||||
if (deviceList.length == 0) {
|
||||
return false;
|
||||
} else {
|
||||
for (let device in deviceList) {
|
||||
let currentDevice = deviceList[device];
|
||||
if (currentDevice.connected == true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return root.anyConnected;
|
||||
}
|
||||
|
||||
function getConnectedDevicesList() {
|
||||
|
||||
@@ -8,6 +8,10 @@ Singleton {
|
||||
|
||||
property NetworkDevice defaultAdapter: Networking.devices.values[0]
|
||||
|
||||
property bool connectedWifi: root.defaultAdapter != null
|
||||
&& root.defaultAdapter.connected
|
||||
&& root.defaultAdapter.type == DeviceType.Wifi
|
||||
|
||||
function getConnectedNetworks(networksArr) {
|
||||
let connectedNetworks = [];
|
||||
|
||||
@@ -20,6 +24,17 @@ Singleton {
|
||||
}
|
||||
|
||||
function getNetworkDetails(adapter) {
|
||||
if (!adapter) {
|
||||
return {
|
||||
"adapterName": "",
|
||||
"adapterConnected": false,
|
||||
"adapterIsWifi": false,
|
||||
"networkName": "",
|
||||
"networkStrength": 0,
|
||||
"icon": ""
|
||||
};
|
||||
}
|
||||
|
||||
let networksArr = adapter.networks.values;
|
||||
let connectedNetworks = getConnectedNetworks(networksArr);
|
||||
let deviceWifi = isDeviceWifi(adapter);
|
||||
@@ -48,11 +63,9 @@ Singleton {
|
||||
return iconArr[strengthIndex - 1];
|
||||
}
|
||||
|
||||
function isConnectedAndWifi() {
|
||||
let isConnected = defaultAdapter.connected
|
||||
let isWifi = isDeviceWifi(defaultAdapter)
|
||||
return isConnected && isWifi
|
||||
}
|
||||
function isConnectedAndWifi() {
|
||||
return root.connectedWifi;
|
||||
}
|
||||
|
||||
function getWifiText() {
|
||||
let info = getNetworkDetails(defaultAdapter);
|
||||
|
||||
Reference in New Issue
Block a user