From e3209701b55ce33bdd1b7c76f93594a6a7a12167 Mon Sep 17 00:00:00 2001
From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com>
Date: Sun, 11 Feb 2024 11:52:20 -0600
Subject: [PATCH] Display a placeholder icon in profile-picture spot
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Now we can display an icon, since profile pictures
aren’t loaded (yet).
---
contact.scm | 7 ++++++-
contact.ui | 28 +++++-----------------------
2 files changed, 11 insertions(+), 24 deletions(-)
diff --git a/contact.scm b/contact.scm
index 418bdf3..a26c08a 100644
--- a/contact.scm
+++ b/contact.scm
@@ -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: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))
@@ -187,7 +193,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)
diff --git a/contact.ui b/contact.ui
index 9f6f3d8..702c94f 100644
--- a/contact.ui
+++ b/contact.ui
@@ -21,31 +21,13 @@
QLayout::SetMinimumSize
-
-
-
+
+
+ Profile picture
+
+
true
-
-
- 0
- 0
-
-
-
-
- 50
- 50
-
-
-
-
- 100
- 100
-
-
-
- QFrame::NoFrame
-
-