##// END OF EJS Templates
Using the Color trait type for styling widgets
Sylvain Corlay -
Show More
@@ -20,7 +20,7 b' from IPython.kernel.comm import Comm'
20 20 from IPython.config import LoggingConfigurable
21 21 from IPython.utils.importstring import import_item
22 22 from IPython.utils.traitlets import Unicode, Dict, Instance, Bool, List, \
23 CaselessStrEnum, Tuple, CUnicode, Int, Set
23 CaselessStrEnum, Tuple, CUnicode, Int, Set, Color
24 24 from IPython.utils.py3compat import string_types
25 25
26 26 #-----------------------------------------------------------------------------
@@ -438,9 +438,9 b' class DOMWidget(Widget):'
438 438 padding = CUnicode(sync=True)
439 439 margin = CUnicode(sync=True)
440 440
441 color = Unicode(sync=True)
442 background_color = Unicode(sync=True)
443 border_color = Unicode(sync=True)
441 color = Color(None, allow_none=True, sync=True)
442 background_color = Color(None, allow_none=True, sync=True)
443 border_color = Color(None, allow_none=True, sync=True)
444 444
445 445 border_width = CUnicode(sync=True)
446 446 border_radius = CUnicode(sync=True)
@@ -14,7 +14,7 b' Represents an unbounded float using a widget.'
14 14 # Imports
15 15 #-----------------------------------------------------------------------------
16 16 from .widget import DOMWidget, register
17 from IPython.utils.traitlets import Unicode, CFloat, Bool, CaselessStrEnum, Tuple
17 from IPython.utils.traitlets import Unicode, CFloat, Bool, CaselessStrEnum, Tuple, Color
18 18 from IPython.utils.warn import DeprecatedClass
19 19
20 20 #-----------------------------------------------------------------------------
@@ -133,7 +133,7 b' class FloatSlider(_BoundedFloat):'
133 133 default_value='horizontal', help="Vertical or horizontal.", sync=True)
134 134 _range = Bool(False, help="Display a range selector", sync=True)
135 135 readout = Bool(True, help="Display the current value of the slider next to it.", sync=True)
136 slider_color = Unicode(sync=True)
136 slider_color = Color(None, allow_none=True, sync=True)
137 137
138 138
139 139 @register('IPython.FloatProgress')
@@ -287,7 +287,7 b' class FloatRangeSlider(_BoundedFloatRange):'
287 287 default_value='horizontal', help="Vertical or horizontal.", sync=True)
288 288 _range = Bool(True, help="Display a range selector", sync=True)
289 289 readout = Bool(True, help="Display the current value of the slider next to it.", sync=True)
290 slider_color = Unicode(sync=True)
290 slider_color = Color(None, allow_none=True, sync=True)
291 291
292 292 # Remove in IPython 4.0
293 293 FloatTextWidget = DeprecatedClass(FloatText, 'FloatTextWidget')
@@ -14,7 +14,7 b' Represents an unbounded int using a widget.'
14 14 # Imports
15 15 #-----------------------------------------------------------------------------
16 16 from .widget import DOMWidget, register
17 from IPython.utils.traitlets import Unicode, CInt, Bool, CaselessStrEnum, Tuple
17 from IPython.utils.traitlets import Unicode, CInt, Bool, CaselessStrEnum, Tuple, Color
18 18 from IPython.utils.warn import DeprecatedClass
19 19
20 20 #-----------------------------------------------------------------------------
@@ -87,7 +87,7 b' class IntSlider(_BoundedInt):'
87 87 default_value='horizontal', help="Vertical or horizontal.", sync=True)
88 88 _range = Bool(False, help="Display a range selector", sync=True)
89 89 readout = Bool(True, help="Display the current value of the slider next to it.", sync=True)
90 slider_color = Unicode(sync=True)
90 slider_color = Color(None, allow_none=True, sync=True)
91 91
92 92
93 93 @register('IPython.IntProgress')
@@ -198,7 +198,7 b' class IntRangeSlider(_BoundedIntRange):'
198 198 default_value='horizontal', help="Vertical or horizontal.", sync=True)
199 199 _range = Bool(True, help="Display a range selector", sync=True)
200 200 readout = Bool(True, help="Display the current value of the slider next to it.", sync=True)
201 slider_color = Unicode(sync=True)
201 slider_color = Color(None, allow_none=True, sync=True)
202 202
203 203 # Remove in IPython 4.0
204 204 IntTextWidget = DeprecatedClass(IntText, 'IntTextWidget')
General Comments 0
You need to be logged in to leave comments. Login now