fix: EVEN MORE non global access
Also Tokens.sizes.notifs.image -> global
This commit is contained in:
parent
0571adc80c
commit
982bb9759a
7 changed files with 32 additions and 32 deletions
|
|
@ -20,7 +20,7 @@ Searcher {
|
||||||
Variants {
|
Variants {
|
||||||
id: variants
|
id: variants
|
||||||
|
|
||||||
model: Config.launcher.actions.filter(a => (a.enabled ?? true) && (GlobalConfig.launcher.enableDangerousActions || !(a.dangerous ?? false)))
|
model: GlobalConfig.launcher.actions.filter(a => (a.enabled ?? true) && (GlobalConfig.launcher.enableDangerousActions || !(a.dangerous ?? false)))
|
||||||
|
|
||||||
Action {}
|
Action {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,8 @@ StyledRect {
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
||||||
implicitWidth: Tokens.sizes.notifs.image
|
implicitWidth: TokenConfig.sizes.notifs.image
|
||||||
implicitHeight: Tokens.sizes.notifs.image
|
implicitHeight: TokenConfig.sizes.notifs.image
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: imageComp
|
id: imageComp
|
||||||
|
|
@ -73,12 +73,12 @@ StyledRect {
|
||||||
Image {
|
Image {
|
||||||
source: Qt.resolvedUrl(root.image)
|
source: Qt.resolvedUrl(root.image)
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: Tokens.sizes.notifs.image
|
sourceSize.width: TokenConfig.sizes.notifs.image
|
||||||
sourceSize.height: Tokens.sizes.notifs.image
|
sourceSize.height: TokenConfig.sizes.notifs.image
|
||||||
cache: false
|
cache: false
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
width: Tokens.sizes.notifs.image
|
width: TokenConfig.sizes.notifs.image
|
||||||
height: Tokens.sizes.notifs.image
|
height: TokenConfig.sizes.notifs.image
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -86,7 +86,7 @@ StyledRect {
|
||||||
id: appIconComp
|
id: appIconComp
|
||||||
|
|
||||||
ColouredIcon {
|
ColouredIcon {
|
||||||
implicitSize: Math.round(Tokens.sizes.notifs.image * 0.6)
|
implicitSize: Math.round(TokenConfig.sizes.notifs.image * 0.6)
|
||||||
source: Quickshell.iconPath(root.appIcon)
|
source: Quickshell.iconPath(root.appIcon)
|
||||||
colour: root.urgency === "critical" ? Colours.palette.m3onError : root.urgency === "low" ? Colours.palette.m3onSurface : Colours.palette.m3onSecondaryContainer
|
colour: root.urgency === "critical" ? Colours.palette.m3onError : root.urgency === "low" ? Colours.palette.m3onSurface : Colours.palette.m3onSecondaryContainer
|
||||||
layer.enabled: root.appIcon.endsWith("symbolic")
|
layer.enabled: root.appIcon.endsWith("symbolic")
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ Item {
|
||||||
Anim {
|
Anim {
|
||||||
target: notif
|
target: notif
|
||||||
property: "x"
|
property: "x"
|
||||||
to: (notif.x >= 0 ? Tokens.sizes.notifs.width : -Tokens.sizes.notifs.width) * 2
|
to: (notif.x >= 0 ? wrapper.Tokens.sizes.notifs.width : -wrapper.Tokens.sizes.notifs.width) * 2
|
||||||
duration: Tokens.anim.durations.normal
|
duration: Tokens.anim.durations.normal
|
||||||
easing: Tokens.anim.emphasized
|
easing: Tokens.anim.emphasized
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,21 +114,21 @@ StyledRect {
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
width: Tokens.sizes.notifs.image
|
width: TokenConfig.sizes.notifs.image
|
||||||
height: Tokens.sizes.notifs.image
|
height: TokenConfig.sizes.notifs.image
|
||||||
visible: root.hasImage || root.hasAppIcon
|
visible: root.hasImage || root.hasAppIcon
|
||||||
|
|
||||||
sourceComponent: ClippingRectangle {
|
sourceComponent: ClippingRectangle {
|
||||||
radius: Tokens.rounding.full
|
radius: Tokens.rounding.full
|
||||||
implicitWidth: Tokens.sizes.notifs.image
|
implicitWidth: TokenConfig.sizes.notifs.image
|
||||||
implicitHeight: Tokens.sizes.notifs.image
|
implicitHeight: TokenConfig.sizes.notifs.image
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: Qt.resolvedUrl(root.modelData.image)
|
source: Qt.resolvedUrl(root.modelData.image)
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: Tokens.sizes.notifs.image
|
sourceSize.width: TokenConfig.sizes.notifs.image
|
||||||
sourceSize.height: Tokens.sizes.notifs.image
|
sourceSize.height: TokenConfig.sizes.notifs.image
|
||||||
cache: false
|
cache: false
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
}
|
}
|
||||||
|
|
@ -149,8 +149,8 @@ StyledRect {
|
||||||
sourceComponent: StyledRect {
|
sourceComponent: StyledRect {
|
||||||
radius: Tokens.rounding.full
|
radius: Tokens.rounding.full
|
||||||
color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3error : root.modelData.urgency === NotificationUrgency.Low ? Colours.layer(Colours.palette.m3surfaceContainerHighest, 2) : Colours.palette.m3secondaryContainer
|
color: root.modelData.urgency === NotificationUrgency.Critical ? Colours.palette.m3error : root.modelData.urgency === NotificationUrgency.Low ? Colours.layer(Colours.palette.m3surfaceContainerHighest, 2) : Colours.palette.m3secondaryContainer
|
||||||
implicitWidth: root.hasImage ? Tokens.sizes.notifs.badge : Tokens.sizes.notifs.image
|
implicitWidth: root.hasImage ? Tokens.sizes.notifs.badge : TokenConfig.sizes.notifs.image
|
||||||
implicitHeight: root.hasImage ? Tokens.sizes.notifs.badge : Tokens.sizes.notifs.image
|
implicitHeight: root.hasImage ? Tokens.sizes.notifs.badge : TokenConfig.sizes.notifs.image
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
@ -251,7 +251,7 @@ StyledRect {
|
||||||
font.family: appName.font.family
|
font.family: appName.font.family
|
||||||
font.pointSize: appName.font.pointSize
|
font.pointSize: appName.font.pointSize
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
elideWidth: expandBtn.x - time.width - timeSep.width - summary.x - Tokens.spacing.small * 3
|
elideWidth: expandBtn.x - time.width - timeSep.width - summary.x - root.Tokens.spacing.small * 3
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -303,7 +303,7 @@ StyledRect {
|
||||||
font.family: summary.font.family
|
font.family: summary.font.family
|
||||||
font.pointSize: summary.font.pointSize
|
font.pointSize: summary.font.pointSize
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
elideWidth: expandBtn.x - time.width - timeSep.width - summary.x - Tokens.spacing.small * 3
|
elideWidth: expandBtn.x - time.width - timeSep.width - summary.x - root.Tokens.spacing.small * 3
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
|
@ -516,7 +516,7 @@ StyledRect {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
elideWidth: {
|
elideWidth: {
|
||||||
const numActions = root.modelData.actions.length + 1;
|
const numActions = root.modelData.actions.length + 1;
|
||||||
return (inner.width - actions.spacing * (numActions - 1)) / numActions - Tokens.padding.normal * 2;
|
return (inner.width - actions.spacing * (numActions - 1)) / numActions - root.Tokens.padding.normal * 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ StyledRect {
|
||||||
readonly property int nonAnimHeight: {
|
readonly property int nonAnimHeight: {
|
||||||
const headerHeight = header.implicitHeight + (root.expanded ? Math.round(Tokens.spacing.small / 2) : 0);
|
const headerHeight = header.implicitHeight + (root.expanded ? Math.round(Tokens.spacing.small / 2) : 0);
|
||||||
const columnHeight = headerHeight + notifList.layoutHeight + column.Layout.topMargin + column.Layout.bottomMargin;
|
const columnHeight = headerHeight + notifList.layoutHeight + column.Layout.topMargin + column.Layout.bottomMargin;
|
||||||
return Math.round(Math.max(Tokens.sizes.notifs.image, columnHeight) + Tokens.padding.normal * 2);
|
return Math.round(Math.max(TokenConfig.sizes.notifs.image, columnHeight) + Tokens.padding.normal * 2);
|
||||||
}
|
}
|
||||||
readonly property bool expanded: props.expandedNotifs.includes(modelData)
|
readonly property bool expanded: props.expandedNotifs.includes(modelData)
|
||||||
|
|
||||||
|
|
@ -91,8 +91,8 @@ StyledRect {
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
||||||
implicitWidth: Tokens.sizes.notifs.image
|
implicitWidth: TokenConfig.sizes.notifs.image
|
||||||
implicitHeight: Tokens.sizes.notifs.image
|
implicitHeight: TokenConfig.sizes.notifs.image
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: imageComp
|
id: imageComp
|
||||||
|
|
@ -100,12 +100,12 @@ StyledRect {
|
||||||
Image {
|
Image {
|
||||||
source: Qt.resolvedUrl(root.image)
|
source: Qt.resolvedUrl(root.image)
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: Tokens.sizes.notifs.image
|
sourceSize.width: TokenConfig.sizes.notifs.image
|
||||||
sourceSize.height: Tokens.sizes.notifs.image
|
sourceSize.height: TokenConfig.sizes.notifs.image
|
||||||
cache: false
|
cache: false
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
width: Tokens.sizes.notifs.image
|
width: TokenConfig.sizes.notifs.image
|
||||||
height: Tokens.sizes.notifs.image
|
height: TokenConfig.sizes.notifs.image
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,7 +113,7 @@ StyledRect {
|
||||||
id: appIconComp
|
id: appIconComp
|
||||||
|
|
||||||
ColouredIcon {
|
ColouredIcon {
|
||||||
implicitSize: Math.round(Tokens.sizes.notifs.image * 0.6)
|
implicitSize: Math.round(TokenConfig.sizes.notifs.image * 0.6)
|
||||||
source: Quickshell.iconPath(root.appIcon)
|
source: Quickshell.iconPath(root.appIcon)
|
||||||
colour: root.urgency === NotificationUrgency.Critical ? Colours.palette.m3onError : root.urgency === NotificationUrgency.Low ? Colours.palette.m3onSurface : Colours.palette.m3onSecondaryContainer
|
colour: root.urgency === NotificationUrgency.Critical ? Colours.palette.m3onError : root.urgency === NotificationUrgency.Low ? Colours.palette.m3onSurface : Colours.palette.m3onSecondaryContainer
|
||||||
layer.enabled: root.appIcon.endsWith("symbolic")
|
layer.enabled: root.appIcon.endsWith("symbolic")
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ class NotifsTokens : public ConfigObject {
|
||||||
QML_ANONYMOUS
|
QML_ANONYMOUS
|
||||||
|
|
||||||
CONFIG_PROPERTY(int, width, 400)
|
CONFIG_PROPERTY(int, width, 400)
|
||||||
CONFIG_PROPERTY(int, image, 41)
|
CONFIG_GLOBAL_PROPERTY(int, image, 41)
|
||||||
CONFIG_PROPERTY(int, badge, 20)
|
CONFIG_PROPERTY(int, badge, 20)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -54,14 +54,14 @@ QtObject {
|
||||||
// qmllint disable uncreatable-type
|
// qmllint disable uncreatable-type
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
// qmllint enable uncreatable-type
|
// qmllint enable uncreatable-type
|
||||||
implicitWidth: Tokens.sizes.notifs.image
|
implicitWidth: TokenConfig.sizes.notifs.image
|
||||||
implicitHeight: Tokens.sizes.notifs.image
|
implicitHeight: TokenConfig.sizes.notifs.image
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
mask: Region {}
|
mask: Region {}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
function tryCache(): void {
|
function tryCache(): void {
|
||||||
if (status !== Image.Ready || width != Tokens.sizes.notifs.image || height != Tokens.sizes.notifs.image)
|
if (status !== Image.Ready || width != TokenConfig.sizes.notifs.image || height != TokenConfig.sizes.notifs.image)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const cacheKey = notif.appName + notif.summary + notif.id;
|
const cacheKey = notif.appName + notif.summary + notif.id;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue