Merge branch 'bootstrap-icons' of github.com:Ly-sec/Noctalia into bootstrap-icons

This commit is contained in:
LemmyCook 2025-09-09 07:18:46 -04:00
commit c9a128e439
12 changed files with 102 additions and 6 deletions

View file

@ -85,7 +85,8 @@ Item {
id: pill id: pill
rightOpen: BarWidgetRegistry.getNPillDirection(root) rightOpen: BarWidgetRegistry.getNPillDirection(root)
icon: testMode ? BatteryService.getIcon(testPercent, testCharging, true) : BatteryService.getIcon(percent, charging, isReady) icon: testMode ? BatteryService.getIcon(testPercent, testCharging, true) : BatteryService.getIcon(percent,
charging, isReady)
text: (isReady || testMode) ? Math.round(percent) + "%" : "-" text: (isReady || testMode) ? Math.round(percent) + "%" : "-"
autoHide: false autoHide: false
forceOpen: isReady && (testMode || battery.isLaptopBattery) && alwaysShowPercentage forceOpen: isReady && (testMode || battery.isLaptopBattery) && alwaysShowPercentage

View file

@ -38,6 +38,9 @@ RowLayout {
!== undefined) ? widgetSettings.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent !== undefined) ? widgetSettings.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent
readonly property bool showNetworkStats: (widgetSettings.showNetworkStats readonly property bool showNetworkStats: (widgetSettings.showNetworkStats
!== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats !== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats
readonly property bool showDiskUsage: (widgetSettings.showDiskUsage
!== undefined) ? widgetSettings.showDiskUsage : (widgetMetadata.showDiskUsage
|| false)
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
spacing: Style.marginS * scaling spacing: Style.marginS * scaling
@ -206,6 +209,36 @@ RowLayout {
} }
} }
} }
// Disk Usage Component (primary drive)
Item {
Layout.preferredWidth: diskUsageRow.implicitWidth
Layout.preferredHeight: Math.round(Style.capsuleHeight * scaling)
Layout.alignment: Qt.AlignVCenter
visible: showDiskUsage
RowLayout {
id: diskUsageRow
anchors.centerIn: parent
spacing: Style.marginXS * scaling
NIcon {
icon: "hdd"
font.pointSize: Style.fontSizeM * scaling
Layout.alignment: Qt.AlignVCenter
}
NText {
text: `${SystemStatService.diskPercent}%`
font.family: Settings.data.ui.fontFixed
font.pointSize: Style.fontSizeS * scaling
font.weight: Style.fontWeightMedium
Layout.alignment: Qt.AlignVCenter
verticalAlignment: Text.AlignVCenter
color: Color.mPrimary
}
}
}
} }
} }
} }

View file

@ -45,7 +45,7 @@ Item {
if (AudioService.muted) { if (AudioService.muted) {
return "volume-mute" return "volume-mute"
} }
return AudioService.volume <= 0.2? "volume-off" : (AudioService.volume < 0.6 ? "volume-down" : "volume-up") return AudioService.volume <= 0.2 ? "volume-off" : (AudioService.volume < 0.6 ? "volume-down" : "volume-up")
} }
// Connection used to open the pill when volume changes // Connection used to open the pill when volume changes

View file

