@@ -179,12 +179,12 @@ end
179
179
180
180
Create a widget to select colors.
181
181
"""
182
- function colorpicker (:: WidgetTheme , val= colorant " #000000" ; value= val, kwargs... )
182
+ function colorpicker (theme :: WidgetTheme , val= colorant " #000000" ; value= val, kwargs... )
183
183
(value isa AbstractObservable) || (value = Observable {Color} (value))
184
184
f = t -> " #" * hex (t)
185
185
g = t -> parse (Colorant,t)
186
186
pair = ObservablePair (value, f= f, g= g)
187
- ui = input (pair. second; typ= " color" , kwargs... )
187
+ ui = input (theme, pair. second; typ= " color" , kwargs... )
188
188
Widget {:colorpicker} (ui, output = value)
189
189
end
190
190
@@ -262,15 +262,15 @@ as initial value.
262
262
Widget {:input} (data, scope = ui, output = ui[bindto], layout = node (:div , className = " field interact-widget" )∘ Widgets. scope)
263
263
end
264
264
265
- @noinline function input (:: WidgetTheme ; typ= " text" , kwargs... )
265
+ @noinline function input (theme :: WidgetTheme ; typ= " text" , kwargs... )
266
266
if typ in [" checkbox" , " radio" ]
267
267
o = false
268
268
elseif typ in [" number" , " range" ]
269
269
o = 0.0
270
270
else
271
271
o = " "
272
272
end
273
- input (o; typ= typ, kwargs... )
273
+ input (theme, o; typ= typ, kwargs... )
274
274
end
275
275
276
276
"""
@@ -318,7 +318,7 @@ for wdg in [:toggle, :checkbox]
318
318
widgettype = $ (Expr (:quote , wdg))
319
319
wdgtyp = string (widgettype)
320
320
labelclass = mergeclasses (getclass (theme, :input , wdgtyp, " label" ), labelclass)
321
- ui = input (value; bind= bind, typ= " checkbox" , valueUpdate= " change" , wdgtyp= wdgtyp, id= s, kwargs... )
321
+ ui = input (theme, value; bind= bind, typ= " checkbox" , valueUpdate= " change" , wdgtyp= wdgtyp, id= s, kwargs... )
322
322
Widgets. scope (ui). dom = node (:div , className = " field interact-widget" )(Widgets. scope (ui). dom, dom " label[className=$labelclass, for=$s]" (label... ))
323
323
Widget {widgettype} (ui)
324
324
end
@@ -351,7 +351,7 @@ several lines.
351
351
"""
352
352
function textbox (theme:: WidgetTheme , hint= " " ; multiline= false , placeholder= hint, value= " " , typ= " text" , kwargs... )
353
353
multiline && return textarea (theme; placeholder= placeholder, value= value, kwargs... )
354
- Widget {:textbox} (input (value; typ= typ, placeholder= placeholder, kwargs... ))
354
+ Widget {:textbox} (input (theme, value; typ= typ, placeholder= placeholder, kwargs... ))
355
355
end
356
356
357
357
"""
0 commit comments