Merge branch 'bootstrap-icons' of github.com:Ly-sec/Noctalia into bootstrap-icons
This commit is contained in:
commit
c9a128e439
12 changed files with 102 additions and 6 deletions
|
|
@ -85,7 +85,8 @@ Item {
|
|||
id: pill
|
||||
|
||||
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) + "%" : "-"
|
||||
autoHide: false
|
||||
forceOpen: isReady && (testMode || battery.isLaptopBattery) && alwaysShowPercentage
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ RowLayout {
|
|||
!== undefined) ? widgetSettings.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent
|
||||
readonly property bool showNetworkStats: (widgetSettings.showNetworkStats
|
||||
!== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats
|
||||
readonly property bool showDiskUsage: (widgetSettings.showDiskUsage
|
||||
!== undefined) ? widgetSettings.showDiskUsage : (widgetMetadata.showDiskUsage
|
||||
|| false)
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ Item {
|
|||
if (AudioService.muted) {
|
||||
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
|
||||
|
|
|
|||
|
|
@ -735,6 +735,14 @@ Loader {
|
|||
color: powerButtonArea.containsMouse ? Color.mOnError : Color.mError
|
||||
}
|
||||
|
||||
// Tooltip
|
||||
NTooltip {
|
||||
id: tooltipShutdown
|
||||
target: parent
|
||||
positionAbove: true
|
||||
text: "Shut down"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: powerButtonArea
|
||||
anchors.fill: parent
|
||||
|
|
@ -742,6 +750,8 @@ Loader {
|
|||
onClicked: {
|
||||
CompositorService.shutdown()
|
||||
}
|
||||
onEntered: tooltipShutdown.show()
|
||||
onExited: tooltipShutdown.hide()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -762,6 +772,14 @@ Loader {
|
|||
color: restartButtonArea.containsMouse ? Color.mOnPrimary : Color.mPrimary
|
||||
}
|
||||
|
||||
// Tooltip
|
||||
NTooltip {
|
||||
id: tooltipRestart
|
||||
target: parent
|
||||
positionAbove: true
|
||||
text: "Restart"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: restartButtonArea
|
||||
anchors.fill: parent
|
||||
|
|
@ -769,6 +787,8 @@ Loader {
|
|||
onClicked: {
|
||||
CompositorService.reboot()
|
||||
}
|
||||
onEntered: tooltipRestart.show()
|
||||
onExited: tooltipRestart.hide()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -789,6 +809,14 @@ Loader {
|
|||
color: suspendButtonArea.containsMouse ? Color.mOnSecondary : Color.mSecondary
|
||||
}
|
||||
|
||||
// Tooltip
|
||||
NTooltip {
|
||||
id: tooltipSuspend
|
||||
target: parent
|
||||
positionAbove: true
|
||||
text: "Suspend"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: suspendButtonArea
|
||||
anchors.fill: parent
|
||||
|
|
@ -796,6 +824,8 @@ Loader {
|
|||
onClicked: {
|
||||
CompositorService.suspend()
|
||||
}
|
||||
onEntered: tooltipSuspend.show()
|
||||
onExited: tooltipSuspend.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ ColumnLayout {
|
|||
!== undefined ? widgetData.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent
|
||||
property bool valueShowNetworkStats: widgetData.showNetworkStats
|
||||
!== undefined ? widgetData.showNetworkStats : widgetMetadata.showNetworkStats
|
||||
property bool valueShowDiskUsage: widgetData.showDiskUsage !== undefined ? widgetData.showDiskUsage : (widgetMetadata.showDiskUsage
|
||||
|| false)
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
|
|
@ -29,6 +31,7 @@ ColumnLayout {
|
|||
settings.showMemoryUsage = valueShowMemoryUsage
|
||||
settings.showMemoryAsPercent = valueShowMemoryAsPercent
|
||||
settings.showNetworkStats = valueShowNetworkStats
|
||||
settings.showDiskUsage = valueShowDiskUsage
|
||||
return settings
|
||||
}
|
||||
|
||||
|
|
@ -71,4 +74,12 @@ ColumnLayout {
|
|||
checked: valueShowNetworkStats
|
||||
onToggled: checked => valueShowNetworkStats = checked
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showDiskUsage
|
||||
Layout.fillWidth: true
|
||||
label: "Storage usage"
|
||||
checked: valueShowDiskUsage
|
||||
onToggled: checked => valueShowDiskUsage = checked
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ NBox {
|
|||
onClicked: {
|
||||
if (enabled) {
|
||||
powerProfiles.profile = PowerProfile.Performance
|
||||
ToastService.showNotice("Power Profile", "Performance")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -51,6 +52,7 @@ NBox {
|
|||
onClicked: {
|
||||
if (enabled) {
|
||||
powerProfiles.profile = PowerProfile.Balanced
|
||||
ToastService.showNotice("Power Profile", "Balanced")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -65,6 +67,7 @@ NBox {
|
|||
onClicked: {
|
||||
if (enabled) {
|
||||
powerProfiles.profile = PowerProfile.PowerSaver
|
||||
ToastService.showNotice("Power Profile", "Power Saver")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ Singleton {
|
|||
function onMutedChanged() {
|
||||
root._muted = (sink?.audio.muted ?? true)
|
||||
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() {
|
||||
root._inputMuted = (source?.audio.muted ?? true)
|
||||
Logger.log("AudioService", "OnInputMuteChanged:", root._inputMuted)
|
||||
// Toast: microphone mute toggle
|
||||
ToastService.showNotice("Microphone", root._inputMuted ? "Muted" : "Unmuted")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@ Singleton {
|
|||
"showCpuTemp": true,
|
||||
"showMemoryUsage": true,
|
||||
"showMemoryAsPercent": false,
|
||||
"showNetworkStats": false
|
||||
"showNetworkStats": false,
|
||||
"showDiskUsage": false
|
||||
},
|
||||
"Workspace": {
|
||||
"allowUserSettings": true,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ Singleton {
|
|||
// Re-apply current scheme to pick the right variant
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ Singleton {
|
|||
target: Settings.data.nightLight
|
||||
function onEnabledChanged() {
|
||||
apply()
|
||||
// Toast: night light toggled
|
||||
const enabled = !!Settings.data.nightLight.enabled
|
||||
ToastService.showNotice("Night Light", enabled ? "Enabled" : "Disabled")
|
||||
}
|
||||
function onNightTempChanged() {
|
||||
apply()
|
||||
|
|
|
|||
|
|
@ -185,6 +185,11 @@ Singleton {
|
|||
// Process the message queue
|
||||
function processQueue() {
|
||||
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
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ Item {
|
|||
width: iconSize
|
||||
height: iconSize
|
||||
radius: width * 0.5
|
||||
color: hovered && !forceOpen? Color.mPrimary : Color.mSurfaceVariant
|
||||
color: hovered && !forceOpen ? Color.mPrimary : Color.mSurfaceVariant
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
x: rightOpen ? 0 : (parent.width - width)
|
||||
|
|
@ -111,8 +111,8 @@ Item {
|
|||
NIcon {
|
||||
icon: root.icon
|
||||
font.pointSize: Style.fontSizeM * scaling
|
||||
color: hovered && !forceOpen? Color.mOnPrimary : Color.mOnSurface
|
||||
// Center horizontally
|
||||
color: hovered && !forceOpen ? Color.mOnPrimary : Color.mOnSurface
|
||||
// Center horizontally
|
||||
x: (iconCircle.width - width) / 2
|
||||
// Center vertically accounting for font metrics
|
||||
y: (iconCircle.height - height) / 2 + (height - contentHeight) / 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue