@@ -40,7 +40,12 @@ dimensions such that the left and right are twice as wide as the top and bottom:
4040 myDimensions : Int -> Dimensions
4141 myDimensions n = { left = 2 * n, right = 2 * n, top = n, bottom = n }
4242-}
43−type Dimensions = { left:Int, right:Int, top:Int, bottom:Int }
43+type alias Dimensions =
44+ { left:Int
45+ , right:Int
46+ , top:Int
47+ , bottom:Int
48+ }
4449
4550{-| A field can have a outline around it. This lets you set its color, width,
4651and radius. The radius allows you to round the corners of your field. Set the
@@ -49,7 +54,11 @@ and thin with slightly rounded corners:
4954
5055 { color = grey, width = uniformly 1, radius = 4 }
5156-}
52−type Outline = { color:Color, width:Dimensions, radius:Int }
57+type alias Outline =
58+ { color:Color
59+ , width:Dimensions
60+ , radius:Int
61+ }
5362
5463{-| An outline with zero width, so you cannot see it. -}
5564noOutline : Outline
@@ -62,7 +71,10 @@ is blue and thin:
6271
6372 { color = blue, width = 1 }
6473-}
65−type Highlight = { color:Color, width:Int }
74+type alias Highlight =
75+ { color:Color
76+ , width:Int
77+ }
6678
6779{-| An highlight with zero width, so you cannot see it. -}
6880noHighlight : Highlight
@@ -81,12 +93,12 @@ from the total height to determine how much room there is for text. The
8193`padding` and `outline` appear on the top and bottom, so there will be 28
8294vertical pixels remaining for the text (40 - 1 - 5 - 5 - 1).
8395-}
84−type Style =
85− { padding : Dimensions
86− , outline : Outline
87− , highlight : Highlight
88− , style : Text.Style
89− }
96+type alias Style =
97+ { padding : Dimensions
98+ , outline : Outline
99+ , highlight : Highlight
100+ , style : Text.Style
101+ }
90102
91103{-| The default style for a text field. The outline is `Color.grey` with width
921041 and radius 2. The highlight is `Color.blue` with width 1, and the default
@@ -94,11 +106,11 @@ text color is black.
94106-}
95107defaultStyle : Style
96108defaultStyle =
97− { padding = uniformly 4
98− , outline = Outline Color.grey (uniformly 1) 2
99− , highlight = Highlight Color.blue 1
100− , style = Text.defaultStyle
101− }
109+ { padding = uniformly 4
110+ , outline = Outline Color.grey (uniformly 1) 2
111+ , highlight = Highlight Color.blue 1
112+ , style = Text.defaultStyle
113+ }
102114
103115{-| Represents the current content of a text field. For example:
104116
@@ -107,7 +119,10 @@ defaultStyle =
107119This means the user highlighted the substring `"She"` backwards. The value of
108120`content.string` is `"She sells sea shells"`.
109121-}
110−type Content = { string:String, selection:Selection }
122+type alias Content =
123+ { string:String
124+ , selection:Selection
125+ }
111126
112127{-| The selection within a text field. `start` is never greater than `end`:
113128
@@ -116,14 +131,18 @@ type Content = { string:String, selection:Selection }
116131 Selection 5 9 Backward -- highlighting characters starting after
117132 -- the 5th and ending after the 9th
118133-}
119−type Selection = { start:Int, end:Int, direction:Direction }
134+type alias Selection =
135+ { start:Int
136+ , end:Int
137+ , direction:Direction
138+ }
120139
121140{-| The direction of selection. When the user highlights a selection in a text
122141field, they must do it in a particular direction. This determines which end of
123142the selection moves when they change the selection by pressing Shift-Left or
124143Shift-Right.
125144-}
126−data Direction = Forward | Backward
145+type Direction = Forward | Backward
127146
128147{-| A field with no content:
129148