@ -735,6 +735,14 @@ Loader {
color: powerButtonArea.containsMouse ? Color.mOnError : Color.mError color: powerButtonArea.containsMouse ? Color.mOnError : Color.mError
} }
// Tooltip
NTooltip {
id: tooltipShutdown
target: parent
positionAbove: true
text: "Shut down"
}
MouseArea { MouseArea {
id: powerButtonArea id: powerButtonArea
anchors.fill: parent anchors.fill: parent
@ -742,6 +750,8 @@ Loader {
onClicked: { onClicked: {
CompositorService.shutdown() CompositorService.shutdown()
} }
onEntered: tooltipShutdown.show()
onExited: tooltipShutdown.hide()
} }
} }
@ -762,6 +772,14 @@ Loader {
color: restartButtonArea.containsMouse ? Color.mOnPrimary : Color.mPrimary color: restartButtonArea.containsMouse ? Color.mOnPrimary : Color.mPrimary
} }
// Tooltip
NTooltip {
id: tooltipRestart
target: parent
positionAbove: true
text: "Restart"
}
MouseArea { MouseArea {
id: restartButtonArea id: restartButtonArea
anchors.fill: parent anchors.fill: parent
@ -769,6 +787,8 @@ Loader {
onClicked: { onClicked: {
CompositorService.reboot() CompositorService.reboot()
} }
onEntered: tooltipRestart.show()
onExited: tooltipRestart.hide()
} }
} }
@ -789,6 +809,14 @@ Loader {
color: suspendButtonArea.containsMouse ? Color.mOnSecondary : Color.mSecondary color: suspendButtonArea.containsMouse ? Color.mOnSecondary : Color.mSecondary
} }
// Tooltip
NTooltip {
id: tooltipSuspend
target: parent
positionAbove: true
text: "Suspend"
}
MouseArea { MouseArea {
id: suspendButtonArea id: suspendButtonArea
anchors.fill: parent anchors.fill: parent
@ -796,6 +824,8 @@ Loader {
onClicked: { onClicked: {
CompositorService.suspend() CompositorService.suspend()
} }
onEntered: tooltipSuspend.show()
onExited: tooltipSuspend.hide()
} }
} }
} }

View file

@ -21,6 +21,8 @@ ColumnLayout {
!== undefined ? widgetData.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent !== undefined ? widgetData.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent
property bool valueShowNetworkStats: widgetData.showNetworkStats property bool valueShowNetworkStats: widgetData.showNetworkStats
!== undefined ? widgetData.showNetworkStats : widgetMetadata.showNetworkStats !== undefined ? widgetData.showNetworkStats : widgetMetadata.showNetworkStats
property bool valueShowDiskUsage: widgetData.showDiskUsage !== undefined ? widgetData.showDiskUsage : (widgetMetadata.showDiskUsage
|| false)
function saveSettings() { function saveSettings() {
var settings = Object.assign({}, widgetData || {}) var settings = Object.assign({}, widgetData || {})
@ -29,6 +31,7 @@ ColumnLayout {
settings.showMemoryUsage = valueShowMemoryUsage settings.showMemoryUsage = valueShowMemoryUsage
settings.showMemoryAsPercent = valueShowMemoryAsPercent settings.showMemoryAsPercent = valueShowMemoryAsPercent
settings.showNetworkStats = valueShowNetworkStats settings.showNetworkStats = valueShowNetworkStats
settings.showDiskUsage = valueShowDiskUsage
return settings return settings
} }
@ -71,4 +74,12 @@ ColumnLayout {
checked: valueShowNetworkStats checked: valueShowNetworkStats
onToggled: checked => valueShowNetworkStats = checked onToggled: checked => valueShowNetworkStats = checked
} }
NToggle {
id: showDiskUsage
Layout.fillWidth: true
label: "Storage usage"
checked: valueShowDiskUsage
onToggled: checked => valueShowDiskUsage = checked
}
} }

View file

@ -37,6 +37,7 @@ NBox {
onClicked: { onClicked: {
if (enabled) { if (enabled) {
powerProfiles.profile = PowerProfile.Performance powerProfiles.profile = PowerProfile.Performance
ToastService.showNotice("Power Profile", "Performance")
} }
} }
} }
@ -51,6 +52,7 @@ NBox {
onClicked: { onClicked: {
if (enabled) { if (enabled) {
powerProfiles.profile = PowerProfile.Balanced powerProfiles.profile = PowerProfile.Balanced
ToastService.showNotice("Power Profile", "Balanced")
} }
} }
} }
@ -65,6 +67,7 @@ NBox {
onClicked: { onClicked: {
if (enabled) { if (enabled) {
powerProfiles.profile = PowerProfile.PowerSaver powerProfiles.profile = PowerProfile.PowerSaver
ToastService.showNotice("Power Profile", "Power Saver")
} }
} }
} }

View file

