1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 21:29:42 +00:00

feat: add custom mole icon and update PasswordSheetView to display it.

This commit is contained in:
Tw93
2025-12-14 19:11:08 +08:00
parent 52debdd2dc
commit 9536f91982
3 changed files with 55 additions and 6 deletions

View File

@@ -42,12 +42,23 @@ struct PasswordSheetView: View {
VStack(alignment: .leading, spacing: 14) {
// Icon
ZStack(alignment: .bottomTrailing) {
Image(nsImage: NSApp.applicationIconImage)
.resizable()
.interpolation(.high)
.aspectRatio(contentMode: .fit)
.frame(width: 48, height: 48)
.shadow(radius: 2)
if let url = Bundle.module.url(forResource: "mole", withExtension: "png"),
let customIcon = NSImage(contentsOf: url)
{
Image(nsImage: customIcon)
.resizable()
.interpolation(.high)
.aspectRatio(contentMode: .fit)
.frame(width: 48, height: 48)
.shadow(radius: 2)
} else {
Image(nsImage: NSApp.applicationIconImage)
.resizable()
.interpolation(.high)
.aspectRatio(contentMode: .fit)
.frame(width: 48, height: 48)
.shadow(radius: 2)
}
}
.padding(.leading, 6)

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

View File

@@ -0,0 +1,38 @@
{
"fill" : {
"solid" : "display-p3:0.97607,0.94922,0.90625,1.00000"
},
"groups" : [
{
"layers" : [
{
"blend-mode" : "normal",
"glass" : false,
"image-name" : "mole.png",
"name" : "mole",
"position" : {
"scale" : 1.76,
"translation-in-points" : [
0,
0
]
}
}
],
"shadow" : {
"kind" : "neutral",
"opacity" : 0.5
},
"translucency" : {
"enabled" : true,
"value" : 0.5
}
}
],
"supported-platforms" : {
"circles" : [
"watchOS"
],
"squares" : "shared"
}
}