mirror of
https://github.com/tw93/Mole.git
synced 2026-02-16 23:24:11 +00:00
feat: add custom mole icon and update PasswordSheetView to display it.
This commit is contained in:
@@ -42,12 +42,23 @@ struct PasswordSheetView: View {
|
|||||||
VStack(alignment: .leading, spacing: 14) {
|
VStack(alignment: .leading, spacing: 14) {
|
||||||
// Icon
|
// Icon
|
||||||
ZStack(alignment: .bottomTrailing) {
|
ZStack(alignment: .bottomTrailing) {
|
||||||
Image(nsImage: NSApp.applicationIconImage)
|
if let url = Bundle.module.url(forResource: "mole", withExtension: "png"),
|
||||||
.resizable()
|
let customIcon = NSImage(contentsOf: url)
|
||||||
.interpolation(.high)
|
{
|
||||||
.aspectRatio(contentMode: .fit)
|
Image(nsImage: customIcon)
|
||||||
.frame(width: 48, height: 48)
|
.resizable()
|
||||||
.shadow(radius: 2)
|
.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)
|
.padding(.leading, 6)
|
||||||
|
|
||||||
|
|||||||
BIN
app/Mole/Sources/Mole/Resources/mole.icon/Assets/mole.png
Normal file
BIN
app/Mole/Sources/Mole/Resources/mole.icon/Assets/mole.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 220 KiB |
38
app/Mole/Sources/Mole/Resources/mole.icon/icon.json
Normal file
38
app/Mole/Sources/Mole/Resources/mole.icon/icon.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user