nandi/frqpublic Fork 0
ed528b2
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Let a Flutter checkbutton answer a tap

`:on-toggled` takes no arguments everywhere it is written — the settings
tick is `actions/toggle-hide-join-part!`, a 0-arity defn, and the connect
screen's TLS tick is a zero-arity `#(do ...)`. The renderer handed
Checkbox's own new boolean to it, so every tap threw inside the callback
and neither tick moved.

Call it the way every other handler here is called, and read the state
back out of `:active` on the next render. The label joins the target
while we are here: 20 logical pixels is a tick under a pointer and a miss
under a thumb.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-12T09:45:36-07:00 Browse files
ed528b2 parent: 68c21c7
modified flutter/src/frq/hiccup.cljd +22 -11
@@ -900,18 +900,29 @@
900900 (let [size (dbl (or (:size p) (:gap p) (:width-request p)) t/space-xxs)]
901901 (m/SizedBox .width size .height size))
902902
903+ ;; A tick and its words. `:on-toggled` takes no arguments — it is the
904+ ;; same zero-arity handler every other tag here is given, and the box
905+ ;; reads its state back out of `:active` on the next render rather than
906+ ;; being told what it now is. Handing Checkbox's own bool to it is what
907+ ;; left the settings tick dead: `toggle-hide-join-part!` is 0-arity.
908+ ;;
909+ ;; The label is part of the target. 20 logical pixels is a fine tick on
910+ ;; a desktop pointer and a miss on a thumb, so the whole row taps.
903911 :checkbutton
904- (let [on (:on-toggled p)]
905- (m/Row
906- .mainAxisSize m/MainAxisSize.min
907- .spacing t/space-xxxs
908- .children [(m/SizedBox
909- .width 20.0 .height 20.0
910- .child (m/Checkbox
911- .value (boolean (:active p))
912- .activeColor t/accent
913- .onChanged (when on (fn [v] (on (boolean v))))))
914- (txt ctx (:label p "") t/text-body t/on-bg)]))
912+ (let [on (:on-toggled p)
913+ row (m/Row
914+ .mainAxisSize m/MainAxisSize.min
915+ .spacing t/space-xxxs
916+ .children [(m/SizedBox
917+ .width 20.0 .height 20.0
918+ .child (m/Checkbox
919+ .value (boolean (:active p))
920+ .activeColor t/accent
921+ .onChanged (when on (fn [_] (on)))))
922+ (txt ctx (:label p "") t/text-body t/on-bg)])]
923+ (if on
924+ (m/InkWell .onTap #(on) .child row)
925+ row))
915926
916927 ;; text_input: a filled rounded field, no outline. COSMIC entries sit in
917928 ;; the component colour rather than behind a border.
@@ -900,18 +900,29 @@
900 (let [size (dbl (or (:size p) (:gap p) (:width-request p)) t/space-xxs)]900 (let [size (dbl (or (:size p) (:gap p) (:width-request p)) t/space-xxs)]
901 (m/SizedBox .width size .height size))901 (m/SizedBox .width size .height size))
902 902
903+ ;; A tick and its words. `:on-toggled` takes no arguments — it is the
904+ ;; same zero-arity handler every other tag here is given, and the box
905+ ;; reads its state back out of `:active` on the next render rather than
906+ ;; being told what it now is. Handing Checkbox's own bool to it is what
907+ ;; left the settings tick dead: `toggle-hide-join-part!` is 0-arity.
908+ ;;
909+ ;; The label is part of the target. 20 logical pixels is a fine tick on
910+ ;; a desktop pointer and a miss on a thumb, so the whole row taps.
903 :checkbutton911 :checkbutton
904- (let [on (:on-toggled p)]912+ (let [on (:on-toggled p)
905- (m/Row913+ row (m/Row
906- .mainAxisSize m/MainAxisSize.min914+ .mainAxisSize m/MainAxisSize.min
907- .spacing t/space-xxxs915+ .spacing t/space-xxxs
908- .children [(m/SizedBox916+ .children [(m/SizedBox
909- .width 20.0 .height 20.0917+ .width 20.0 .height 20.0
910- .child (m/Checkbox918+ .child (m/Checkbox
911- .value (boolean (:active p))919+ .value (boolean (:active p))
912- .activeColor t/accent920+ .activeColor t/accent
913- .onChanged (when on (fn [v] (on (boolean v))))))921+ .onChanged (when on (fn [_] (on)))))
914- (txt ctx (:label p "") t/text-body t/on-bg)]))922+ (txt ctx (:label p "") t/text-body t/on-bg)])]
923+ (if on
924+ (m/InkWell .onTap #(on) .child row)
925+ row))
915 926
916 ;; text_input: a filled rounded field, no outline. COSMIC entries sit in927 ;; text_input: a filled rounded field, no outline. COSMIC entries sit in
917 ;; the component colour rather than behind a border.928 ;; the component colour rather than behind a border.