Implemented square profile pictures

- Added preference "Square profile pictures"
This commit is contained in:
Mitarashi 2022-01-13 22:44:47 +02:00
parent 111927a21c
commit bc337027ca
3 changed files with 11 additions and 2 deletions

View File

@ -75,6 +75,9 @@ genPrefs:
hideReplies(checkbox, false):
"Hide tweet replies"
squareProfileImages(checkbox, false):
"Square profile pictures"
Media:
mp4Playback(checkbox, true):
"Enable mp4 video playback (only for gifs)"
@ -107,6 +110,7 @@ genPrefs:
replaceInstagram(input, ""):
"Instagram -> Bibliogram"
placeholder: "Bibliogram hostname"
iterator allPrefs*(): Pref =
for k, v in prefList:

View File

@ -97,7 +97,7 @@
}
}
.avatar {
.avatar-round {
border-radius: 50%;
}

View File

@ -31,7 +31,12 @@ proc renderHeader(tweet: Tweet; retweet: string; prefs: Prefs): VNode =
var size = "_bigger"
if not prefs.autoplayGifs and tweet.profile.userPic.endsWith("gif"):
size = "_400x400"
genImg(tweet.profile.getUserPic(size), class="avatar")
let avatarClass =
if prefs.squareProfileImages: "avatar"
else: "avatar avatar-round"
genImg(tweet.profile.getUserPic(size), class=avatarClass)
tdiv(class="tweet-name-row"):
tdiv(class="fullname-and-username"):