mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Notification: add transparency slider (implements #586)
This commit is contained in:
@@ -185,9 +185,9 @@ Variants {
|
||||
Layout.maximumHeight: Layout.preferredHeight
|
||||
|
||||
radius: Style.radiusL
|
||||
border.color: Color.mOutline
|
||||
border.color: Qt.alpha(Color.mOutline, Settings.data.notifications.backgroundOpacity || 1.0)
|
||||
border.width: Style.borderS
|
||||
color: Color.mSurface
|
||||
color: Qt.alpha(Color.mSurface, Settings.data.notifications.backgroundOpacity || 1.0)
|
||||
|
||||
// Optimized progress bar container
|
||||
Rectangle {
|
||||
@@ -212,12 +212,14 @@ Variants {
|
||||
width: parent.availableWidth * model.progress
|
||||
|
||||
color: {
|
||||
var baseColor
|
||||
if (model.urgency === NotificationUrgency.Critical || model.urgency === 2)
|
||||
return Color.mError
|
||||
baseColor = Color.mError
|
||||
else if (model.urgency === NotificationUrgency.Low || model.urgency === 0)
|
||||
return Color.mOnSurface
|
||||
baseColor = Color.mOnSurface
|
||||
else
|
||||
return Color.mPrimary
|
||||
baseColor = Color.mPrimary
|
||||
return Qt.alpha(baseColor, Settings.data.notifications.backgroundOpacity || 1.0)
|
||||
}
|
||||
|
||||
antialiasing: true
|
||||
|
||||
@@ -72,6 +72,27 @@ ColumnLayout {
|
||||
onToggled: checked => Settings.data.notifications.overlayLayer = checked
|
||||
}
|
||||
|
||||
// Background Opacity
|
||||
ColumnLayout {
|
||||
spacing: Style.marginXXS
|
||||
Layout.fillWidth: true
|
||||
|
||||
NLabel {
|
||||
label: I18n.tr("settings.notifications.settings.background-opacity.label")
|
||||
description: I18n.tr("settings.notifications.settings.background-opacity.description")
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
Layout.fillWidth: true
|
||||
from: 0
|
||||
to: 100
|
||||
stepSize: 1
|
||||
value: Settings.data.notifications.backgroundOpacity * 100
|
||||
onMoved: value => Settings.data.notifications.backgroundOpacity = value / 100
|
||||
text: Math.round(Settings.data.notifications.backgroundOpacity * 100) + "%"
|
||||
}
|
||||
}
|
||||
|
||||
// OSD settings moved to the dedicated OSD tab
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user