Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
Merge branch '4DA-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
lehitoskin committed Mar 20, 2015
2 parents 4b55a69 + d43a46e commit 89f20e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions gui/chat.rkt
Expand Up @@ -71,6 +71,7 @@
(define my-id-bytes (get-self-address this-tox))
(define my-id-hex (bytes->hex-string my-id-bytes))
(define friend-avatar (make-bitmap 40 40))
(define friend-has-avatar? #f)

; the sending file transfer list and its path list
; easier to have two lists than deal with a list of pairs
Expand Down Expand Up @@ -413,16 +414,19 @@
(send dc draw-bitmap avatar-big 0 0)))]))

(define chat-frame-hpanel (new horizontal-panel%
[parent chat-frame]))
[parent chat-frame]
[stretchable-height #f]))

(define friend-avatar-button (new button%
[parent chat-frame-hpanel]
[style (list 'deleted)]
[label friend-avatar]
[callback (λ (button event)
(send avatar-view-frame show #t))]))

(define chat-frame-vpanel (new vertical-panel%
[parent chat-frame-hpanel]
[horiz-margin 8]
[alignment '(left center)]))

; make a static text message in the frame containing friend's name
Expand Down Expand Up @@ -858,6 +862,11 @@
(define avatar-pict (bitmap avatar-bitmap))
; scale the pict to 40x40
(define avatar-pict-small (scale-to-fit avatar-pict 40 40))
; add avatar button to panel
(when (not friend-has-avatar?)
(send chat-frame-hpanel add-child friend-avatar-button)
(set! friend-has-avatar? #t))

; set the avatar to the new one
(set! friend-avatar avatar-bitmap)
; set the button to the scaled avatar
Expand Down
1 change: 1 addition & 0 deletions gui/frame.rkt
Expand Up @@ -64,6 +64,7 @@ if people have a similar problem.")

(define frame-hpanel (new horizontal-panel%
[parent frame]
[stretchable-height #f]
[alignment '(left center)]))

(define frame-avatar-button
Expand Down

0 comments on commit 89f20e4

Please sign in to comment.