From c96bf37b3ac0cf2c607baf3fc23b43082057f6b3 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Fri, 24 Oct 2014 16:32:21 -0700 Subject: [PATCH] ui.gadgets.tables: show summary for mouse row or selected row. --- basis/ui/gadgets/tables/tables.factor | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/basis/ui/gadgets/tables/tables.factor b/basis/ui/gadgets/tables/tables.factor index 2d24f68c91..af7133799a 100644 --- a/basis/ui/gadgets/tables/tables.factor +++ b/basis/ui/gadgets/tables/tables.factor @@ -240,11 +240,16 @@ PRIVATE> : show-row-summary ( table n -- ) over nth-row [ swap [ renderer>> row-value ] keep show-summary ] - [ 2drop ] + [ drop hide-status ] if ; +: update-status ( table -- ) + dup mouse-index>> + [ dup selection-index>> value>> ] unless* + show-row-summary ; + : hide-mouse-help ( table -- ) - f >>mouse-index [ hide-status ] [ relayout-1 ] bi ; + f >>mouse-index [ update-status ] [ relayout-1 ] bi ; : ((select-row)) ( n table -- ) [ selection-index>> set-model ] @@ -292,7 +297,7 @@ M: table model-changed dup update-table-rows dup update-selection dup update-mouse-index - [ dup mouse-index>> show-row-summary ] [ relayout ] bi ; + [ update-status ] [ relayout ] bi ; : thin-row-rect ( table row -- rect ) row-rect [ { 0 1 } v* ] change-dim ;