Add some visual changes to improve usability
This commit is contained in:
parent
5a28a554a1
commit
7c5a62d57a
|
@ -17,5 +17,6 @@ type Msg
|
||||||
| UseHierarchy (Maybe CacheModelHierarchy)
|
| UseHierarchy (Maybe CacheModelHierarchy)
|
||||||
| Access (List Int)
|
| Access (List Int)
|
||||||
| ChangeAccessInput String
|
| ChangeAccessInput String
|
||||||
|
| AccessViewCancel
|
||||||
| AccessViewForward
|
| AccessViewForward
|
||||||
| AccessViewBack
|
| AccessViewBack
|
||||||
|
|
|
@ -60,6 +60,14 @@ updateAccess li m =
|
||||||
in
|
in
|
||||||
(newModel, cmd)
|
(newModel, cmd)
|
||||||
|
|
||||||
|
updateAccessViewCancel : Model -> (Model, Cmd Msg)
|
||||||
|
updateAccessViewCancel m =
|
||||||
|
let
|
||||||
|
newModel = { m | accessView = Nothing }
|
||||||
|
cmd = Cmd.none
|
||||||
|
in
|
||||||
|
(newModel, cmd)
|
||||||
|
|
||||||
updateAccessViewForward : Model -> (Model, Cmd Msg)
|
updateAccessViewForward : Model -> (Model, Cmd Msg)
|
||||||
updateAccessViewForward m =
|
updateAccessViewForward m =
|
||||||
let
|
let
|
||||||
|
|
|
@ -39,7 +39,10 @@ resultButton = maybeButton << Result.toMaybe
|
||||||
|
|
||||||
-- Button wrapper (button group)
|
-- Button wrapper (button group)
|
||||||
buttonWrapper : List (Html Msg) -> Html Msg
|
buttonWrapper : List (Html Msg) -> Html Msg
|
||||||
buttonWrapper = div [ classList [("btn-group", True), ("mb-3", True) ] ]
|
buttonWrapper = div [ classList [("btn-group", True), ("mb-3", True), ("mr-3", True) ] ]
|
||||||
|
|
||||||
|
buttonToolbar : List (List (Html Msg)) -> Html Msg
|
||||||
|
buttonToolbar ll = div [ class "btn-toolbar" ] <| List.map buttonWrapper ll
|
||||||
|
|
||||||
-- Input with a label
|
-- Input with a label
|
||||||
labeledInput : String -> String -> (String -> Msg) -> Html Msg
|
labeledInput : String -> String -> (String -> Msg) -> Html Msg
|
||||||
|
@ -163,9 +166,9 @@ viewAccessView m av =
|
||||||
div []
|
div []
|
||||||
[ h2 [] [ text "Access Simulation" ]
|
[ h2 [] [ text "Access Simulation" ]
|
||||||
, p [] [ text ("Simulating access of address " ++ String.fromInt av.blockAddr) ]
|
, p [] [ text ("Simulating access of address " ++ String.fromInt av.blockAddr) ]
|
||||||
, buttonWrapper
|
, buttonToolbar
|
||||||
[ primaryButton "Back" AccessViewBack
|
[ [ primaryButton "Back" AccessViewBack, primaryButton "Forward" AccessViewForward ]
|
||||||
, primaryButton "Forward" AccessViewForward
|
, [ dangerButton "Stop" AccessViewCancel ]
|
||||||
]
|
]
|
||||||
, h3 [] [ text "Access event log" ]
|
, h3 [] [ text "Access event log" ]
|
||||||
, viewAccessLog av
|
, viewAccessLog av
|
||||||
|
@ -221,7 +224,7 @@ viewAccessInput m =
|
||||||
case checkedResult of
|
case checkedResult of
|
||||||
Ok _ -> viewError True ""
|
Ok _ -> viewError True ""
|
||||||
Err e -> viewError False e
|
Err e -> viewError False e
|
||||||
editHierarchyButton = secondaryButton "Edit hierarchy" (UseHierarchy Nothing)
|
editHierarchyButton = button [ onClick (UseHierarchy Nothing), class "btn-dark" ] "Edit hierarchy"
|
||||||
in
|
in
|
||||||
div []
|
div []
|
||||||
[ h2 [] [ text "Run access simulation" ]
|
[ h2 [] [ text "Run access simulation" ]
|
||||||
|
|
|
@ -35,6 +35,7 @@ update msg m =
|
||||||
UseHierarchy cmh -> updateUseHierarchy cmh m
|
UseHierarchy cmh -> updateUseHierarchy cmh m
|
||||||
Access i -> updateAccess i m
|
Access i -> updateAccess i m
|
||||||
ChangeAccessInput s -> ({ m | accessInput = s }, Cmd.none)
|
ChangeAccessInput s -> ({ m | accessInput = s }, Cmd.none)
|
||||||
|
AccessViewCancel -> updateAccessViewCancel m
|
||||||
AccessViewForward -> updateAccessViewForward m
|
AccessViewForward -> updateAccessViewForward m
|
||||||
AccessViewBack -> updateAccessViewBack m
|
AccessViewBack -> updateAccessViewBack m
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
.btn-group {
|
.btn-group {
|
||||||
width: min-content;
|
width: min-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user