Replaced Image {} per IconImage {} where applicable
This commit is contained in:
parent
e2d02afc9a
commit
2f14dba144
13 changed files with 69 additions and 127 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Components
|
||||
import qs.Settings
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Widgets
|
||||
import qs.Components
|
||||
import qs.Settings
|
||||
|
||||
PanelWindow {
|
||||
id: activeWindowPanel
|
||||
|
|
@ -121,6 +121,7 @@ PanelWindow {
|
|||
source: ToplevelManager?.activeToplevel ? getIcon() : ""
|
||||
visible: Settings.settings.showActiveWindowIcon
|
||||
anchors.verticalCenterOffset: -3
|
||||
|
||||
}
|
||||
|
||||
Text {
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@ import QtQuick.Controls
|
|||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Widgets
|
||||
import qs.Components
|
||||
import qs.Settings
|
||||
import Quickshell.Wayland
|
||||
|
||||
import "../../Helpers/Fuzzysort.js" as Fuzzysort
|
||||
|
||||
PanelWithOverlay {
|
||||
|
|
@ -342,13 +344,9 @@ PanelWithOverlay {
|
|||
width: 28
|
||||
height: 28
|
||||
property bool iconLoaded: !modelData.isCalculator && iconImg.status === Image.Ready && iconImg.source !== "" && iconImg.status !== Image.Error
|
||||
Image {
|
||||
IconImage {
|
||||
id: iconImg
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectFit
|
||||
smooth: true
|
||||
mipmap: true
|
||||
cache: false
|
||||
asynchronous: true
|
||||
source: modelData.isCalculator ? "qrc:/icons/calculate.svg" : Quickshell.iconPath(modelData.icon, "application-x-executable")
|
||||
visible: modelData.isCalculator || parent.iconLoaded
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import QtQuick
|
|||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import qs.Settings
|
||||
|
||||
PopupWindow {
|
||||
|
|
@ -112,14 +113,12 @@ PopupWindow {
|
|||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
Image {
|
||||
IconImage {
|
||||
Layout.preferredWidth: 16
|
||||
Layout.preferredHeight: 16
|
||||
smooth: true
|
||||
mipmap: true
|
||||
source: modelData?.icon ?? ""
|
||||
visible: (modelData?.icon ?? "") !== ""
|
||||
fillMode: Image.PreserveAspectFit
|
||||
backer.fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import QtQuick
|
|||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Quickshell.Widgets
|
||||
import qs.Settings
|
||||
import qs.Services
|
||||
import qs.Components
|
||||
|
|
@ -57,8 +58,6 @@ Item {
|
|||
mipmap: true
|
||||
cache: false
|
||||
asynchronous: true
|
||||
sourceSize.width: 24
|
||||
sourceSize.height: 24
|
||||
source: MusicManager.trackArtUrl
|
||||
visible: source.toString() !== ""
|
||||
|
||||
|
|
|
|||
|
|
@ -74,8 +74,6 @@ Item {
|
|||
height: Math.max(12, Settings.settings.taskbarIconSize * 0.625)
|
||||
anchors.centerIn: parent
|
||||
source: getAppIcon(modelData)
|
||||
smooth: true
|
||||
mipmap: true
|
||||
visible: source.toString() !== ""
|
||||
}
|
||||
|
||||
|
|
|
|||
43
Components/Avatar.qml
Normal file
43
Components/Avatar.qml
Normal 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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -35,6 +35,7 @@ ShellRoot {
|
|||
visible: wallpaperSource !== ""
|
||||
cache: true
|
||||
smooth: true
|
||||
mipmap: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,8 +154,6 @@ PanelWindow {
|
|||
height: Math.max(20, Settings.settings.taskbarIconSize * 0.75)
|
||||
anchors.centerIn: parent
|
||||
source: taskbar.getAppIcon(modelData)
|
||||
smooth: true
|
||||
mipmap: true
|
||||
visible: source.toString() !== ""
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@ import QtQuick.Layouts
|
|||
import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Quickshell.Wayland
|
||||
import Quickshell
|
||||
import Quickshell.Services.Pam
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Widgets
|
||||
import qs.Components
|
||||
import qs.Settings
|
||||
import qs.Services
|
||||
|
|
@ -137,7 +138,6 @@ WlSessionLock {
|
|||
cache: true
|
||||
smooth: true
|
||||
mipmap: false
|
||||
visible: true // source for MultiEffect
|
||||
}
|
||||
|
||||
MultiEffect {
|
||||
|
|
@ -161,36 +161,8 @@ WlSessionLock {
|
|||
radius: 40
|
||||
color: Theme.accentPrimary
|
||||
|
||||
Image {
|
||||
id: avatarImage
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
source: Settings.settings.profileImage
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
visible: false
|
||||
asynchronous: true
|
||||
mipmap: true
|
||||
smooth: 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 === ""
|
||||
}
|
||||
Avatar {}
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: Glow {
|
||||
color: Theme.accentPrimary
|
||||
|
|
@ -339,7 +311,7 @@ WlSessionLock {
|
|||
}
|
||||
|
||||
Rectangle {
|
||||
width: infoColumn.width + 16
|
||||
width: infoColumn.width + 32
|
||||
height: infoColumn.height + 8
|
||||
color: (Theme.backgroundPrimary !== undefined && Theme.backgroundPrimary !== null) ? Theme.backgroundPrimary : "#222"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import qs.Settings
|
||||
|
||||
PanelWindow {
|
||||
|
|
@ -124,17 +125,12 @@ PanelWindow {
|
|||
property var iconSources: [rawNotification?.image || "", rawNotification?.appIcon || "", rawNotification?.icon || ""]
|
||||
|
||||
// Try to load notification icon
|
||||
Image {
|
||||
IconImage {
|
||||
id: iconImage
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
fillMode: Image.PreserveAspectFit
|
||||
smooth: true
|
||||
mipmap: true
|
||||
cache: false
|
||||
asynchronous: true
|
||||
sourceSize.width: 36
|
||||
sourceSize.height: 36
|
||||
backer.fillMode: Image.PreserveAspectFit
|
||||
source: {
|
||||
for (var i = 0; i < iconBackground.iconSources.length; i++) {
|
||||
var icon = iconBackground.iconSources[i];
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import QtQuick
|
|||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Quickshell.Widgets
|
||||
import qs.Components
|
||||
import qs.Settings
|
||||
|
||||
Rectangle {
|
||||
|
|
@ -61,39 +63,7 @@ Rectangle {
|
|||
border.color: profileImageInput.activeFocus ? Theme.accentPrimary : Theme.outline
|
||||
border.width: 1
|
||||
|
||||
Image {
|
||||
id: avatarImage
|
||||
anchors.fill: parent
|
||||
anchors.margins: 2
|
||||
source: Settings.settings.profileImage
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
visible: false
|
||||
asynchronous: true
|
||||
cache: false
|
||||
smooth: true
|
||||
mipmap: 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: 20
|
||||
color: Theme.accentPrimary
|
||||
visible: Settings.settings.profileImage === ""
|
||||
}
|
||||
Avatar {}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import QtQuick.Controls
|
|||
import Qt5Compat.GraphicalEffects
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import qs.Settings
|
||||
import qs.Widgets
|
||||
import qs.Widgets.LockScreen
|
||||
|
|
@ -51,38 +52,7 @@ Rectangle {
|
|||
z: 2
|
||||
}
|
||||
|
||||
OpacityMask {
|
||||
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
|
||||
smooth: true
|
||||
mipmap: true
|
||||
}
|
||||
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
|
||||
}
|
||||
Avatar {}
|
||||
}
|
||||
|
||||
// User info text
|
||||
|
|
|
|||
|
|
@ -136,12 +136,9 @@ PanelWindow {
|
|||
source: modelData
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
asynchronous: true
|
||||
cache: false
|
||||
cache: true
|
||||
smooth: true
|
||||
mipmap: true
|
||||
// Limit memory usage
|
||||
sourceSize.width: Math.min(width, 480)
|
||||
sourceSize.height: Math.min(height, 270)
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue