Display a placeholder icon in profile-picture spot

Now we can display an icon, since profile pictures
aren’t loaded (yet).
This commit is contained in:
Jaidyn Ann 2024-02-11 11:52:20 -06:00
parent 3cefb2fa75
commit 21d324e5fe
2 changed files with 11 additions and 23 deletions

View File

@ -126,6 +126,12 @@
;; Initialize the window.
(define (init-window window)
;; Set the profile-picture label to a default theme icon.
(let [(default-profile-pic (or (qt:icon "person") (qt:icon "contact-new")))]
(if default-profile-pic
(set! (qt:property (qt:find window "avatarLabel") "pixmap")
(qt:icon->pixmap default-profile-pic 100 100))))
;; Now prepare callbacks and show the window.
(window-callbacks window)
(qt:show window))

View File

@ -21,31 +21,13 @@
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QGraphicsView" name="profilePicture">
<property name="enabled">
<widget class="QLabel" name="avatarLabel">
<property name="text">
<string>Profile picture</string>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
</widget>
</item>
<item>