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:
parent
3cefb2fa75
commit
962d701be6
11
contact.scm
11
contact.scm
|
@ -126,6 +126,13 @@
|
|||
|
||||
;; Initialize the window.
|
||||
(define (init-window window)
|
||||
;; Set the profile-picture label to a default theme icon.
|
||||
(let [(default-profile-pic
|
||||
(or (qt:theme-icon "person") (qt:theme-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))
|
||||
|
||||
|
@ -176,7 +183,8 @@
|
|||
menu-file-open "triggered()"
|
||||
(qt:receiver
|
||||
(lambda ()
|
||||
(let* [(contacts-dir (conc (get-environment-variable "HOME") "/Contacts"))
|
||||
(let* [(contacts-dir (conc (get-environment-variable "HOME")
|
||||
"/Contacts"))
|
||||
(selected-file (qt:get-open-filename
|
||||
"Select a contact file to open…"
|
||||
contacts-dir))
|
||||
|
@ -187,7 +195,6 @@
|
|||
program-args)))))))))
|
||||
|
||||
|
||||
|
||||
;; Parse a vCard file and populate the window’s forms with its contents.
|
||||
(define (open-vcard-file window file)
|
||||
(if (and (file-exists? file)
|
||||
|
|
28
contact.ui
28
contact.ui
|
@ -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>
|
||||
|
|
Ŝarĝante…
Reference in New Issue