mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-19 19:51:37 +03:00
Move the button wrapping to an attribute list
This commit is contained in:
parent
6c4048d040
commit
ef010f8967
@ -153,8 +153,7 @@ view state =
|
|||||||
Menu.button
|
Menu.button
|
||||||
(defaultButtonAttributes
|
(defaultButtonAttributes
|
||||||
++ List.filterMap identity
|
++ List.filterMap identity
|
||||||
[ Just <| Menu.wrapping viewConfiguration.wrapping
|
[ Maybe.map Menu.icon viewConfiguration.icon
|
||||||
, Maybe.map Menu.icon viewConfiguration.icon
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
"1st Period English with Mx. Trainer"
|
"1st Period English with Mx. Trainer"
|
||||||
@ -285,6 +284,7 @@ controlButtonAttributes =
|
|||||||
ControlExtra.list
|
ControlExtra.list
|
||||||
|> ControlExtra.optionalBoolListItemDefaultTrue "hasBorder" ( "Menu.hasBorder False", Menu.hasBorder False )
|
|> ControlExtra.optionalBoolListItemDefaultTrue "hasBorder" ( "Menu.hasBorder False", Menu.hasBorder False )
|
||||||
|> ControlExtra.optionalListItem "buttonWidth" controlButtonWidth
|
|> ControlExtra.optionalListItem "buttonWidth" controlButtonWidth
|
||||||
|
|> ControlExtra.optionalListItem "wrapping" controlWrapping
|
||||||
|
|
||||||
|
|
||||||
controlButtonWidth : Control ( String, Menu.ButtonAttribute )
|
controlButtonWidth : Control ( String, Menu.ButtonAttribute )
|
||||||
@ -294,21 +294,26 @@ controlButtonWidth =
|
|||||||
(ControlExtra.int 220)
|
(ControlExtra.int 220)
|
||||||
|
|
||||||
|
|
||||||
|
controlWrapping : Control ( String, Menu.ButtonAttribute )
|
||||||
|
controlWrapping =
|
||||||
|
Control.choice
|
||||||
|
[ ( "WrapAndExpandTitle"
|
||||||
|
, Control.value ( "Menu.wrapping Menu.WrapAndExpandTitle", Menu.wrapping Menu.WrapAndExpandTitle )
|
||||||
|
)
|
||||||
|
, ( "TruncateTitle"
|
||||||
|
, Control.value ( "Menu.wrapping Menu.TruncateTitle", Menu.wrapping Menu.TruncateTitle )
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
type alias ViewConfiguration =
|
type alias ViewConfiguration =
|
||||||
{ wrapping : Menu.TitleWrapping
|
{ icon : Maybe Svg
|
||||||
, icon : Maybe Svg
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
initViewConfiguration : Control ViewConfiguration
|
initViewConfiguration : Control ViewConfiguration
|
||||||
initViewConfiguration =
|
initViewConfiguration =
|
||||||
Control.record ViewConfiguration
|
Control.record ViewConfiguration
|
||||||
|> Control.field "wrapping"
|
|
||||||
(Control.choice
|
|
||||||
[ ( "WrapAndExpandTitle", Control.value Menu.WrapAndExpandTitle )
|
|
||||||
, ( "TruncateTitle", Control.value Menu.TruncateTitle )
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|> Control.field "icon"
|
|> Control.field "icon"
|
||||||
(Control.maybe False
|
(Control.maybe False
|
||||||
(Control.choice
|
(Control.choice
|
||||||
|
Loading…
Reference in New Issue
Block a user