config: add option to hide notifications on lockscreen (#1211)

This commit is contained in:
八奈見 レイ 2026-03-15 13:02:32 +05:30 committed by GitHub
parent eed6adb0e4
commit e304846421
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 4 deletions

View file

@ -567,7 +567,8 @@ default, you must create it manually.
"hiddenApps": [] "hiddenApps": []
}, },
"lock": { "lock": {
"recolourLogo": false "recolourLogo": false,
"hideNotifs": false
}, },
"notifs": { "notifs": {
"actionOnClick": false, "actionOnClick": false,

View file

@ -395,6 +395,7 @@ Singleton {
recolourLogo: lock.recolourLogo, recolourLogo: lock.recolourLogo,
enableFprint: lock.enableFprint, enableFprint: lock.enableFprint,
maxFprintTries: lock.maxFprintTries, maxFprintTries: lock.maxFprintTries,
hideNotifs: lock.hideNotifs,
sizes: { sizes: {
heightMult: lock.sizes.heightMult, heightMult: lock.sizes.heightMult,
ratio: lock.sizes.ratio, ratio: lock.sizes.ratio,

View file

@ -4,6 +4,7 @@ JsonObject {
property bool recolourLogo: false property bool recolourLogo: false
property bool enableFprint: true property bool enableFprint: true
property int maxFprintTries: 3 property int maxFprintTries: 3
property bool hideNotifs: false
property Sizes sizes: Sizes {} property Sizes sizes: Sizes {}
component Sizes: JsonObject { component Sizes: JsonObject {

View file

@ -41,7 +41,7 @@ ColumnLayout {
Loader { Loader {
anchors.centerIn: parent anchors.centerIn: parent
active: opacity > 0 active: opacity > 0
opacity: Notifs.list.length > 0 ? 0 : 1 opacity: Notifs.list.length > 0 && !Config.lock.hideNotifs ? 0 : 1
sourceComponent: ColumnLayout { sourceComponent: ColumnLayout {
spacing: Appearance.spacing.large spacing: Appearance.spacing.large
@ -61,7 +61,7 @@ ColumnLayout {
StyledText { StyledText {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: qsTr("No Notifications") text: Config.lock.hideNotifs ? qsTr("Unlock for Notifications") : qsTr("No Notifications")
color: Colours.palette.m3outlineVariant color: Colours.palette.m3outlineVariant
font.pointSize: Appearance.font.size.large font.pointSize: Appearance.font.size.large
font.family: Appearance.font.family.mono font.family: Appearance.font.family.mono
@ -78,7 +78,7 @@ ColumnLayout {
StyledListView { StyledListView {
anchors.fill: parent anchors.fill: parent
visible: !Config.lock.hideNotifs
spacing: Appearance.spacing.small spacing: Appearance.spacing.small
clip: true clip: true