Skip to content

Commit 446d608

Browse files
Merge pull request #2107 from SylvainCorlay/gridbox
Grid layout
2 parents d3cd77a + 40c7387 commit 446d608

20 files changed

+31841
-906
lines changed

docs/source/examples/Widget Styling.ipynb

Lines changed: 24754 additions & 903 deletions
Large diffs are not rendered by default.
239 Bytes
Loading
246 Bytes
Loading
Loading
Loading
Loading
Loading
249 Bytes
Loading
2.86 KB
Loading
2.86 KB
Loading
2.93 KB
Loading
243 Bytes
Loading

ipywidgets/widgets/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from .widget_core import CoreWidget
1111
from .widget_bool import Checkbox, ToggleButton, Valid
1212
from .widget_button import Button, ButtonStyle
13-
from .widget_box import Box, HBox, VBox
13+
from .widget_box import Box, HBox, VBox, GridBox
1414
from .widget_float import FloatText, BoundedFloatText, FloatSlider, FloatProgress, FloatRangeSlider, FloatLogSlider
1515
from .widget_image import Image
1616
from .widget_int import IntText, BoundedIntText, IntSlider, IntProgress, IntRangeSlider, Play, SliderStyle

ipywidgets/widgets/widget_box.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,10 @@ class HBox(Box):
107107
"""
108108
_model_name = Unicode('HBoxModel').tag(sync=True)
109109
_view_name = Unicode('HBoxView').tag(sync=True)
110+
111+
112+
@register
113+
class GridBox(Box):
114+
_model_name = Unicode('GridBoxModel').tag(sync=True)
115+
_view_name = Unicode('GridBoxView').tag(sync=True)
116+

ipywidgets/widgets/widget_layout.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ class Layout(Widget):
6161
visibility = CaselessStrEnum(['visible', 'hidden']+CSS_PROPERTIES, allow_none=True, help="The visibility CSS attribute.").tag(sync=True)
6262
width = Unicode(None, allow_none=True, help="The width CSS attribute.").tag(sync=True)
6363

64+
grid_auto_columns = Unicode(None, allow_none=True, help="The grid-auto-columns CSS attribute.").tag(sync=True)
65+
grid_auto_flow = CaselessStrEnum(['column','row','row dense','column dense']+ CSS_PROPERTIES, allow_none=True, help="The grid-auto-flow CSS attribute.").tag(sync=True)
66+
grid_auto_rows = Unicode(None, allow_none=True, help="The grid-auto-rows CSS attribute.").tag(sync=True)
67+
grid_gap = Unicode(None, allow_none=True, help="The grid-gap CSS attribute.").tag(sync=True)
68+
grid_template_rows = Unicode(None, allow_none=True, help="The grid-template-rows CSS attribute.").tag(sync=True)
69+
grid_template_columns = Unicode(None, allow_none=True, help="The grid-template-columns CSS attribute.").tag(sync=True)
70+
grid_template_areas = Unicode(None, allow_none=True, help="The grid-template-areas CSS attribute.").tag(sync=True)
71+
grid_row = Unicode(None, allow_none=True, help="The grid-row CSS attribute.").tag(sync=True)
72+
grid_column = Unicode(None, allow_none=True, help="The grid-column CSS attribute.").tag(sync=True)
73+
grid_area = Unicode(None, allow_none=True, help="The grid-area CSS attribute.").tag(sync=True)
74+
6475

6576
class LayoutTraitType(Instance):
6677

0 commit comments

Comments
 (0)