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.
|
;; Initialize the window.
|
||||||
(define (init-window 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)
|
(window-callbacks window)
|
||||||
(qt:show window))
|
(qt:show window))
|
||||||
|
|
||||||
|
@ -176,7 +183,8 @@
|
||||||
menu-file-open "triggered()"
|
menu-file-open "triggered()"
|
||||||
(qt:receiver
|
(qt:receiver
|
||||||
(lambda ()
|
(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
|
(selected-file (qt:get-open-filename
|
||||||
"Select a contact file to open…"
|
"Select a contact file to open…"
|
||||||
contacts-dir))
|
contacts-dir))
|
||||||
|
@ -187,7 +195,6 @@
|
||||||
program-args)))))))))
|
program-args)))))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; Parse a vCard file and populate the window’s forms with its contents.
|
;; Parse a vCard file and populate the window’s forms with its contents.
|
||||||
(define (open-vcard-file window file)
|
(define (open-vcard-file window file)
|
||||||
(if (and (file-exists? file)
|
(if (and (file-exists? file)
|
||||||
|
|
28
contact.ui
28
contact.ui
|
@ -21,31 +21,13 @@
|
||||||
<enum>QLayout::SetMinimumSize</enum>
|
<enum>QLayout::SetMinimumSize</enum>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGraphicsView" name="profilePicture">
|
<widget class="QLabel" name="avatarLabel">
|
||||||
<property name="enabled">
|
<property name="text">
|
||||||
|
<string>Profile picture</string>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
Ŝarĝante…
Reference in New Issue