Skip to content

Commit

Permalink
improve the way avatars are rendered.
Browse files Browse the repository at this point in the history
  • Loading branch information
unclebob committed Jun 25, 2023
1 parent d1d24f8 commit f419eb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/more_speech/ui/swing/article_panel.clj
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,13 @@
(text! replies-label "Replies▶"))


(let [avatar-label (select main-frame [:#avatar-id])]
(future (config! avatar-label
:text (if (some? (:picture profile))
(format "<html><img src=\"%s\" width=\"100\" height=\"100\"></html>" (:picture profile))
"<html><img src=\"http://cleancoder.com/images/cleancodelogo.png\" width=\"100\" height=\"100\"></html>"))))
(let [avatar-label (select main-frame [:#avatar-id])
picture (:picture profile)]
(when new-id?
(config! avatar-label :text "<html><img src=\"https://www.drodd.com/images14/white15.jpg\" width=\"100\" height=\"100\"></html>"))
(when (some? picture)
(future (config! avatar-label
:text (format "<html><img src=\"%s\" width=\"100\" height=\"100\"></html>" picture)))))
(text! subject-label (formatters/get-subject (:tags event)))
(text! relays-label (format "%d %s"
(count (:relays event))
Expand Down
3 changes: 1 addition & 2 deletions src/more_speech/ui/swing/users_window.clj
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
(defn make-sorted-listbox-items [ids]
(sort-by first
(map #(vector (formatters/format-user-id % 70 40) %)
ids))
)
ids)))

(defn render-listbox-item [widget item]
(let [value (:value item)]
Expand Down

0 comments on commit f419eb0

Please sign in to comment.