(presentations:define-realization (ui alloy:checkbox) ((:border simple:rectangle) (alloy:extent 0 0 (alloy:ph 1) (alloy:ph 1)) :pattern colors:white :line-width (alloy:un 2)) ((:check simple:rectangle) (alloy:extent (alloy:ph 0.15) (alloy:ph 0.15) (alloy:ph 0.7) (alloy:ph 0.7)) :hidden-p (not (alloy:active-p alloy:renderable)) :pattern colors:accent)) (presentations:define-update (ui alloy:checkbox) (:border :hidden-p NIL :pattern (if alloy:focus (colored:color 0.9 0.9 0.9) colors:gray)) (:check :pattern (if alloy:focus (colored:color 0.9 0.9 0.9) colors:accent) :hidden-p (not (alloy:active-p alloy:renderable)))) (presentations:define-realization (ui alloy:switch) ((:border simple:rectangle) (alloy:margins) :pattern colors:white :line-width (alloy:un 2)) ((:background simple:rectangle) (alloy:margins)) ((:switch simple:rectangle) (alloy:extent 0 0 (alloy:pw 0.3) (alloy:ph)))) (presentations:define-update (ui alloy:switch) (:border :hidden-p NIL :pattern (if alloy:focus (colored:color 0.9 0.9 0.9) colors:gray)) (:background :pattern (if (alloy:active-p alloy:renderable) colors:dark-accent (colored:color 0 0 0 0.5))) (:switch :pattern (if (alloy:active-p alloy:renderable) colors:accent colors:black))) (presentations:define-animated-shapes alloy:switch (:background (simple:pattern :duration 0.2)) (:switch (simple:pattern :duration 0.3) (simple:bounds :duration 0.5))) (presentations:define-realization (ui alloy:labelled-switch T) ((:label simple:text) (alloy:margins) alloy:text :font (setting :display :font) :halign :middle :valign :middle)) (presentations:define-update (ui alloy:labelled-switch) (:label :text alloy:text :pattern colors:white)) (presentations:define-realization (ui alloy:slider) ((:background simple:rectangle) (ecase (alloy:orientation alloy:renderable) (:horizontal (alloy:extent 0 (alloy:ph 0.4) (alloy:pw) (alloy:ph 0.2))) (:vertical (alloy:extent (alloy:pw 0.4) 0 (alloy:pw 0.2) (alloy:ph))))) ((:border simple:rectangle) (alloy:margins -3) :line-width (alloy:un 1)) ((:handle simple:rectangle) (ecase (alloy:orientation alloy:renderable) (:horizontal (alloy:extent -5 0 10 (alloy:ph))) (:vertical (alloy:extent 0 -5 (alloy:pw) 10)))) ((:display simple:text) (alloy:margins) (format NIL "~,2f" alloy:value) :pattern colors:white :font (setting :display :font) :halign :middle :valign :middle)) (presentations:define-update (ui alloy:slider) (:handle :pattern (case alloy:focus (:strong colors:white) (T colors:accent))) (:display :text (format NIL "~,2f" alloy:value))) (presentations:define-realization (ui alloy:scrollbar) ((:background simple:rectangle) (alloy:margins)) ((:handle simple:rectangle) (ecase (alloy:orientation alloy:renderable) (:horizontal (alloy:extent -10 0 20 (alloy:ph))) (:vertical (alloy:extent 0 -10 (alloy:pw) 20)))))