From 645290368ddf3d568abc18e4580b1fd730254745 Mon Sep 17 00:00:00 2001 From: Nathan Morrison Date: Sat, 23 Nov 2024 23:38:24 -0600 Subject: [PATCH] Conditionally show iteration frame controls --- src/Command.elm | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/Command.elm b/src/Command.elm index 639ba21..4dcaa53 100644 --- a/src/Command.elm +++ b/src/Command.elm @@ -58,7 +58,7 @@ viewBar {iterMode, baseContents} { incrementerDefaults | label = "# iteration frames" , min = Just 0} ChangeNumIterFrames (Content.numIterFrames baseContents) - ++ iterFrameKey + ++ iterFrameKey iterMode.showIterFrames layerVisibilityControls : List (HS.Html Message) layerVisibilityControls @@ -126,19 +126,23 @@ getNewIterFrameID {baseContents} = ID.Trunk <| "f" ++ String.fromInt (1 + Content.numIterFrames baseContents) iterFrameKey - : List (HS.Html msg) -iterFrameKey - = [ - commandLabel "iteration frame controls" - , S.svg + : Bool + -> List (HS.Html msg) +iterFrameKey showIterFrames + = if showIterFrames + then [ - HSA.css + commandLabel "iteration frame controls" + , S.svg [ - Css.marginLeft (Css.px 16) - , Css.marginRight (Css.px 16) + HSA.css + [ + Css.marginLeft (Css.px 16) + , Css.marginRight (Css.px 16) + ] + ] + [ + IterFrame.showKey ] ] - [ - IterFrame.showKey - ] - ] + else []