had opencode fix my weird animation issues, now the bar loads correctly from a coldstart
This commit is contained in:
@@ -20,7 +20,7 @@ Container {
|
|||||||
boxRadius: radius
|
boxRadius: radius
|
||||||
defaultItem: icon
|
defaultItem: icon
|
||||||
exclusiveMonitor: root.monitor
|
exclusiveMonitor: root.monitor
|
||||||
forceHidden: !BatteryManager.mainBattery.isLaptopBattery
|
forceHidden: !BatteryManager.hasLaptopBattery
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Container {
|
|||||||
defaultItem: icon
|
defaultItem: icon
|
||||||
exclusiveMonitor: root.monitor
|
exclusiveMonitor: root.monitor
|
||||||
exclusiveToScreen: true
|
exclusiveToScreen: true
|
||||||
forceHidden: !(BluetoothManager.getConnected())
|
forceHidden: !BluetoothManager.anyConnected
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Container {
|
|||||||
defaultItem: icon
|
defaultItem: icon
|
||||||
exclusiveMonitor: root.monitor
|
exclusiveMonitor: root.monitor
|
||||||
exclusiveToScreen: true
|
exclusiveToScreen: true
|
||||||
forceHidden: !NetworkManager.isConnectedAndWifi()
|
forceHidden: !NetworkManager.connectedWifi
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ Item {
|
|||||||
property double visibleTopMargin: 0
|
property double visibleTopMargin: 0
|
||||||
|
|
||||||
implicitHeight: boxHeight
|
implicitHeight: boxHeight
|
||||||
implicitWidth: boxWidth
|
implicitWidth: root._widthCollapsed ? 0 : root.boxWidth
|
||||||
|
visible: !root._fullyHidden
|
||||||
|
|
||||||
|
property bool _widthCollapsed: false
|
||||||
|
property bool _fullyHidden: false
|
||||||
|
|
||||||
Behavior on anchors.topMargin {
|
Behavior on anchors.topMargin {
|
||||||
animation: defaultCurve
|
animation: defaultCurve
|
||||||
@@ -70,8 +74,10 @@ Item {
|
|||||||
if (root.forceHidden == true) {
|
if (root.forceHidden == true) {
|
||||||
hideTimer.restart();
|
hideTimer.restart();
|
||||||
} else {
|
} else {
|
||||||
root.implicitWidth = root.boxWidth;
|
hideTimer.stop();
|
||||||
root.visible = true;
|
subHideTimer.stop();
|
||||||
|
root._fullyHidden = false;
|
||||||
|
root._widthCollapsed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +89,7 @@ Item {
|
|||||||
running: false
|
running: false
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.implicitWidth = 0;
|
root._widthCollapsed = true;
|
||||||
subHideTimer.restart();
|
subHideTimer.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,7 +102,7 @@ Item {
|
|||||||
running: false
|
running: false
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
root.visible = false;
|
root._fullyHidden = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Singleton {
|
|||||||
property double batteryPercentage: root.mainBattery.percentage || 0
|
property double batteryPercentage: root.mainBattery.percentage || 0
|
||||||
property bool batteryPresent: root.mainBattery.ready || false
|
property bool batteryPresent: root.mainBattery.ready || false
|
||||||
property UPowerDevice mainBattery: UPower.displayDevice || undefined
|
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 BluetoothAdapter defaultAdapter: Bluetooth.defaultAdapter || null
|
||||||
property string defaultAdapterName: defaultAdapter ? defaultAdapter.adapterId : ""
|
property string defaultAdapterName: defaultAdapter ? defaultAdapter.adapterId : ""
|
||||||
|
|
||||||
|
property bool anyConnected: root.defaultAdapter != null
|
||||||
|
&& root.defaultAdapter.devices.values.some(device => device.connected)
|
||||||
|
|
||||||
function getConnected() {
|
function getConnected() {
|
||||||
let deviceList = getDevicesList();
|
return root.anyConnected;
|
||||||
if (deviceList.length == 0) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
for (let device in deviceList) {
|
|
||||||
let currentDevice = deviceList[device];
|
|
||||||
if (currentDevice.connected == true) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConnectedDevicesList() {
|
function getConnectedDevicesList() {
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ Singleton {
|
|||||||
|
|
||||||
property NetworkDevice defaultAdapter: Networking.devices.values[0]
|
property NetworkDevice defaultAdapter: Networking.devices.values[0]
|
||||||
|
|
||||||
|
property bool connectedWifi: root.defaultAdapter != null
|
||||||
|
&& root.defaultAdapter.connected
|
||||||
|
&& root.defaultAdapter.type == DeviceType.Wifi
|
||||||
|
|
||||||
function getConnectedNetworks(networksArr) {
|
function getConnectedNetworks(networksArr) {
|
||||||
let connectedNetworks = [];
|
let connectedNetworks = [];
|
||||||
|
|
||||||
@@ -20,6 +24,17 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getNetworkDetails(adapter) {
|
function getNetworkDetails(adapter) {
|
||||||
|
if (!adapter) {
|
||||||
|
return {
|
||||||
|
"adapterName": "",
|
||||||
|
"adapterConnected": false,
|
||||||
|
"adapterIsWifi": false,
|
||||||
|
"networkName": "",
|
||||||
|
"networkStrength": 0,
|
||||||
|
"icon": ""
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
let networksArr = adapter.networks.values;
|
let networksArr = adapter.networks.values;
|
||||||
let connectedNetworks = getConnectedNetworks(networksArr);
|
let connectedNetworks = getConnectedNetworks(networksArr);
|
||||||
let deviceWifi = isDeviceWifi(adapter);
|
let deviceWifi = isDeviceWifi(adapter);
|
||||||
@@ -48,11 +63,9 @@ Singleton {
|
|||||||
return iconArr[strengthIndex - 1];
|
return iconArr[strengthIndex - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function isConnectedAndWifi() {
|
function isConnectedAndWifi() {
|
||||||
let isConnected = defaultAdapter.connected
|
return root.connectedWifi;
|
||||||
let isWifi = isDeviceWifi(defaultAdapter)
|
}
|
||||||
return isConnected && isWifi
|
|
||||||
}
|
|
||||||
|
|
||||||
function getWifiText() {
|
function getWifiText() {
|
||||||
let info = getNetworkDetails(defaultAdapter);
|
let info = getNetworkDetails(defaultAdapter);
|
||||||
|
|||||||
Reference in New Issue
Block a user