Compare commits
8
Commits
aea40a3e42
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c45074b247 | ||
|
|
cf2388f6d8 | ||
|
|
3014a4cc3b | ||
|
|
5ea11ae9f7 | ||
|
|
31378f9769 | ||
|
|
0fad9baa5b | ||
|
|
f9c14c84b4 | ||
|
|
510cbb0cec |
@@ -4,3 +4,4 @@ modules/wlogout/scripts/helper.sh
|
||||
config/path/ConfigPath.qml
|
||||
config/path/WallpaperPath.qml
|
||||
modules/notification/assets/notification.ogg
|
||||
*.json
|
||||
@@ -11,7 +11,7 @@ Item {
|
||||
active: true // loads object
|
||||
sourceComponent: Bar {
|
||||
screen: modelData
|
||||
visible: !Hyprland.monitorFor(modelData).activeWorkspace.hasFullscreen
|
||||
visible: !Hyprland.monitorFor(modelData).activeWorkspace?.hasFullscreen
|
||||
} // creates instance of bar component
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,6 +183,8 @@ Item {
|
||||
"lightburn": "",
|
||||
"wofi": "",
|
||||
// Screenshare
|
||||
"moonlight": "ßß"
|
||||
"moonlight": "",
|
||||
// PCB
|
||||
"kicad": "",
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,21 +1,144 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Services.UPower
|
||||
import "../../../../config"
|
||||
|
||||
Item {
|
||||
property bool available: UPower.displayDevice.isLaptopBattery
|
||||
id: root
|
||||
// show widget for laptop battery *or* UPS (your main PC), hide otherwise
|
||||
// displayDevice is aggregate - for UPS it is type Ups, isLaptopBattery is false
|
||||
property bool available: {
|
||||
const d = UPower.displayDevice
|
||||
if (d && d.ready && d.isPresent && (d.isLaptopBattery || d.type === UPowerDeviceType.Ups)) return true
|
||||
// fallback: scan all devices (some systems don't set DisplayDevice to UPS)
|
||||
const devs = UPower.devices.values
|
||||
for (let i = 0; i < devs.length; i++) {
|
||||
const dev = devs[i]
|
||||
if (dev.isPresent && (dev.isLaptopBattery || dev.type === UPowerDeviceType.Ups)) return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
property real percentage: UPower.displayDevice.percentage*100
|
||||
property string state: UPowerDeviceState.toString(UPower.displayDevice.state)
|
||||
property bool charging: state == "Charging"
|
||||
property bool full: state == "FullyCharged"
|
||||
// 'state' shadows Item.state (qmllint) -> use chargeState
|
||||
property string chargeState: UPowerDeviceState.toString(UPower.displayDevice.state)
|
||||
// keep alias via getter would still shadow, so expose via function if needed; prefer chargeState
|
||||
property bool charging: chargeState == "Charging"
|
||||
property bool full: chargeState == "FullyCharged"
|
||||
property real energy: UPower.displayDevice.energy
|
||||
property real energy_formated: Math.round(energy*10)/10
|
||||
property real time_to_empty: UPower.displayDevice.timeToEmpty
|
||||
property real time_to_full: UPower.displayDevice.timeToFull
|
||||
property real hour_to_empty: Math.floor(time_to_empty/3600)
|
||||
property real min_to_empty: Math.floor((time_to_empty%3600)/60)
|
||||
property real hour_to_full: Math.floor(time_to_full/3600)
|
||||
property real min_to_full: Math.floor((time_to_full%3600)/60)
|
||||
property real energy_rate: UPower.displayDevice.changeRate
|
||||
property real energy_rate_formated: Math.round(energy_rate*10)/10
|
||||
property bool healthSupported: UPower.displayDevice.healthSupported
|
||||
property real health: healthSupported ? UPower.displayDevice.healthPercentage : NaN
|
||||
|
||||
property int _maxHistory: 60*60 // 1h window
|
||||
|
||||
property var percentageHistory: [{time: Date.now() - _maxHistory*1000, value: 0}, {time: Date.now(), value: 0}]
|
||||
property var percentageHistoryExists: false
|
||||
property var energyHistory: [{time: Date.now() - _maxHistory*1000, value: 0}, {time: Date.now(), value: 0}]
|
||||
property var energyHistoryExists: false
|
||||
property var usageHistory: [{time: Date.now() - _maxHistory*1000, value: 0}, {time: Date.now(), value: 0}]
|
||||
property var usageHistoryExists: false
|
||||
|
||||
// ---- persistence: survives reload AND close (FileView -> disk) ----
|
||||
// use Config.configDir (base dir) so path is stable and visible in repo
|
||||
readonly property string _historyPath: Config.configDir + "/modules/bar/states/Battery/battery_history.json"
|
||||
// guard: don't try to read non-existent file (avoids FileView warning)
|
||||
Process {
|
||||
id: historyFileExistsCheck
|
||||
command: ["test", "-f", root._historyPath]
|
||||
onExited: function(exitCode, exitStatus) {
|
||||
if (exitCode === 0) historyFile.path = root._historyPath
|
||||
// else keep historyFile.path empty -> no read attempt, writes will set it later
|
||||
}
|
||||
Component.onCompleted: running = true
|
||||
}
|
||||
FileView {
|
||||
id: historyFile
|
||||
printErrors: false
|
||||
// adapter holds json, synced to disk via writeAdapter()
|
||||
adapter: JsonAdapter {
|
||||
property var percentageHistory: []
|
||||
property var energyHistory: []
|
||||
property var usageHistory: []
|
||||
}
|
||||
onLoaded: {
|
||||
function prune(arr) {
|
||||
if (!arr || typeof arr.length !== "number" || arr.length===0) return null
|
||||
const f = arr.filter(p => p && typeof p.time==="number" && typeof p.value==="number")
|
||||
if (f.length < 2) return null
|
||||
return f.length > root._maxHistory ? f.slice(-root._maxHistory) : f
|
||||
}
|
||||
const p = prune(adapter.percentageHistory)
|
||||
if (p) { root.percentageHistory = p; root.percentageHistoryExists = p.some(i=>i.value!==0) }
|
||||
const e = prune(adapter.energyHistory)
|
||||
if (e) { root.energyHistory = e; root.energyHistoryExists = e.some(i=>i.value!==0) }
|
||||
const u = prune(adapter.usageHistory)
|
||||
if (u) { root.usageHistory = u; root.usageHistoryExists = u.some(i=>i.value!==0) }
|
||||
}
|
||||
onLoadFailed: {} // first run, file missing -> keep defaults
|
||||
}
|
||||
|
||||
// periodic save every 10s (debounce-restart would never fire while statsTimer pushes every 1s)
|
||||
Timer {
|
||||
id: saveTimer
|
||||
interval: 10000
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered: {
|
||||
if (historyFile.path === "") historyFile.path = root._historyPath
|
||||
historyFile.adapter.percentageHistory = root.percentageHistory
|
||||
historyFile.adapter.energyHistory = root.energyHistory
|
||||
historyFile.adapter.usageHistory = root.usageHistory
|
||||
historyFile.writeAdapter()
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: statsTimer
|
||||
interval: 1000
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered: {
|
||||
const now = Date.now()
|
||||
|
||||
// Creating percentage History
|
||||
let pHist = root.percentageHistory.slice()
|
||||
pHist.push({time: now, value: percentage})
|
||||
if (pHist.length > root._maxHistory) pHist.shift()
|
||||
root.percentageHistoryExists = pHist.some(item => item.value !== 0 && item.value !== undefined)
|
||||
root.percentageHistory = pHist
|
||||
|
||||
// Creating energy History
|
||||
let eHist = root.energyHistory.slice()
|
||||
eHist.push({time: now, value: energy_formated})
|
||||
if (eHist.length > root._maxHistory) eHist.shift()
|
||||
root.energyHistoryExists = eHist.some(item => item.value !== 0 && item.value !== undefined)
|
||||
root.energyHistory = eHist
|
||||
|
||||
// Creating usage History
|
||||
let uHist = root.usageHistory.slice()
|
||||
uHist.push({time: now, value: energy_rate_formated})
|
||||
if (uHist.length > root._maxHistory) uHist.shift()
|
||||
root.usageHistoryExists = uHist.some(item => item.value !== 0 && item.value !== undefined)
|
||||
root.usageHistory = uHist
|
||||
}
|
||||
}
|
||||
|
||||
// ensure save on clean close / reload (best-effort, reload preserves via FileView anyway)
|
||||
Component.onDestruction: {
|
||||
if (historyFile.path === "") historyFile.path = root._historyPath
|
||||
historyFile.adapter.percentageHistory = root.percentageHistory
|
||||
historyFile.adapter.energyHistory = root.energyHistory
|
||||
historyFile.adapter.usageHistory = root.usageHistory
|
||||
historyFile.writeAdapter()
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Networking
|
||||
import "../../../../config"
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
@@ -38,6 +39,62 @@ QtObject {
|
||||
|
||||
readonly property var networking: Networking
|
||||
|
||||
// ---- persistence: survives reload AND close (disk) ----
|
||||
// use Config.configDir (base dir) so path is stable and visible in repo
|
||||
readonly property string _historyPath: Config.configDir + "/modules/bar/states/Network/network_history.json"
|
||||
// guard: don't try to read non-existent file
|
||||
property Process historyFileExistsCheck: Process {
|
||||
command: ["test", "-f", root._historyPath]
|
||||
onExited: function(exitCode, exitStatus) {
|
||||
if (exitCode === 0) root.historyFile.path = root._historyPath
|
||||
}
|
||||
Component.onCompleted: running = true
|
||||
}
|
||||
// QtObject has no default property, so hold FileView as typed property
|
||||
property FileView historyFile: FileView {
|
||||
printErrors: false
|
||||
adapter: JsonAdapter {
|
||||
property var downloadHistory: []
|
||||
property var uploadHistory: []
|
||||
property var pingHistory: []
|
||||
}
|
||||
onLoaded: {
|
||||
function prune(arr) {
|
||||
if (!arr || typeof arr.length !== "number" || arr.length===0) return null
|
||||
const f = arr.filter(p => p && typeof p.time==="number" && typeof p.value==="number")
|
||||
if (f.length < 2) return null
|
||||
return f.length > root._maxHistory ? f.slice(-root._maxHistory) : f
|
||||
}
|
||||
const d = prune(adapter.downloadHistory)
|
||||
if (d) root.downloadHistory = d
|
||||
const u = prune(adapter.uploadHistory)
|
||||
if (u) root.uploadHistory = u
|
||||
const p = prune(adapter.pingHistory)
|
||||
if (p) root.pingHistory = p
|
||||
}
|
||||
onLoadFailed: {} // first run
|
||||
}
|
||||
// periodic save every 10s (restart-debounce would never fire while statsTimer pushes every 1s)
|
||||
property Timer saveTimer: Timer {
|
||||
interval: 10000
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered: {
|
||||
if (root.historyFile.path === "") root.historyFile.path = root._historyPath
|
||||
root.historyFile.adapter.downloadHistory = root.downloadHistory
|
||||
root.historyFile.adapter.uploadHistory = root.uploadHistory
|
||||
root.historyFile.adapter.pingHistory = root.pingHistory
|
||||
root.historyFile.writeAdapter()
|
||||
}
|
||||
}
|
||||
Component.onDestruction: {
|
||||
if (root.historyFile.path === "") root.historyFile.path = root._historyPath
|
||||
root.historyFile.adapter.downloadHistory = root.downloadHistory
|
||||
root.historyFile.adapter.uploadHistory = root.uploadHistory
|
||||
root.historyFile.adapter.pingHistory = root.pingHistory
|
||||
root.historyFile.writeAdapter()
|
||||
}
|
||||
|
||||
function findAllConnectedDevices() {
|
||||
var devs = networking.devices.values
|
||||
var result = []
|
||||
@@ -70,7 +127,8 @@ QtObject {
|
||||
var nets = dev.networks.values
|
||||
for (var j = 0; j < nets.length; j++) {
|
||||
if (nets[j].connected) {
|
||||
sig += ":" + nets[j].name
|
||||
// include signalStrength & name so hover updates live on signal change
|
||||
sig += ":" + nets[j].name + ":" + Math.round(nets[j].signalStrength*100)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import "../../../config"
|
||||
import "../states/Battery"
|
||||
|
||||
@@ -24,7 +23,7 @@ MouseArea {
|
||||
|
||||
Text {
|
||||
id: batteryText
|
||||
visible : !expanded
|
||||
visible : !batteryButton.expanded
|
||||
anchors.centerIn: parent
|
||||
text:(
|
||||
BatteryState.percentage >= 90 ? "" :
|
||||
@@ -49,7 +48,7 @@ MouseArea {
|
||||
|
||||
Text {
|
||||
id: chargeIcon
|
||||
visible : !expanded && BatteryState.charging
|
||||
visible : !batteryButton.expanded && BatteryState.charging
|
||||
anchors.centerIn: parent
|
||||
text: ""
|
||||
font.pixelSize: Config.iconSize(batteryButton.height)
|
||||
@@ -61,7 +60,7 @@ MouseArea {
|
||||
|
||||
Row {
|
||||
id: expandedRow
|
||||
visible: expanded
|
||||
visible: batteryButton.expanded
|
||||
anchors.centerIn: parent
|
||||
spacing: Config.bar_spacing_fun(batteryButton.height)
|
||||
|
||||
@@ -100,7 +99,7 @@ MouseArea {
|
||||
|
||||
Text {
|
||||
id: batteryPercentageText
|
||||
text: BatteryState.percentage + "%"
|
||||
text: Math.round(BatteryState.percentage) + "%"
|
||||
|
||||
font.pixelSize: Config.labelSize(batteryButton.height)
|
||||
font.family: Config.font
|
||||
@@ -125,44 +124,87 @@ MouseArea {
|
||||
radiusValue: Config.radius_fun(batteryButton.height)
|
||||
|
||||
Column {
|
||||
spacing: parent.spacing
|
||||
spacing: batteryPopup.spacingValue
|
||||
Text {
|
||||
text: "percentage: " + BatteryState.percentage + "%"
|
||||
text: "State: " + BatteryState.chargeState
|
||||
wrapMode: Text.WordWrap
|
||||
color: Colors.primary
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
font.pixelSize: Config.font_size_tiny(bar.height)
|
||||
font.family: Config.font
|
||||
}
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 2
|
||||
visible: BatteryState.percentageHistoryExists
|
||||
|
||||
Text {
|
||||
text: "State: " + BatteryState.state
|
||||
wrapMode: Text.WordWrap
|
||||
text: "percentage: " + Math.round(BatteryState.percentage) + "%"
|
||||
color: Colors.primary
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
font.pixelSize: Config.font_size_tiny(bar.height)
|
||||
font.family: Config.font
|
||||
}
|
||||
|
||||
Sparkline {
|
||||
values: BatteryState.percentageHistory
|
||||
lineColor: Colors.primary
|
||||
width: parent.width
|
||||
windowMs: BatteryState._maxHistory * 1000
|
||||
}
|
||||
}
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 2
|
||||
visible: BatteryState.energyHistoryExists
|
||||
|
||||
Text {
|
||||
text: "energy: " + Math.round(BatteryState.energy*10)/10 + " W"
|
||||
wrapMode: Text.WordWrap
|
||||
text: "energy: " + BatteryState.energy_formated + " Wh"
|
||||
color: Colors.primary
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
font.pixelSize: Config.font_size_tiny(bar.height)
|
||||
font.family: Config.font
|
||||
}
|
||||
Text {
|
||||
text: (
|
||||
BatteryState.hour_to_empty > 0 ? "Remaining: " + BatteryState.hour_to_empty + "h " + BatteryState.min_to_empty + "min" :
|
||||
BatteryState.min_to_empty > 0 ? "Remaining: " + BatteryState.min_to_empty + "min" :
|
||||
"NaN")
|
||||
wrapMode: Text.WordWrap
|
||||
color: Colors.primary
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
font.pixelSize: Config.font_size_tiny(bar.height)
|
||||
font.family: Config.font
|
||||
|
||||
Sparkline {
|
||||
values: BatteryState.energyHistory
|
||||
lineColor: Colors.primary
|
||||
width: parent.width
|
||||
windowMs: BatteryState._maxHistory * 1000
|
||||
}
|
||||
}
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 2
|
||||
visible: BatteryState.usageHistoryExists
|
||||
|
||||
Text {
|
||||
text: "Usage: " + BatteryState.energy_rate_formated + " W"
|
||||
color: Colors.primary
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
font.pixelSize: Config.font_size_tiny(bar.height)
|
||||
font.family: Config.font
|
||||
}
|
||||
|
||||
Sparkline {
|
||||
values: BatteryState.usageHistory
|
||||
lineColor: Colors.primary
|
||||
width: parent.width
|
||||
windowMs: BatteryState._maxHistory * 1000
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: {
|
||||
if (BatteryState.charging) {
|
||||
if (BatteryState.hour_to_full > 0) return "Remaining: " + BatteryState.hour_to_full + "h " + BatteryState.min_to_full + "min (to full)"
|
||||
if (BatteryState.min_to_full > 0) return "Remaining: " + BatteryState.min_to_full + "min (to full)"
|
||||
return BatteryState.full ? "Fully charged" : "Calculating..."
|
||||
} else {
|
||||
if (BatteryState.hour_to_empty > 0) return "Remaining: " + BatteryState.hour_to_empty + "h " + BatteryState.min_to_empty + "min"
|
||||
if (BatteryState.min_to_empty > 0) return "Remaining: " + BatteryState.min_to_empty + "min"
|
||||
return "Calculating..."
|
||||
}
|
||||
}
|
||||
wrapMode: Text.WordWrap
|
||||
color: Colors.primary
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
@@ -170,7 +212,7 @@ MouseArea {
|
||||
font.family: Config.font
|
||||
}
|
||||
Text {
|
||||
text: "Health: " + BatteryState.health + " %"
|
||||
text: "Health: " + Math.round(BatteryState.health) + " %"
|
||||
visible: BatteryState.healthSupported
|
||||
wrapMode: Text.WordWrap
|
||||
color: Colors.primary
|
||||
|
||||
@@ -94,8 +94,8 @@ Rectangle {
|
||||
height: Math.max(iconRectangle.height, contentRectangle.height)+contentRow.anchors.margins*2
|
||||
width: parent.width
|
||||
color: "transparent"
|
||||
border.width: Config.border_width
|
||||
border.color: textColor
|
||||
// border.width: Config.border_width
|
||||
// border.color: textColor
|
||||
|
||||
MouseArea {
|
||||
id: closingMouseArea
|
||||
@@ -251,8 +251,8 @@ Rectangle {
|
||||
id: actionRowRectangle
|
||||
width: root.width
|
||||
height: Config.screen_height_to_font_tiny(screen.height)+2*Config.spacing
|
||||
border.width: Config.border_width
|
||||
border.color: textColor
|
||||
// border.width: Config.border_width
|
||||
// border.color: textColor
|
||||
color: "transparent"
|
||||
visible: notification.actions.length > 0
|
||||
Row{
|
||||
@@ -336,8 +336,8 @@ Rectangle {
|
||||
id: inlineReplyRectangle
|
||||
width: root.width
|
||||
height: Config.screen_height_to_font_small(screen.height)+2*Config.spacing
|
||||
border.width: Config.border_width
|
||||
border.color: textColor
|
||||
// border.width: Config.border_width
|
||||
// border.color: textColor
|
||||
color: "transparent"
|
||||
visible: notification.hasInlineReply
|
||||
|
||||
|
||||
@@ -65,23 +65,13 @@ PanelWindow {
|
||||
}
|
||||
|
||||
function closeNHistory() {
|
||||
// Centralized close via singleton signal – fixes previous ReferenceError
|
||||
// where this file tried to access notifificationHistoryLoader.id directly
|
||||
// (that id lives in NotificationHistoryLoader.qml and is not in scope here).
|
||||
console.log("[NotificationHistory] closeNHistory() requested")
|
||||
NotificationS.historyHovered = false
|
||||
NotificationS.closeHistoryRequested()
|
||||
}
|
||||
|
||||
// ── Hover tracking via NotificationServer ──
|
||||
// History reports its hover state via background HoverHandler (non-exclusive)
|
||||
// so hovering over inner buttons (closeArea, clearGroupArea, NotificationBody)
|
||||
// does NOT clear historyHovered. Timer auto-closes when neither history nor
|
||||
// bar button is hovered for historyAutoCloseDelay ms.
|
||||
property bool _allowAutoClose: false
|
||||
|
||||
// Grace timer: don't allow auto-close immediately after opening,
|
||||
// giving keyboard users time to move mouse to history.
|
||||
Timer {
|
||||
id: graceTimer
|
||||
interval: 500
|
||||
@@ -93,7 +83,6 @@ PanelWindow {
|
||||
Timer {
|
||||
id: hoverCloseTimer
|
||||
interval: NotificationS.historyAutoCloseDelay
|
||||
// Only run when panel is visible, grace passed, and neither element is hovered
|
||||
running: root.visible && _allowAutoClose && !NotificationS.historyHovered && !NotificationS.buttonHovered
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
@@ -104,7 +93,6 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure hover state is cleared when window hides/destroys
|
||||
onVisibleChanged: {
|
||||
if (!visible) {
|
||||
NotificationS.historyHovered = false
|
||||
@@ -124,12 +112,6 @@ PanelWindow {
|
||||
root.closeNHistory()
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "lightblue"
|
||||
visible: false // debug helper, keep hidden in normal use
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -141,13 +123,7 @@ PanelWindow {
|
||||
border.color: textColor
|
||||
radius: Config.screen_big_radius_fun(screen.height)
|
||||
|
||||
// HoverHandler on background (parent of all history UI) stays hovered
|
||||
// when pointer is over any descendant (topBar buttons, NotificationBody etc.)
|
||||
// because HoverHandler is non-blocking PointerHandler and tracks parent
|
||||
// bounds rather than exclusive MouseArea containsMouse. This fixes bug
|
||||
// where hovering over inner buttons made historyHovered false and triggered
|
||||
// auto-close. Using CanTakeOverFromAnything ensures it isn't blocked by
|
||||
// child MouseAreas.
|
||||
|
||||
HoverHandler {
|
||||
id: backgroundHoverHandler
|
||||
blocking: false
|
||||
@@ -158,15 +134,6 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
// Component.onCompleted: {
|
||||
// for (var notification in NotificationS.trackedNotifications.values) {
|
||||
// console.log("[NotificationHistory]: " + notification.appName + " Notifications")
|
||||
// }
|
||||
// for (var i =0; i < NotificationS.notificationNum; i++) {
|
||||
// console.log("[NotificationHistory]: " + NotificationS.trackedNotifications.values[i].appName + " Notifications")
|
||||
// }
|
||||
// }
|
||||
|
||||
Column{
|
||||
id: bgColumn
|
||||
anchors.fill: parent
|
||||
@@ -197,12 +164,6 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
// Row{
|
||||
// id: backgroundCenter
|
||||
// anchors.centerIn: parent
|
||||
// spacing: Config.screen_small_bar_spacing_fun(screen.height)
|
||||
// }
|
||||
|
||||
Row{
|
||||
id: backgroundRight
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -224,6 +185,15 @@ PanelWindow {
|
||||
implicitHeight: topBar.height*0.75
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: NotificationS.notificationPopupEnabled
|
||||
hoverEnabled: true
|
||||
|
||||
HoverHandler {
|
||||
id: switchHoverHandler
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
blocking: false
|
||||
grabPermissions: PointerHandler.CanTakeOverFromAnything
|
||||
onHoveredChanged: if (hovered) NotificationS.historyHovered = true
|
||||
}
|
||||
|
||||
indicator: Rectangle {
|
||||
implicitWidth: notificationVolumeSwitch.width
|
||||
@@ -272,8 +242,7 @@ PanelWindow {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
// Safety: hovering over button should keep history considered hovered
|
||||
// even if background HoverHandler is blocked (exclusive hover)
|
||||
|
||||
onContainsMouseChanged: if (containsMouse) NotificationS.historyHovered = true
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
@@ -291,7 +260,6 @@ PanelWindow {
|
||||
}
|
||||
onClicked: {
|
||||
root.clearAll()
|
||||
// closeNHistory()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,7 +267,7 @@ PanelWindow {
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height - topBar.height - bgColumn.spacing //- bgColumn.anchors.margins*2
|
||||
height: parent.height - topBar.height - bgColumn.spacing
|
||||
color: textBGColor
|
||||
radius: Config.screen_big_radius_fun(screen.height)
|
||||
border.width: Config.border_width
|
||||
@@ -330,12 +298,6 @@ PanelWindow {
|
||||
width: flick.width
|
||||
spacing: Config.spacing
|
||||
|
||||
// ── Grouped view (only groups with >1 notification are grouped) ──
|
||||
// Uses root.grouped (sorted by appName). Each app group with
|
||||
// more than one notification is rendered as a collapsible
|
||||
// card with a header (appName + count + expand/collapse +
|
||||
// clear-group). Singletons are rendered directly as a
|
||||
// NotificationBody without a header.
|
||||
Repeater {
|
||||
id: groupedRepeater
|
||||
model: root.grouped
|
||||
@@ -348,19 +310,15 @@ PanelWindow {
|
||||
property bool isExpanded: root.expandedGroups[group.appName] === true
|
||||
|
||||
width: contentColumn.width
|
||||
// height adapts to which component is visible
|
||||
implicitHeight: isGrouped ? groupedCard.implicitHeight : singleBody.implicitHeight
|
||||
height: implicitHeight
|
||||
|
||||
// Keep history hovered when pointer is over this delegate
|
||||
// (covers NotificationBody and its inner buttons).
|
||||
HoverHandler {
|
||||
blocking: false
|
||||
grabPermissions: PointerHandler.CanTakeOverFromAnything
|
||||
onHoveredChanged: if (hovered) NotificationS.historyHovered = true
|
||||
}
|
||||
|
||||
// ── Singleton: plain NotificationBody ──
|
||||
NotificationBody {
|
||||
id: singleBody
|
||||
visible: !delegateRoot.isGrouped
|
||||
@@ -374,7 +332,6 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Grouped card (count > 1) ──
|
||||
Rectangle {
|
||||
id: groupedCard
|
||||
visible: delegateRoot.isGrouped
|
||||
|
||||
Reference in New Issue
Block a user