mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Merge branch 'main' into main
This commit is contained in:
@@ -3,6 +3,7 @@ import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Services.UPower
|
||||
import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
@@ -63,6 +64,15 @@ Variants {
|
||||
id: leftWidgetLoader
|
||||
sourceComponent: widgetLoader.getWidgetComponent(modelData)
|
||||
active: true
|
||||
visible: {
|
||||
if (modelData === "WiFi" && !Settings.data.network.wifiEnabled)
|
||||
return false
|
||||
if (modelData === "Bluetooth" && !Settings.data.network.bluetoothEnabled)
|
||||
return false
|
||||
if (modelData === "Battery" && !shouldShowBattery())
|
||||
return false
|
||||
return true
|
||||
}
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onStatusChanged: {
|
||||
if (status === Loader.Error) {
|
||||
@@ -90,6 +100,15 @@ Variants {
|
||||
id: centerWidgetLoader
|
||||
sourceComponent: widgetLoader.getWidgetComponent(modelData)
|
||||
active: true
|
||||
visible: {
|
||||
if (modelData === "WiFi" && !Settings.data.network.wifiEnabled)
|
||||
return false
|
||||
if (modelData === "Bluetooth" && !Settings.data.network.bluetoothEnabled)
|
||||
return false
|
||||
if (modelData === "Battery" && !shouldShowBattery())
|
||||
return false
|
||||
return true
|
||||
}
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onStatusChanged: {
|
||||
if (status === Loader.Error) {
|
||||
@@ -118,6 +137,13 @@ Variants {
|
||||
id: rightWidgetLoader
|
||||
sourceComponent: widgetLoader.getWidgetComponent(modelData)
|
||||
active: true
|
||||
visible: {
|
||||
if (modelData === "WiFi" && !Settings.data.network.wifiEnabled)
|
||||
return false
|
||||
if (modelData === "Bluetooth" && !Settings.data.network.bluetoothEnabled)
|
||||
return false
|
||||
return true
|
||||
}
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onStatusChanged: {
|
||||
if (status === Loader.Error) {
|
||||
@@ -131,6 +157,13 @@ Variants {
|
||||
}
|
||||
}
|
||||
|
||||
// Helper function to check if battery widget should be visible (same logic as Battery.qml)
|
||||
function shouldShowBattery() {
|
||||
// For now, always show battery widget and let it handle its own visibility
|
||||
// The Battery widget has its own testMode and visibility logic
|
||||
return true
|
||||
}
|
||||
|
||||
// Widget loader instance
|
||||
WidgetLoader {
|
||||
id: widgetLoader
|
||||
|
||||
@@ -7,7 +7,6 @@ import qs.Commons
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
|
||||
Row {
|
||||
id: root
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -43,8 +42,7 @@ Row {
|
||||
function getTitle() {
|
||||
// Use the service's focusedWindowTitle property which is updated immediately
|
||||
// when WindowOpenedOrChanged events are received
|
||||
return CompositorService.focusedWindowTitle !== "(No active window)" ?
|
||||
CompositorService.focusedWindowTitle : ""
|
||||
return CompositorService.focusedWindowTitle !== "(No active window)" ? CompositorService.focusedWindowTitle : ""
|
||||
}
|
||||
|
||||
function getAppIcon() {
|
||||
|
||||
@@ -25,10 +25,9 @@ Item {
|
||||
tooltipText: "Keyboard Layout: " + currentLayout
|
||||
|
||||
onClicked: {
|
||||
|
||||
// You could open keyboard settings here if needed
|
||||
// For now, just show the current layout
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user