Merge branch 'Ly-sec:main' into main

This commit is contained in:
Jose Chasey Pratama 2025-08-03 21:10:18 +07:00 committed by GitHub
commit 59d7d6292a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 78 additions and 118 deletions

View file

@ -1,9 +1,9 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import qs.Components
import qs.Settings
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Widgets import Quickshell.Widgets
import qs.Components
import qs.Settings
PanelWindow { PanelWindow {
id: activeWindowPanel id: activeWindowPanel
@ -121,6 +121,7 @@ PanelWindow {
source: ToplevelManager?.activeToplevel ? getIcon() : "" source: ToplevelManager?.activeToplevel ? getIcon() : ""
visible: Settings.settings.showActiveWindowIcon visible: Settings.settings.showActiveWindowIcon
anchors.verticalCenterOffset: -3 anchors.verticalCenterOffset: -3
} }
Text { Text {

View file

@ -3,9 +3,11 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Wayland
import Quickshell.Widgets
import qs.Components import qs.Components
import qs.Settings import qs.Settings
import Quickshell.Wayland
import "../../Helpers/Fuzzysort.js" as Fuzzysort import "../../Helpers/Fuzzysort.js" as Fuzzysort
PanelWithOverlay { PanelWithOverlay {
@ -342,12 +344,9 @@ PanelWithOverlay {
width: 28 width: 28
height: 28 height: 28
property bool iconLoaded: !modelData.isCalculator && iconImg.status === Image.Ready && iconImg.source !== "" && iconImg.status !== Image.Error property bool iconLoaded: !modelData.isCalculator && iconImg.status === Image.Ready && iconImg.source !== "" && iconImg.status !== Image.Error
Image { IconImage {
id: iconImg id: iconImg
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectFit
smooth: true
cache: false
asynchronous: true asynchronous: true
source: modelData.isCalculator ? "qrc:/icons/calculate.svg" : Quickshell.iconPath(modelData.icon, "application-x-executable") source: modelData.isCalculator ? "qrc:/icons/calculate.svg" : Quickshell.iconPath(modelData.icon, "application-x-executable")
visible: modelData.isCalculator || parent.iconLoaded visible: modelData.isCalculator || parent.iconLoaded

View file

@ -3,6 +3,7 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Widgets
import qs.Settings import qs.Settings
PopupWindow { PopupWindow {
@ -112,12 +113,12 @@ PopupWindow {
elide: Text.ElideRight elide: Text.ElideRight
} }
Image { IconImage {
Layout.preferredWidth: 16 Layout.preferredWidth: 16
Layout.preferredHeight: 16 Layout.preferredHeight: 16
source: modelData?.icon ?? "" source: modelData?.icon ?? ""
visible: (modelData?.icon ?? "") !== "" visible: (modelData?.icon ?? "") !== ""
fillMode: Image.PreserveAspectFit backer.fillMode: Image.PreserveAspectFit
} }
} }

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import Quickshell.Widgets
import qs.Settings import qs.Settings
import qs.Services import qs.Services
import qs.Components import qs.Components
@ -54,10 +55,9 @@ Item {
anchors.margins: 1 anchors.margins: 1
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
smooth: true smooth: true
mipmap: true
cache: false cache: false
asynchronous: true asynchronous: true
sourceSize.width: 24
sourceSize.height: 24
source: MusicManager.trackArtUrl source: MusicManager.trackArtUrl
visible: source.toString() !== "" visible: source.toString() !== ""

View file

@ -74,7 +74,6 @@ Item {
height: Math.max(12, Settings.settings.taskbarIconSize * 0.625) height: Math.max(12, Settings.settings.taskbarIconSize * 0.625)
anchors.centerIn: parent anchors.centerIn: parent
source: getAppIcon(modelData) source: getAppIcon(modelData)
smooth: true
visible: source.toString() !== "" visible: source.toString() !== ""
} }

43
Components/Avatar.qml Normal file
View file

@ -0,0 +1,43 @@
import QtQuick
import Qt5Compat.GraphicalEffects
import Quickshell
import Quickshell.Widgets
import qs.Settings
Item {
anchors.fill: parent
IconImage {
id: avatarImage
anchors.fill: parent
anchors.margins: 2
source: "file://" + Settings.settings.profileImage
visible: false
asynchronous: true
backer.fillMode: Image.PreserveAspectCrop
}
OpacityMask {
anchors.fill: avatarImage
source: avatarImage
maskSource: Rectangle {
width: avatarImage.width
height: avatarImage.height
radius: avatarImage.width / 2
visible: false
}
visible: Settings.settings.profileImage !== ""
}
// Fallback icon
Text {
anchors.centerIn: parent
text: "person"
font.family: "Material Symbols Outlined"
font.pixelSize: 24
color: Theme.onAccent
visible: Settings.settings.profileImage === undefined || Settings.settings.profileImage === ""
z: 0
}
}

View file

@ -35,6 +35,7 @@ ShellRoot {
visible: wallpaperSource !== "" visible: wallpaperSource !== ""
cache: true cache: true
smooth: true smooth: true
mipmap: false
} }
} }
} }

View file

@ -154,7 +154,6 @@ PanelWindow {
height: Math.max(20, Settings.settings.taskbarIconSize * 0.75) height: Math.max(20, Settings.settings.taskbarIconSize * 0.75)
anchors.centerIn: parent anchors.centerIn: parent
source: taskbar.getAppIcon(modelData) source: taskbar.getAppIcon(modelData)
smooth: true
visible: source.toString() !== "" visible: source.toString() !== ""
} }

View file

@ -3,10 +3,11 @@ import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Effects import QtQuick.Effects
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import Quickshell.Wayland
import Quickshell import Quickshell
import Quickshell.Services.Pam import Quickshell.Services.Pam
import Quickshell.Io import Quickshell.Io
import Quickshell.Wayland
import Quickshell.Widgets
import qs.Components import qs.Components
import qs.Settings import qs.Settings
import qs.Services import qs.Services
@ -135,8 +136,8 @@ WlSessionLock {
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
source: WallpaperManager.currentWallpaper !== "" ? WallpaperManager.currentWallpaper : "" source: WallpaperManager.currentWallpaper !== "" ? WallpaperManager.currentWallpaper : ""
cache: true cache: true
smooth: false smooth: true
visible: true // source for MultiEffect mipmap: false
} }
MultiEffect { MultiEffect {
@ -160,34 +161,8 @@ WlSessionLock {
radius: 40 radius: 40
color: Theme.accentPrimary color: Theme.accentPrimary
Image { Avatar {}
id: avatarImage
anchors.fill: parent
anchors.margins: 4
source: Settings.settings.profileImage
fillMode: Image.PreserveAspectCrop
visible: false
asynchronous: true
}
OpacityMask {
anchors.fill: avatarImage
source: avatarImage
maskSource: Rectangle {
width: avatarImage.width
height: avatarImage.height
radius: avatarImage.width / 2
visible: false
}
visible: Settings.settings.profileImage !== ""
}
Text {
anchors.centerIn: parent
text: "person"
font.family: "Material Symbols Outlined"
font.pixelSize: 32
color: Theme.onAccent
visible: Settings.settings.profileImage === ""
}
layer.enabled: true layer.enabled: true
layer.effect: Glow { layer.effect: Glow {
color: Theme.accentPrimary color: Theme.accentPrimary
@ -336,7 +311,7 @@ WlSessionLock {
} }
Rectangle { Rectangle {
width: infoColumn.width + 16 width: infoColumn.width + 32
height: infoColumn.height + 8 height: infoColumn.height + 8
color: (Theme.backgroundPrimary !== undefined && Theme.backgroundPrimary !== null) ? Theme.backgroundPrimary : "#222" color: (Theme.backgroundPrimary !== undefined && Theme.backgroundPrimary !== null) ? Theme.backgroundPrimary : "#222"
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View file

@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import Quickshell import Quickshell
import Quickshell.Widgets
import qs.Settings import qs.Settings
PanelWindow { PanelWindow {
@ -124,16 +125,12 @@ PanelWindow {
property var iconSources: [rawNotification?.image || "", rawNotification?.appIcon || "", rawNotification?.icon || ""] property var iconSources: [rawNotification?.image || "", rawNotification?.appIcon || "", rawNotification?.icon || ""]
// Try to load notification icon // Try to load notification icon
Image { IconImage {
id: iconImage id: iconImage
anchors.fill: parent anchors.fill: parent
anchors.margins: 4 anchors.margins: 4
fillMode: Image.PreserveAspectFit
smooth: true
cache: false
asynchronous: true asynchronous: true
sourceSize.width: 36 backer.fillMode: Image.PreserveAspectFit
sourceSize.height: 36
source: { source: {
for (var i = 0; i < iconBackground.iconSources.length; i++) { for (var i = 0; i < iconBackground.iconSources.length; i++) {
var icon = iconBackground.iconSources[i]; var icon = iconBackground.iconSources[i];

View file

@ -34,6 +34,7 @@ ShellRoot {
source: wallpaperSource source: wallpaperSource
cache: true cache: true
smooth: true smooth: true
mipmap: false
visible: wallpaperSource !== "" // Show the original for FastBlur input visible: wallpaperSource !== "" // Show the original for FastBlur input
} }
MultiEffect { MultiEffect {

View file

@ -2,6 +2,8 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import Quickshell.Widgets
import qs.Components
import qs.Settings import qs.Settings
Rectangle { Rectangle {
@ -61,39 +63,7 @@ Rectangle {
border.color: profileImageInput.activeFocus ? Theme.accentPrimary : Theme.outline border.color: profileImageInput.activeFocus ? Theme.accentPrimary : Theme.outline
border.width: 1 border.width: 1
Image { Avatar {}
id: avatarImage
anchors.fill: parent
anchors.margins: 2
source: Settings.settings.profileImage
fillMode: Image.PreserveAspectCrop
visible: false
asynchronous: true
cache: false
sourceSize.width: 64
sourceSize.height: 64
}
OpacityMask {
anchors.fill: avatarImage
source: avatarImage
maskSource: Rectangle {
width: avatarImage.width
height: avatarImage.height
radius: avatarImage.width / 2
visible: false
}
visible: Settings.settings.profileImage !== ""
}
Text {
anchors.centerIn: parent
text: "person"
font.family: "Material Symbols Outlined"
font.pixelSize: 20
color: Theme.accentPrimary
visible: Settings.settings.profileImage === ""
}
} }
Rectangle { Rectangle {

View file

@ -93,6 +93,7 @@ Rectangle {
anchors.margins: 2 anchors.margins: 2
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
smooth: true smooth: true
mipmap: true
cache: false cache: false
asynchronous: true asynchronous: true
sourceSize.width: 60 sourceSize.width: 60

View file

@ -4,6 +4,7 @@ import QtQuick.Controls
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Widgets
import qs.Settings import qs.Settings
import qs.Widgets import qs.Widgets
import qs.Widgets.LockScreen import qs.Widgets.LockScreen
@ -51,38 +52,7 @@ Rectangle {
z: 2 z: 2
} }
OpacityMask { Avatar {}
anchors.fill: parent
source: Image {
id: avatarImage
anchors.fill: parent
source: Settings.settings.profileImage !== undefined ? Settings.settings.profileImage : ""
fillMode: Image.PreserveAspectCrop
asynchronous: true
cache: false
sourceSize.width: 44
sourceSize.height: 44
}
maskSource: Rectangle {
width: 44
height: 44
radius: 22
visible: false
}
visible: Settings.settings.profileImage !== undefined && Settings.settings.profileImage !== ""
z: 1
}
// Fallback icon
Text {
anchors.centerIn: parent
text: "person"
font.family: "Material Symbols Outlined"
font.pixelSize: 24
color: Theme.onAccent
visible: Settings.settings.profileImage === undefined || Settings.settings.profileImage === ""
z: 0
}
} }
// User info text // User info text

View file

@ -137,8 +137,11 @@ PanelWindow {
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
asynchronous: true asynchronous: true
cache: true cache: true
sourceSize.width: Math.min(width, 150) smooth: true
sourceSize.height: Math.min(height, 90) mipmap: true
// Limit memory usage
sourceSize.width: 480
sourceSize.height: 270
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent