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
|
||||
defaultItem: icon
|
||||
exclusiveMonitor: root.monitor
|
||||
forceHidden: !BatteryManager.mainBattery.isLaptopBattery
|
||||
forceHidden: !BatteryManager.hasLaptopBattery
|
||||
|
||||
states: [
|
||||
State {
|
||||
|
||||
@@ -23,7 +23,7 @@ Container {
|
||||
defaultItem: icon
|
||||
exclusiveMonitor: root.monitor
|
||||
exclusiveToScreen: true
|
||||
forceHidden: !(BluetoothManager.getConnected())
|
||||
forceHidden: !BluetoothManager.anyConnected
|
||||
|
||||
states: [
|
||||
State {
|
||||
|
||||
@@ -20,7 +20,7 @@ Container {
|
||||
defaultItem: icon
|
||||
exclusiveMonitor: root.monitor
|
||||
exclusiveToScreen: true
|
||||
forceHidden: !NetworkManager.isConnectedAndWifi()
|
||||
forceHidden: !NetworkManager.connectedWifi
|
||||
|
||||
states: [
|
||||
State {
|
||||
|
||||
@@ -42,7 +42,11 @@ Item {
|
||||
property double visibleTopMargin: 0
|
||||
|
||||
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 {
|
||||
animation: defaultCurve
|
||||
@@ -70,8 +74,10 @@ Item {
|
||||
if (root.forceHidden == true) {
|
||||
hideTimer.restart();
|
||||
} else {
|
||||
root.implicitWidth = root.boxWidth;
|
||||
root.visible = true;
|
||||
hideTimer.stop();
|
||||
subHideTimer.stop();
|
||||
root._fullyHidden = false;
|
||||
root._widthCollapsed = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +89,7 @@ Item {
|
||||
running: false
|
||||
|
||||
onTriggered: {
|
||||
root.implicitWidth = 0;
|
||||
root._widthCollapsed = true;
|
||||
subHideTimer.restart();
|
||||
}
|
||||
}
|
||||
@@ -96,7 +102,7 @@ Item {
|
||||
running: false
|
||||
|
||||
onTriggered: {
|
||||
root.visible = false;
|
||||
root._fullyHidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
@@ -49,9 +64,7 @@ Singleton {
|
||||
}
|
||||
|
||||
function isConnectedAndWifi() {
|
||||
let isConnected = defaultAdapter.connected
|
||||
let isWifi = isDeviceWifi(defaultAdapter)
|
||||
return isConnected && isWifi
|
||||
return root.connectedWifi;
|
||||
}
|
||||
|
||||
function getWifiText() {
|
||||
|
||||
Reference in New Issue
Block a user