Repository navigation
Critical Actions #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Critical Actions #166
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
8e526ba
feat(battery): add screen-edge countdown overlay with layout struts
Abscissa24 65a4fbc
feat(battery): show live countdown row and dismiss card on plug-in an…
Abscissa24 bd03a24
feat(battery): add critical-action countdown state machine and dispatch
Abscissa24 6c64d4b
feat(config): add criticalActionEnabled, criticalActionDelay and crit…
Abscissa24 3b81b38
feat(settings): add Critical actions section to Power settings
Abscissa24 353467d
feat(shell): load CriticalBatteryOverlay
Abscissa24 15f5192
refactor(settings): drop Lock screen from critical action options
Abscissa24 2a95adb
refactor(battery): remove lock handling from critical action dispatch
Abscissa24 9d480f6
feat(overlay): border-only countdown loop with no window reservations
Abscissa24 387920e
feat(bar): keep bar static during critical-battery countdown
Abscissa24 75bc87b
feat(config): countdown overlay appearance options
Abscissa24 4f9acf4
feat(settings): critical charge behaviour section with appearance con…
Abscissa24 5c3cc2f
feat(battery): explicit suspend action with unknown fallback label
Abscissa24 5aab2cc
feat(bar): keep bar static during critical-battery countdown
Abscissa24 c8af5ed
fix(bar): keep top bar stationary during critical countdown
Abscissa24 004d830
feat(battery): simplify overlay checks
Abscissa24 bccf17f
feat(bar): add properties for island, autoHide, and reserveSpace
Abscissa24 5d43696
feat(battery): optimise critical action handling in Battery.qml
Abscissa24 acdfca3
faet(battery): optimise CriticalBatteryOverlay.qml to use EdgePath
Abscissa24 264b109
feat(shell): update theme loader file path in shell.qml
Abscissa24 66837c8
feat(sleex-core): emit prepareForSleep on sleep and resume
Abscissa24 2a93962
feat(sleex-core): expose prepareForSleep signal
Abscissa24 abb1b1d
Adjust critical overlay properties in Config.qml
Abscissa24 1310a49
feat(overlay): change exclusiveZone value to -1
Abscissa24 29c8541
feat(overlay): change WlrLayer from Overlay to Top
Abscissa24 63a43fd
fix(BatteryPopup): fix critical state handling
Abscissa24 09b3572
feat(config): adjust critical overlay default properties
Abscissa24 986ba5a
feat(rules): add 'Choose' dialog pattern and update layer rules
Abscissa24 840a0d8
Merge remote-tracking branch 'origin/main' into Critical-Actions
Abscissa24 f4214ae
perf(overlay): render the countdown border with the curve renderer
Abscissa24 f17d8dd
Merge remote-tracking branch 'origin/main' into Critical-Actions
Abscissa24 37f16fb
fix(overlay): align the border fallbacks with the config defaults
Abscissa24 93400fd
build: require Qt 6.10
Abscissa24 5cbc6b7
perf(battery): only rebuild the countdown label once a second
Abscissa24 37c8f27
build: keep the Qt requirement at 6.9
Abscissa24 25b35a9
fix(overlay): paint the countdown border with the error colour
Abscissa24 ce57b46
fix(overlay): keep the countdown border in the accent colour
Abscissa24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| import qs | ||
| import qs.modules.common | ||
| import qs.services | ||
| import SleexUiKit.Appearance | ||
| import QtQuick | ||
| import Quickshell | ||
| import Quickshell.Wayland | ||
| import QtQuick.Shapes | ||
|
|
||
| Scope { | ||
| id: root | ||
|
|
||
| // Fallbacks mirror the defaults in modules/common/Config.qml. | ||
| property int borderThick: Config.options.battery.criticalOverlayBorderThick ?? 5 | ||
| property int pathInset: Config.options.battery.criticalOverlayPathInset ?? 0 | ||
| property int cornerRadius: Config.options.battery.criticalOverlayCornerRadius ?? 25 | ||
|
|
||
| Variants { | ||
| model: Quickshell.screens | ||
|
|
||
| PanelWindow { | ||
| id: win | ||
| required property var modelData | ||
| screen: modelData | ||
|
|
||
| readonly property real prog: Battery.criticalActionProgress | ||
|
|
||
| visible: Battery.criticalActionWanted | ||
| color: "transparent" | ||
|
|
||
| anchors { top: true; bottom: true; left: true; right: true } | ||
| exclusiveZone: -1 | ||
| WlrLayershell.layer: WlrLayer.Top | ||
| WlrLayershell.namespace: "quickshell:criticalaction" | ||
| WlrLayershell.keyboardFocus: WlrKeyboardFocus.None | ||
| mask: Region { } | ||
|
|
||
| readonly property real halfThick: root.borderThick / 2 | ||
| readonly property real radius: root.cornerRadius | ||
| readonly property real lineLeft: root.pathInset + halfThick | ||
| readonly property real lineTop: root.pathInset + halfThick | ||
| readonly property real lineRight: win.width - root.pathInset - halfThick | ||
| readonly property real lineBottom: win.height - root.pathInset - halfThick | ||
|
|
||
| component EdgePath: ShapePath { | ||
| strokeWidth: root.borderThick | ||
| strokeColor: Appearance.colors.colPrimary | ||
| fillColor: "transparent" | ||
| capStyle: ShapePath.RoundCap | ||
| joinStyle: ShapePath.MiterJoin | ||
|
|
||
| PathMove { x: win.width / 2; y: win.lineTop } | ||
| PathLine { x: win.lineRight - win.radius; y: win.lineTop } | ||
| PathAngleArc { | ||
| centerX: win.lineRight - win.radius | ||
| centerY: win.lineTop + win.radius | ||
| radiusX: win.radius | ||
| radiusY: win.radius | ||
| startAngle: -90 | ||
| sweepAngle: 90 | ||
| } | ||
| PathLine { x: win.lineRight; y: win.lineBottom - win.radius } | ||
| PathAngleArc { | ||
| centerX: win.lineRight - win.radius | ||
| centerY: win.lineBottom - win.radius | ||
| radiusX: win.radius | ||
| radiusY: win.radius | ||
| startAngle: 0 | ||
| sweepAngle: 90 | ||
| } | ||
| PathLine { x: win.lineLeft + win.radius; y: win.lineBottom } | ||
| PathAngleArc { | ||
| centerX: win.lineLeft + win.radius | ||
| centerY: win.lineBottom - win.radius | ||
| radiusX: win.radius | ||
| radiusY: win.radius | ||
| startAngle: 90 | ||
| sweepAngle: 90 | ||
| } | ||
| PathLine { x: win.lineLeft; y: win.lineTop + win.radius } | ||
| PathAngleArc { | ||
| centerX: win.lineLeft + win.radius | ||
| centerY: win.lineTop + win.radius | ||
| radiusX: win.radius | ||
| radiusY: win.radius | ||
| startAngle: 180 | ||
| sweepAngle: 90 | ||
| } | ||
| PathLine { x: win.width / 2; y: win.lineTop } | ||
| } | ||
|
|
||
| Shape { | ||
| id: trackShape | ||
| anchors.fill: parent | ||
| visible: Battery.criticalActionWanted | ||
| antialiasing: true | ||
|
|
||
| // The curve renderer antialiases the strokes on the GPU, so the | ||
| // shapes need no offscreen buffer of their own. layer.enabled | ||
| // would allocate a full screen sized (and, with layer.samples, | ||
| // multisampled) texture for each of them. | ||
| preferredRendererType: Shape.CurveRenderer | ||
| opacity: 0.15 | ||
| EdgePath { } | ||
| } | ||
| Shape { | ||
| id: snakeShape | ||
| anchors.fill: parent | ||
| visible: Battery.criticalActionWanted | ||
| antialiasing: true | ||
|
|
||
| preferredRendererType: Shape.CurveRenderer | ||
| EdgePath { | ||
| // ShapePath.trim is a property group (QQuickShapeTrim) that | ||
| // holds fractions of the path length, so the snake stroke | ||
| // grows along the border as the countdown runs. | ||
| trim.start: 0 | ||
| trim.end: Math.max(win.prog, 0.002) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Abscissa24 marked this conversation as resolved.
Resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.