Update profile view / thumbnail

This commit is contained in:
Brahim Hadriche committed 2025-01-29 20:28:12 -05:00
1 parent 29a3206f17
commit 2b11d4b71c
7 files changed
+50 -13

No files matched your search

@@ -9,6 +9,7 @@
<field id="loadingBitmapUri" type="uri" alias="Poster.loadingBitmapUri" /> <field id="loadingBitmapUri" type="uri" alias="Poster.loadingBitmapUri" />
<field id="failedBitmapUri" type="uri" alias="Poster.failedBitmapUri" /> <field id="failedBitmapUri" type="uri" alias="Poster.failedBitmapUri" />
<field id="loadStatus" type="string" alias="Poster.loadStatus" /> <field id="loadStatus" type="string" alias="Poster.loadStatus" />
<field id="blendColor" type="color" alias="Poster.blendColor" />
<field id="maskUri" type="uri" value="pkg:/images/white-circle.png" alias="MaskGroup.maskuri" /> <field id="maskUri" type="uri" value="pkg:/images/white-circle.png" alias="MaskGroup.maskuri" />
<field id="maskSize" type="vector2d" alias="MaskGroup.maskSize" /> <field id="maskSize" type="vector2d" alias="MaskGroup.maskSize" />
@@ -23,13 +23,28 @@ function OnCurrentProfile() as void
return return
end if end if
thumbnail = currentProfile.thumbnail
if not StringUtils.IsNullOrEmpty(thumbnail)
m.circlePosterInner.uri = thumbnail
' bs:disable-next-line LINT3023
m.circlePosterInner.blendColor = "#FFFFFFFF"
m.letterLabel.text = ""
else
m.circlePosterInner.uri = "pkg:/images/white-circle.png"
m.circlePosterInner.blendColor = currentProfile.color
username = currentProfile.username username = currentProfile.username
if not StringUtils.IsNullOrEmpty(username) if not StringUtils.IsNullOrEmpty(username)
m.letterLabel.text = UCase(username.Left(1)) letter = username.Left(1)
if letter = "@" and Len(username) > 1
letter = username.Mid(1, 1)
end if
m.letterLabel.text = UCase(letter)
else else
m.letterLabel.text = "" m.letterLabel.text = ""
end if end if
m.circlePosterInner.blendColor = currentProfile.color end if
m.circlePoster.visible = true m.circlePoster.visible = true
m.buttonIcon.visible = false m.buttonIcon.visible = false
@@ -12,7 +12,7 @@
height="40" height="40"
blendColor="#DDDDDDFF" blendColor="#DDDDDDFF"
uri="pkg:/images/white-circle.png"> uri="pkg:/images/white-circle.png">
<Poster <CirclePoster
id="circlePosterInner" id="circlePosterInner"
width="36" width="36"
height="36" height="36"
@@ -27,7 +27,7 @@
horizAlign="center"> horizAlign="center">
<Font role="font" uri="font:SystemFontFile" size="24" /> <Font role="font" uri="font:SystemFontFile" size="24" />
</Label> </Label>
</Poster> </CirclePoster>
</Poster> </Poster>
</children> </children>
</component> </component>
@@ -38,7 +38,11 @@ function OnContentSet() as void
m.top.circlePosterInnerBlendColor = content.color m.top.circlePosterInnerBlendColor = content.color
if not StringUtils.IsNullOrEmpty(username) if not StringUtils.IsNullOrEmpty(username)
m.top.letter = UCase(username.Left(1)) letter = username.Left(1)
if letter = "@" and Len(username) > 1
letter = username.Mid(1, 1)
end if
m.top.letter = UCase(letter)
else else
m.top.letter = "" m.top.letter = ""
end if end if
@@ -46,7 +46,7 @@
translation="[20,20]" translation="[20,20]"
blendColor="#DDDDDDFF" blendColor="#DDDDDDFF"
uri="pkg:/images/white-circle.png"> uri="pkg:/images/white-circle.png">
<Poster <CirclePoster
id="circlePosterInner" id="circlePosterInner"
width="152" width="152"
height="152" height="152"
@@ -67,7 +67,7 @@
height="60" height="60"
translation="[110,110]" translation="[110,110]"
/> />
</Poster> </CirclePoster>
<Poster <Poster
id="CrownPoster" id="CrownPoster"
width="60" width="60"
@@ -32,24 +32,41 @@ function OnContentSet() as void
return return
end if end if
m.top.circlePosterInnerUri = "pkg:/images/white-circle.png"
m.top.circlePosterInnerBlendColor = content.color
username = content.username username = content.username
m.top.username = username m.top.username = username
thumbnail = content.thumbnail
if not StringUtils.IsNullOrEmpty(thumbnail)
m.top.circlePosterInnerUri = thumbnail
' bs:disable-next-line LINT3023
m.top.circlePosterInnerBlendColor = "#FFFFFFFF"
m.top.letter = ""
else
m.top.circlePosterInnerUri = "pkg:/images/white-circle.png"
m.top.circlePosterInnerBlendColor = content.color
if not StringUtils.IsNullOrEmpty(username) if not StringUtils.IsNullOrEmpty(username)
m.top.letter = UCase(username.Left(1)) letter = username.Left(1)
if letter = "@" and Len(username) > 1
letter = username.Mid(1, 1)
end if
m.top.letter = UCase(letter)
else else
m.top.letter = "" m.top.letter = ""
end if end if
m.top.serverUrl = content.serverUrl end if
m.top.crownVisible = content.isSelected m.top.crownVisible = content.isSelected
backendType = content.type backendType = content.type
if backendType = "invidious" if backendType = "invidious"
m.top.serverUrl = content.serverUrl
m.top.backendTypePosterUri = "pkg:/images/invidious-logo.png" m.top.backendTypePosterUri = "pkg:/images/invidious-logo.png"
else if backendType = "youtube" else if backendType = "youtube"
m.top.serverUrl = "YouTube"
m.top.backendTypePosterUri = "pkg:/images/youtube-logo.png" m.top.backendTypePosterUri = "pkg:/images/youtube-logo.png"
else else
m.top.serverUrl = ""
m.top.backendTypePosterUri = "" m.top.backendTypePosterUri = ""
end if end if
@@ -33,7 +33,7 @@
translation="[20,20]" translation="[20,20]"
blendColor="#DDDDDDFF" blendColor="#DDDDDDFF"
uri="pkg:/images/white-circle.png"> uri="pkg:/images/white-circle.png">
<Poster <CirclePoster
id="circlePosterInner" id="circlePosterInner"
width="152" width="152"
height="152" height="152"
@@ -54,7 +54,7 @@
height="60" height="60"
translation="[110,110]" translation="[110,110]"
/> />
</Poster> </CirclePoster>
<Poster <Poster
id="CrownPoster" id="CrownPoster"
width="60" width="60"