@ -62,6 +62,8 @@ Singleton {
function onMutedChanged() { function onMutedChanged() {
root._muted = (sink?.audio.muted ?? true) root._muted = (sink?.audio.muted ?? true)
Logger.log("AudioService", "OnMuteChanged:", root._muted) Logger.log("AudioService", "OnMuteChanged:", root._muted)
// Toast: audio output mute toggle
ToastService.showNotice("Audio Output", root._muted ? "Muted" : "Unmuted")
} }
} }
@ -79,6 +81,8 @@ Singleton {
function onMutedChanged() { function onMutedChanged() {
root._inputMuted = (source?.audio.muted ?? true) root._inputMuted = (source?.audio.muted ?? true)
Logger.log("AudioService", "OnInputMuteChanged:", root._inputMuted) Logger.log("AudioService", "OnInputMuteChanged:", root._inputMuted)
// Toast: microphone mute toggle
ToastService.showNotice("Microphone", root._inputMuted ? "Muted" : "Unmuted")
} }
} }

View file

@ -84,7 +84,8 @@ Singleton {
"showCpuTemp": true, "showCpuTemp": true,
"showMemoryUsage": true, "showMemoryUsage": true,
"showMemoryAsPercent": false, "showMemoryAsPercent": false,
"showNetworkStats": false "showNetworkStats": false,
"showDiskUsage": false
}, },
"Workspace": { "Workspace": {
"allowUserSettings": true, "allowUserSettings": true,

View file

@ -23,6 +23,11 @@ Singleton {
// Re-apply current scheme to pick the right variant // Re-apply current scheme to pick the right variant
applyScheme(Settings.data.colorSchemes.predefinedScheme) applyScheme(Settings.data.colorSchemes.predefinedScheme)
} }
// Toast: dark/light mode switched
const enabled = !!Settings.data.colorSchemes.darkMode
const label = enabled ? "Dark Mode" : "Light Mode"
const description = enabled ? "Enabled" : "Enabled"
ToastService.showNotice(label, description)
} }
} }

View file

@ -50,6 +50,9 @@ Singleton {
target: Settings.data.nightLight target: Settings.data.nightLight
function onEnabledChanged() { function onEnabledChanged() {
apply() apply()
// Toast: night light toggled
const enabled = !!Settings.data.nightLight.enabled
ToastService.showNotice("Night Light", enabled ? "Enabled" : "Disabled")
} }
function onNightTempChanged() { function onNightTempChanged() {
apply() apply()

View file

@ -185,6 +185,11 @@ Singleton {
// Process the message queue // Process the message queue
function processQueue() { function processQueue() {
if (messageQueue.length === 0 || allToasts.length === 0) { if (messageQueue.length === 0 || allToasts.length === 0) {
// Added this so we don't accidentally get duplicate toasts
// if it causes issues, remove it and we'll find a different solution
if (allToasts.length === 0 && messageQueue.length > 0) {
messageQueue = []
}
isShowingToast = false isShowingToast = false
return return
} }

View file

@ -96,7 +96,7 @@ Item {
width: iconSize width: iconSize
height: iconSize height: iconSize
radius: width * 0.5 radius: width * 0.5
color: hovered && !forceOpen? Color.mPrimary : Color.mSurfaceVariant color: hovered && !forceOpen ? Color.mPrimary : Color.mSurfaceVariant
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
x: rightOpen ? 0 : (parent.width - width) x: rightOpen ? 0 : (parent.width - width)
@ -111,8 +111,8 @@ Item {
NIcon { NIcon {
icon: root.icon icon: root.icon
font.pointSize: Style.fontSizeM * scaling font.pointSize: Style.fontSizeM * scaling
color: hovered && !forceOpen? Color.mOnPrimary : Color.mOnSurface color: hovered && !forceOpen ? Color.mOnPrimary : Color.mOnSurface
// Center horizontally // Center horizontally
x: (iconCircle.width - width) / 2 x: (iconCircle.width - width) / 2
// Center vertically accounting for font metrics // Center vertically accounting for font metrics
y: (iconCircle.height - height) / 2 + (height - contentHeight) / 2 y: (iconCircle.height - height) / 2 + (height - contentHeight) / 2