Make window list buttons shrinkable

This commit is contained in:
Tony Garnock-Jones 2016-09-27 00:07:54 -04:00
parent e9f81398e0
commit 105646be57
1 changed files with 3 additions and 1 deletions

View File

@ -388,6 +388,7 @@
;; mandates begin-for-declarations to hide it from syndicate/lang's
;; local-expansion here :-(
(define (pushbutton label-str x y
#:shrink-x [shrink-x 0]
#:id id
#:parent parent-id
#:trigger-event [trigger-event 'left-up])
@ -399,7 +400,7 @@
(on #:when (touching?) (message (inbound (mouse-event trigger-event $s)))
(send! (button-click id s)))
(assert (outbound (c 0 (rectangle (x) (y) (*width i) (*height i)))))
(box-size (sizing (*width i) 0 0) (sizing (*height i) 0 0))))
(box-size (sizing (*width i) 0 shrink-x) (sizing (*height i) 0 0))))
;;---------------------------------------------------------------------------
@ -522,6 +523,7 @@
(theme-button-min-height 0)
(theme-button-background-color (hsv->color 240 1 0.6)))
(pushbutton title x y #:id (list 'window-list id) #:parent 'toolbar
#:shrink-x weak-fill
#:trigger-event 'left-down)))
(during (layout-solution 'toolbar (horizontal-layout `(-5.0 ,id)) reqsize
(rectangle $l $t $w $h))