@@ -188,6 +188,27 @@ type Label msg
188 | HiddenLabel String
188 | HiddenLabel String
191+isStacked : Label msg -> Bool
192labelRight : List (Attribute msg) -> Element msg -> Label msg
213labelRight : List (Attribute msg) -> Element msg -> Label msg
193labelRight =
214labelRight =
@@ -780,7 +801,7 @@ textHelper textInput attrs textOptions =
780 defaultTextBoxStyle ++ attrs
801 defaultTextBoxStyle ++ attrs
782 redistributed =
803 redistributed =
783− redistribute withDefaults
804+ redistribute (isStacked textOptions.label) withDefaults
785 moveUpToCompensateForPadding =
806 moveUpToCompensateForPadding =
786 calcMoveToCompensateForPadding withDefaults
807 calcMoveToCompensateForPadding withDefaults
@@ -1003,7 +1024,8 @@ redistribute them to the parent, the input, or the cover.
1005redistribute :
1026redistribute :
1006− List (Attribute msg)
1028+ -> List (Attribute msg)
1008 { fullParent : List (Attribute msg)
1030 { fullParent : List (Attribute msg)
1009 , parent : List (Attribute msg)
1031 , parent : List (Attribute msg)
@@ -1011,8 +1033,8 @@ redistribute :
1011 , input : List (Attribute msg)
1033 , input : List (Attribute msg)
1012 , cover : List (Attribute msg)
1034 , cover : List (Attribute msg)
1014−redistribute attrs =
1036+redistribute stacked attrs =
1015− List.foldl redistributeOver
1037+ List.foldl (redistributeOver stacked)
1016 { fullParent = []
1038 { fullParent = []
1017 , parent = []
1039 , parent = []
1018 , input = []
1040 , input = []
@@ -1030,27 +1052,105 @@ redistribute attrs =
1060+ Internal.Content ->
1066+ Internal.Min _ l ->
1069+ Internal.Max _ l ->
1075+ Internal.Content ->
1084+ Internal.Min _ l ->
1087+ Internal.Max _ l ->
1093+ Internal.Content ->
1102+ Internal.Min _ l ->
1105+ Internal.Max _ l ->
1109+{-| isStacked means that the label is above or below
1033−redistributeOver attr els =
1111+redistributeOver stacked attr els =
1034 case attr of
1112 case attr of
1035 Internal.Nearby _ _ ->
1113 Internal.Nearby _ _ ->
1036 { els | parent = attr :: els.parent }
1114 { els | parent = attr :: els.parent }
1038− Internal.Width (Internal.Fill _) ->
1116+ Internal.Width width ->
1039− { els | fullParent = attr :: els.fullParent }
1118+ { els | fullParent = attr :: els.fullParent }
1041− Internal.Width _ ->
1120+ else if isFill width then
1122+ | fullParent = attr :: els.fullParent
1042− { els | parent = attr :: els.parent }
1123+ , parent = attr :: els.parent
1044− Internal.Height (Internal.Fill _) ->
1126+ else if isPixel width then
1045− { els
1127+ { els | parent = attr :: els.parent }
1046− | fullParent = attr :: els.fullParent
1047− , parent = attr :: els.parent
1131+ | parent = attr :: els.parent
1050− Internal.Height h ->
1134+ Internal.Height height ->
1135+ if not stacked then
1137+ | fullParent = attr :: els.fullParent
1138+ , parent = attr :: els.parent
1141+ else if isFill height then
1143+ | fullParent = attr :: els.fullParent
1144+ , parent = attr :: els.parent
1147+ else if isPixel height then
1052− | parent = attr :: els.parent
1148+ { els | parent = attr :: els.parent }
1152+ | parent = attr :: els.parent
1055 Internal.AlignX _ ->
1155 Internal.AlignX _ ->
1056 { els | fullParent = attr :: els.fullParent }
1156 { els | fullParent = attr :: els.fullParent }