Commit abf2a721 authored by David Davó's avatar David Davó

Added DesciptionStyle

parent 45fcace9
...@@ -106,6 +106,8 @@ library ...@@ -106,6 +106,8 @@ library
IHaskell.Display.Widgets.String.Password IHaskell.Display.Widgets.String.Password
IHaskell.Display.Widgets.String.Text IHaskell.Display.Widgets.String.Text
IHaskell.Display.Widgets.String.TextArea IHaskell.Display.Widgets.String.TextArea
IHaskell.Display.Widgets.Style.ButtonStyle
IHaskell.Display.Widgets.Style.DescriptionStyle
IHaskell.Display.Widgets.Layout.Common IHaskell.Display.Widgets.Layout.Common
IHaskell.Display.Widgets.Layout.LayoutWidget IHaskell.Display.Widgets.Layout.LayoutWidget
......
...@@ -55,6 +55,9 @@ import IHaskell.Display.Widgets.String.Password as X ...@@ -55,6 +55,9 @@ import IHaskell.Display.Widgets.String.Password as X
import IHaskell.Display.Widgets.String.Text as X import IHaskell.Display.Widgets.String.Text as X
import IHaskell.Display.Widgets.String.TextArea as X import IHaskell.Display.Widgets.String.TextArea as X
import IHaskell.Display.Widgets.Style.ButtonStyle as X
import IHaskell.Display.Widgets.Style.DescriptionStyle as X
import IHaskell.Display.Widgets.Common as X import IHaskell.Display.Widgets.Common as X
import IHaskell.Display.Widgets.Types as X (setField, getField, properties, triggerDisplay, import IHaskell.Display.Widgets.Types as X (setField, getField, properties, triggerDisplay,
triggerChange, triggerClick, triggerSelection, triggerChange, triggerClick, triggerSelection,
......
...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'CheckBox' represents a Checkbox widget from IPython.html.widgets. -- | A 'CheckBox' represents a Checkbox widget from IPython.html.widgets.
type CheckBox = IPythonWidget 'CheckBoxType type CheckBox = IPythonWidget 'CheckBoxType
...@@ -37,8 +38,9 @@ mkCheckBox = do ...@@ -37,8 +38,9 @@ mkCheckBox = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boolAttrs = defaultBoolWidget "CheckboxView" "CheckboxModel" layout let boolAttrs = defaultBoolWidget "CheckboxView" "CheckboxModel" layout dstyle
checkBoxAttrs = (Indent =:: True) checkBoxAttrs = (Indent =:: True)
:& RNil :& RNil
widgetState = WidgetState $ boolAttrs <+> checkBoxAttrs widgetState = WidgetState $ boolAttrs <+> checkBoxAttrs
......
...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'ToggleButton' represents a ToggleButton widget from IPython.html.widgets. -- | A 'ToggleButton' represents a ToggleButton widget from IPython.html.widgets.
type ToggleButton = IPythonWidget 'ToggleButtonType type ToggleButton = IPythonWidget 'ToggleButtonType
...@@ -37,8 +38,9 @@ mkToggleButton = do ...@@ -37,8 +38,9 @@ mkToggleButton = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boolState = defaultBoolWidget "ToggleButtonView" "ToggleButtonModel" layout let boolState = defaultBoolWidget "ToggleButtonView" "ToggleButtonModel" layout dstyle
toggleState = (Icon =:: "") toggleState = (Icon =:: "")
:& (ButtonStyle =:: DefaultButton) :& (ButtonStyle =:: DefaultButton)
:& RNil :& RNil
......
...@@ -26,6 +26,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -26,6 +26,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'ValidWidget' represents a Valid widget from IPython.html.widgets. -- | A 'ValidWidget' represents a Valid widget from IPython.html.widgets.
type ValidWidget = IPythonWidget 'ValidType type ValidWidget = IPythonWidget 'ValidType
...@@ -36,8 +37,9 @@ mkValidWidget = do ...@@ -36,8 +37,9 @@ mkValidWidget = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boolState = defaultBoolWidget "ValidView" "ValidModel" layout let boolState = defaultBoolWidget "ValidView" "ValidModel" layout dstyle
validState = (ReadOutMsg =:: "") :& RNil validState = (ReadOutMsg =:: "") :& RNil
widgetState = WidgetState $ boolState <+> validState widgetState = WidgetState $ boolState <+> validState
......
...@@ -10,10 +10,6 @@ module IHaskell.Display.Widgets.Button ...@@ -10,10 +10,6 @@ module IHaskell.Display.Widgets.Button
Button Button
-- * Create a new button -- * Create a new button
, mkButton , mkButton
-- * Button style
, ButtonStyle
-- * Create a new button style
, mkButtonStyle
) where ) where
-- To keep `cabal repl` happy when running from the ihaskell repo -- To keep `cabal repl` happy when running from the ihaskell repo
...@@ -29,34 +25,9 @@ import IHaskell.IPython.Message.UUID as U ...@@ -29,34 +25,9 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Style.ButtonStyle
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'ButtonStyle' represents a Button Style from IPython.html.widgets.
type ButtonStyle = IPythonWidget 'ButtonStyleType
-- | Create a new button style
mkButtonStyle :: IO ButtonStyle
mkButtonStyle = do
wid <- U.random
let stl = defaultStyleWidget "ButtonStyleModel"
but = (ButtonColor =:: Nothing)
:& (FontWeight =:: DefaultWeight)
:& RNil
btnStlState = WidgetState (stl <+> but)
stateIO <- newIORef btnStlState
let style = IPythonWidget wid stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen style $ toJSON btnStlState
-- Return the style widget
return style
instance IHaskellWidget ButtonStyle where
getCommUUID = uuid
-- | A 'Button' represents a Button from IPython.html.widgets. -- | A 'Button' represents a Button from IPython.html.widgets.
type Button = IPythonWidget 'ButtonType type Button = IPythonWidget 'ButtonType
...@@ -67,14 +38,14 @@ mkButton = do ...@@ -67,14 +38,14 @@ mkButton = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
btnstyle <- mkButtonStyle
style <- mkButtonStyle let ddw = defaultDescriptionWidget "ButtonView" "ButtonModel" layout dstyle
let ddw = defaultDescriptionWidget "ButtonView" "ButtonModel" layout
but = (Disabled =:: False) but = (Disabled =:: False)
:& (Icon =:: "") :& (Icon =:: "")
:& (ButtonStyle =:: DefaultButton) :& (ButtonStyle =:: DefaultButton)
:& (StyleButton =:: style) :& (StyleButton =:: btnstyle)
:& (ClickHandler =:: return ()) :& (ClickHandler =:: return ())
:& RNil :& RNil
buttonState = WidgetState (ddw <+> but) buttonState = WidgetState (ddw <+> but)
......
...@@ -26,6 +26,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -26,6 +26,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'ColorPicker' represents a ColorPicker from IPython.html.widgets. -- | A 'ColorPicker' represents a ColorPicker from IPython.html.widgets.
type ColorPicker = IPythonWidget 'ColorPickerType type ColorPicker = IPythonWidget 'ColorPickerType
...@@ -36,8 +37,9 @@ mkColorPicker = do ...@@ -36,8 +37,9 @@ mkColorPicker = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let ddw = defaultDescriptionWidget "ColorPickerView" "ColorPickerModel" layout let ddw = defaultDescriptionWidget "ColorPickerView" "ColorPickerModel" layout dstyle
color = (StringValue =:: "black") color = (StringValue =:: "black")
:& (Concise =:: False) :& (Concise =:: False)
:& (Disabled =:: False) :& (Disabled =:: False)
......
...@@ -110,6 +110,7 @@ pattern Buttons = S.SButtons ...@@ -110,6 +110,7 @@ pattern Buttons = S.SButtons
pattern Axes = S.SAxes pattern Axes = S.SAxes
pattern ButtonColor = S.SButtonColor pattern ButtonColor = S.SButtonColor
pattern FontWeight = S.SFontWeight pattern FontWeight = S.SFontWeight
pattern DescriptionWidth = S.SDescriptionWidth
pattern StyleButton = S.SStyleButton pattern StyleButton = S.SStyleButton
pattern StyleDescription = S.SStyleDescription pattern StyleDescription = S.SStyleDescription
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'DatePicker' represents a DatePicker from IPython.html.widgets. -- | A 'DatePicker' represents a DatePicker from IPython.html.widgets.
type DatePicker = IPythonWidget 'DatePickerType type DatePicker = IPythonWidget 'DatePickerType
...@@ -38,8 +39,9 @@ mkDatePicker = do ...@@ -38,8 +39,9 @@ mkDatePicker = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let ddw = defaultDescriptionWidget "DatePickerView" "DatePickerModel" layout let ddw = defaultDescriptionWidget "DatePickerView" "DatePickerModel" layout dstyle
date = (DateValue =:: defaultDate) date = (DateValue =:: defaultDate)
:& (Disabled =:: False) :& (Disabled =:: False)
:& RNil :& RNil
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'BoundedFloatText' represents an BoundedFloatText widget from IPython.html.widgets. -- | 'BoundedFloatText' represents an BoundedFloatText widget from IPython.html.widgets.
type BoundedFloatText = IPythonWidget 'BoundedFloatTextType type BoundedFloatText = IPythonWidget 'BoundedFloatTextType
...@@ -38,8 +39,9 @@ mkBoundedFloatText = do ...@@ -38,8 +39,9 @@ mkBoundedFloatText = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedFloatAttrs = defaultBoundedFloatWidget "FloatTextView" "BoundedFloatTextModel" layout let boundedFloatAttrs = defaultBoundedFloatWidget "FloatTextView" "BoundedFloatTextModel" layout dstyle
textAttrs = (Disabled =:: False) textAttrs = (Disabled =:: False)
:& (ContinuousUpdate =:: False) :& (ContinuousUpdate =:: False)
:& (StepFloat =:: Nothing) :& (StepFloat =:: Nothing)
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'FloatLogSlider' represents an FloatLogSlider widget from IPython.html.widgets. -- | 'FloatLogSlider' represents an FloatLogSlider widget from IPython.html.widgets.
type FloatLogSlider = IPythonWidget 'FloatLogSliderType type FloatLogSlider = IPythonWidget 'FloatLogSliderType
...@@ -38,8 +39,9 @@ mkFloatLogSlider = do ...@@ -38,8 +39,9 @@ mkFloatLogSlider = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedLogFloatAttrs = defaultBoundedLogFloatWidget "FloatLogSliderView" "FloatLogSliderModel" layout let boundedLogFloatAttrs = defaultBoundedLogFloatWidget "FloatLogSliderView" "FloatLogSliderModel" layout dstyle
sliderAttrs = (StepFloat =:: Just 0.1) sliderAttrs = (StepFloat =:: Just 0.1)
:& (Orientation =:: HorizontalOrientation) :& (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True) :& (ReadOut =:: True)
......
...@@ -26,6 +26,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -26,6 +26,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'FloatProgress' represents an FloatProgress widget from IPython.html.widgets. -- | 'FloatProgress' represents an FloatProgress widget from IPython.html.widgets.
type FloatProgress = IPythonWidget 'FloatProgressType type FloatProgress = IPythonWidget 'FloatProgressType
...@@ -36,8 +37,9 @@ mkFloatProgress = do ...@@ -36,8 +37,9 @@ mkFloatProgress = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedFloatAttrs = defaultBoundedFloatWidget "ProgressView" "FloatProgressModel" layout let boundedFloatAttrs = defaultBoundedFloatWidget "ProgressView" "FloatProgressModel" layout dstyle
progressAttrs = (Orientation =:: HorizontalOrientation) progressAttrs = (Orientation =:: HorizontalOrientation)
:& (BarStyle =:: DefaultBar) :& (BarStyle =:: DefaultBar)
:& RNil :& RNil
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'FloatSlider' represents an FloatSlider widget from IPython.html.widgets. -- | 'FloatSlider' represents an FloatSlider widget from IPython.html.widgets.
type FloatSlider = IPythonWidget 'FloatSliderType type FloatSlider = IPythonWidget 'FloatSliderType
...@@ -38,8 +39,9 @@ mkFloatSlider = do ...@@ -38,8 +39,9 @@ mkFloatSlider = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedFloatAttrs = defaultBoundedFloatWidget "FloatSliderView" "FloatSliderModel" layout let boundedFloatAttrs = defaultBoundedFloatWidget "FloatSliderView" "FloatSliderModel" layout dstyle
sliderAttrs = (StepFloat =:: Just 0.1) sliderAttrs = (StepFloat =:: Just 0.1)
:& (Orientation =:: HorizontalOrientation) :& (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True) :& (ReadOut =:: True)
......
...@@ -29,6 +29,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -29,6 +29,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'FloatRangeSlider' represents an FloatRangeSlider widget from IPython.html.widgets. -- | 'FloatRangeSlider' represents an FloatRangeSlider widget from IPython.html.widgets.
type FloatRangeSlider = IPythonWidget 'FloatRangeSliderType type FloatRangeSlider = IPythonWidget 'FloatRangeSliderType
...@@ -39,8 +40,9 @@ mkFloatRangeSlider = do ...@@ -39,8 +40,9 @@ mkFloatRangeSlider = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedFloatAttrs = defaultBoundedFloatRangeWidget "FloatRangeSliderView" "FloatRangeSliderModel" layout let boundedFloatAttrs = defaultBoundedFloatRangeWidget "FloatRangeSliderView" "FloatRangeSliderModel" layout dstyle
sliderAttrs = (StepFloat =:: Just 0.1) sliderAttrs = (StepFloat =:: Just 0.1)
:& (Orientation =:: HorizontalOrientation) :& (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True) :& (ReadOut =:: True)
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'FloatText' represents an FloatText widget from IPython.html.widgets. -- | 'FloatText' represents an FloatText widget from IPython.html.widgets.
type FloatText = IPythonWidget 'FloatTextType type FloatText = IPythonWidget 'FloatTextType
...@@ -38,8 +39,9 @@ mkFloatText = do ...@@ -38,8 +39,9 @@ mkFloatText = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let floatAttrs = defaultFloatWidget "FloatTextView" "FloatTextModel" layout let floatAttrs = defaultFloatWidget "FloatTextView" "FloatTextModel" layout dstyle
textAttrs = (Disabled =:: False) textAttrs = (Disabled =:: False)
:& (ContinuousUpdate =:: False) :& (ContinuousUpdate =:: False)
:& (StepFloat =:: Nothing) :& (StepFloat =:: Nothing)
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'BoundedIntText' represents an BoundedIntText widget from IPython.html.widgets. -- | 'BoundedIntText' represents an BoundedIntText widget from IPython.html.widgets.
type BoundedIntText = IPythonWidget 'BoundedIntTextType type BoundedIntText = IPythonWidget 'BoundedIntTextType
...@@ -38,8 +39,9 @@ mkBoundedIntText = do ...@@ -38,8 +39,9 @@ mkBoundedIntText = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedIntAttrs = defaultBoundedIntWidget "IntTextView" "BoundedIntTextModel" layout let boundedIntAttrs = defaultBoundedIntWidget "IntTextView" "BoundedIntTextModel" layout dstyle
textAttrs = (Disabled =:: False) textAttrs = (Disabled =:: False)
:& (ContinuousUpdate =:: False) :& (ContinuousUpdate =:: False)
:& (StepInt =:: Just 1) :& (StepInt =:: Just 1)
......
...@@ -26,6 +26,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -26,6 +26,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'IntProgress' represents an IntProgress widget from IPython.html.widgets. -- | 'IntProgress' represents an IntProgress widget from IPython.html.widgets.
type IntProgress = IPythonWidget 'IntProgressType type IntProgress = IPythonWidget 'IntProgressType
...@@ -36,8 +37,9 @@ mkIntProgress = do ...@@ -36,8 +37,9 @@ mkIntProgress = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedIntAttrs = defaultBoundedIntWidget "ProgressView" "IntProgressModel" layout let boundedIntAttrs = defaultBoundedIntWidget "ProgressView" "IntProgressModel" layout dstyle
progressAttrs = (Orientation =:: HorizontalOrientation) progressAttrs = (Orientation =:: HorizontalOrientation)
:& (BarStyle =:: DefaultBar) :& (BarStyle =:: DefaultBar)
:& RNil :& RNil
......
...@@ -28,6 +28,7 @@ import IHaskell.Display (IHaskellWidget(..)) ...@@ -28,6 +28,7 @@ import IHaskell.Display (IHaskellWidget(..))
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'IntSlider' represents an IntSlider widget from IPython.html.widgets. -- | 'IntSlider' represents an IntSlider widget from IPython.html.widgets.
type IntSlider = IPythonWidget 'IntSliderType type IntSlider = IPythonWidget 'IntSliderType
...@@ -38,8 +39,9 @@ mkIntSlider = do ...@@ -38,8 +39,9 @@ mkIntSlider = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedIntAttrs = defaultBoundedIntWidget "IntSliderView" "IntSliderModel" layout let boundedIntAttrs = defaultBoundedIntWidget "IntSliderView" "IntSliderModel" layout dstyle
sliderAttrs = (StepInt =:: Just 1) sliderAttrs = (StepInt =:: Just 1)
:& (Orientation =:: HorizontalOrientation) :& (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True) :& (ReadOut =:: True)
......
...@@ -28,6 +28,7 @@ import IHaskell.Display (IHaskellWidget(..)) ...@@ -28,6 +28,7 @@ import IHaskell.Display (IHaskellWidget(..))
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'Play' represents an Play widget from IPython.html.widgets. -- | 'Play' represents an Play widget from IPython.html.widgets.
type Play = IPythonWidget 'PlayType type Play = IPythonWidget 'PlayType
...@@ -38,8 +39,9 @@ mkPlay = do ...@@ -38,8 +39,9 @@ mkPlay = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedIntAttrs = defaultBoundedIntWidget "PlayView" "PlayModel" layout let boundedIntAttrs = defaultBoundedIntWidget "PlayView" "PlayModel" layout dstyle
playAttrs = (Playing =:: True) playAttrs = (Playing =:: True)
:& (Repeat =:: True) :& (Repeat =:: True)
:& (Interval =:: 100) :& (Interval =:: 100)
......
...@@ -29,6 +29,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -29,6 +29,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'IntRangeSlider' represents an IntRangeSlider widget from IPython.html.widgets. -- | 'IntRangeSlider' represents an IntRangeSlider widget from IPython.html.widgets.
type IntRangeSlider = IPythonWidget 'IntRangeSliderType type IntRangeSlider = IPythonWidget 'IntRangeSliderType
...@@ -39,8 +40,9 @@ mkIntRangeSlider = do ...@@ -39,8 +40,9 @@ mkIntRangeSlider = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedIntAttrs = defaultBoundedIntRangeWidget "IntRangeSliderView" "IntRangeSliderModel" layout let boundedIntAttrs = defaultBoundedIntRangeWidget "IntRangeSliderView" "IntRangeSliderModel" layout dstyle
sliderAttrs = (StepInt =:: Just 1) sliderAttrs = (StepInt =:: Just 1)
:& (Orientation =:: HorizontalOrientation) :& (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True) :& (ReadOut =:: True)
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | 'IntText' represents an IntText widget from IPython.html.widgets. -- | 'IntText' represents an IntText widget from IPython.html.widgets.
type IntText = IPythonWidget 'IntTextType type IntText = IPythonWidget 'IntTextType
...@@ -38,8 +39,9 @@ mkIntText = do ...@@ -38,8 +39,9 @@ mkIntText = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let intAttrs = defaultIntWidget "IntTextView" "IntTextModel" layout let intAttrs = defaultIntWidget "IntTextView" "IntTextModel" layout dstyle
textAttrs = (Disabled =:: False) textAttrs = (Disabled =:: False)
:& (ContinuousUpdate =:: False) :& (ContinuousUpdate =:: False)
:& (StepInt =:: Just 1) :& (StepInt =:: Just 1)
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'Dropdown' represents a Dropdown widget from IPython.html.widgets. -- | A 'Dropdown' represents a Dropdown widget from IPython.html.widgets.
type Dropdown = IPythonWidget 'DropdownType type Dropdown = IPythonWidget 'DropdownType
...@@ -38,8 +39,9 @@ mkDropdown = do ...@@ -38,8 +39,9 @@ mkDropdown = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultSelectionWidget "DropdownView" "DropdownModel" layout let widgetState = WidgetState $ defaultSelectionWidget "DropdownView" "DropdownModel" layout dstyle
stateIO <- newIORef widgetState stateIO <- newIORef widgetState
......
...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'RadioButtons' represents a RadioButtons widget from IPython.html.widgets. -- | A 'RadioButtons' represents a RadioButtons widget from IPython.html.widgets.
type RadioButtons = IPythonWidget 'RadioButtonsType type RadioButtons = IPythonWidget 'RadioButtonsType
...@@ -37,8 +38,9 @@ mkRadioButtons = do ...@@ -37,8 +38,9 @@ mkRadioButtons = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultSelectionWidget "RadioButtonsView" "RadioButtonsModel" layout let widgetState = WidgetState $ defaultSelectionWidget "RadioButtonsView" "RadioButtonsModel" layout dstyle
stateIO <- newIORef widgetState stateIO <- newIORef widgetState
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'Select' represents a Select widget from IPython.html.widgets. -- | A 'Select' represents a Select widget from IPython.html.widgets.
type Select = IPythonWidget 'SelectType type Select = IPythonWidget 'SelectType
...@@ -38,8 +39,9 @@ mkSelect = do ...@@ -38,8 +39,9 @@ mkSelect = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultSelectionWidget "SelectView" "SelectModel" layout let selectionAttrs = defaultSelectionWidget "SelectView" "SelectModel" layout dstyle
selectAttrs = (Rows =:: Just 5) selectAttrs = (Rows =:: Just 5)
:& RNil :& RNil
widgetState = WidgetState $ selectionAttrs <+> selectAttrs widgetState = WidgetState $ selectionAttrs <+> selectAttrs
......
...@@ -29,6 +29,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -29,6 +29,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'SelectMultiple' represents a SelectMultiple widget from IPython.html.widgets. -- | A 'SelectMultiple' represents a SelectMultiple widget from IPython.html.widgets.
type SelectMultiple = IPythonWidget 'SelectMultipleType type SelectMultiple = IPythonWidget 'SelectMultipleType
...@@ -39,8 +40,9 @@ mkSelectMultiple = do ...@@ -39,8 +40,9 @@ mkSelectMultiple = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let multipleSelectionAttrs = defaultMultipleSelectionWidget "SelectMultipleView" "SelectMultipleModel" layout let multipleSelectionAttrs = defaultMultipleSelectionWidget "SelectMultipleView" "SelectMultipleModel" layout dstyle
selectMultipleAttrs = (Rows =:: Just 5) selectMultipleAttrs = (Rows =:: Just 5)
:& RNil :& RNil
widgetState = WidgetState $ multipleSelectionAttrs <+> selectMultipleAttrs widgetState = WidgetState $ multipleSelectionAttrs <+> selectMultipleAttrs
......
...@@ -29,6 +29,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -29,6 +29,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'SelectionRangeSlider' represents a SelectionSlider widget from IPyhon.widgets -- | A 'SelectionRangeSlider' represents a SelectionSlider widget from IPyhon.widgets
type SelectionRangeSlider = IPythonWidget 'SelectionRangeSliderType type SelectionRangeSlider = IPythonWidget 'SelectionRangeSliderType
...@@ -38,8 +39,9 @@ mkSelectionRangeSlider :: IO SelectionRangeSlider ...@@ -38,8 +39,9 @@ mkSelectionRangeSlider :: IO SelectionRangeSlider
mkSelectionRangeSlider = do mkSelectionRangeSlider = do
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultMultipleSelectionWidget "SelectionRangeSliderView" "SelectionRangeSliderModel" layout let selectionAttrs = defaultMultipleSelectionWidget "SelectionRangeSliderView" "SelectionRangeSliderModel" layout dstyle
selectionRangeSliderAttrs = (Orientation =:: HorizontalOrientation) selectionRangeSliderAttrs = (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True) :& (ReadOut =:: True)
:& (ContinuousUpdate =:: True) :& (ContinuousUpdate =:: True)
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'SelectionSlider' represents a SelectionSlider widget from IPyhon.widgets -- | A 'SelectionSlider' represents a SelectionSlider widget from IPyhon.widgets
type SelectionSlider = IPythonWidget 'SelectionSliderType type SelectionSlider = IPythonWidget 'SelectionSliderType
...@@ -37,8 +38,9 @@ mkSelectionSlider :: IO SelectionSlider ...@@ -37,8 +38,9 @@ mkSelectionSlider :: IO SelectionSlider
mkSelectionSlider = do mkSelectionSlider = do
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultSelectionNonemptyWidget "SelectionSliderView" "SelectionSliderModel" layout let selectionAttrs = defaultSelectionNonemptyWidget "SelectionSliderView" "SelectionSliderModel" layout dstyle
selectionSliderAttrs = (Orientation =:: HorizontalOrientation) selectionSliderAttrs = (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True) :& (ReadOut =:: True)
:& (ContinuousUpdate =:: True) :& (ContinuousUpdate =:: True)
......
...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -28,6 +28,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'ToggleButtons' represents a ToggleButtons widget from IPython.html.widgets. -- | A 'ToggleButtons' represents a ToggleButtons widget from IPython.html.widgets.
type ToggleButtons = IPythonWidget 'ToggleButtonsType type ToggleButtons = IPythonWidget 'ToggleButtonsType
...@@ -38,8 +39,9 @@ mkToggleButtons = do ...@@ -38,8 +39,9 @@ mkToggleButtons = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultSelectionWidget "ToggleButtonsView" "ToggleButtonsModel" layout let selectionAttrs = defaultSelectionWidget "ToggleButtonsView" "ToggleButtonsModel" layout dstyle
toggleButtonsAttrs = (Tooltips =:: []) toggleButtonsAttrs = (Tooltips =:: [])
:& (Icons =:: []) :& (Icons =:: [])
:& (ButtonStyle =:: DefaultButton) :& (ButtonStyle =:: DefaultButton)
......
...@@ -118,6 +118,7 @@ singletons ...@@ -118,6 +118,7 @@ singletons
| Axes | Axes
| ButtonColor | ButtonColor
| FontWeight | FontWeight
| DescriptionWidth
-- Singletons for child style widgets -- Singletons for child style widgets
| StyleButton | StyleButton
| StyleDescription | StyleDescription
......
...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'ComboboxWidget' represents a Combobox widget from IPython.html.widgets. -- | A 'ComboboxWidget' represents a Combobox widget from IPython.html.widgets.
type ComboboxWidget = IPythonWidget 'ComboboxType type ComboboxWidget = IPythonWidget 'ComboboxType
...@@ -37,8 +38,9 @@ mkComboboxWidget = do ...@@ -37,8 +38,9 @@ mkComboboxWidget = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let txtWidget = defaultTextWidget "ComboboxView" "ComboboxModel" layout let txtWidget = defaultTextWidget "ComboboxView" "ComboboxModel" layout dstyle
boxWidget = (Options =:: []) boxWidget = (Options =:: [])
:& (EnsureOption =:: False) :& (EnsureOption =:: False)
:& RNil :& RNil
......
...@@ -24,6 +24,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -24,6 +24,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'HTMLWidget' represents a HTML widget from IPython.html.widgets. -- | A 'HTMLWidget' represents a HTML widget from IPython.html.widgets.
type HTMLWidget = IPythonWidget 'HTMLType type HTMLWidget = IPythonWidget 'HTMLType
...@@ -34,8 +35,9 @@ mkHTMLWidget = do ...@@ -34,8 +35,9 @@ mkHTMLWidget = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultStringWidget "HTMLView" "HTMLModel" layout let widgetState = WidgetState $ defaultStringWidget "HTMLView" "HTMLModel" layout dstyle
stateIO <- newIORef widgetState stateIO <- newIORef widgetState
......
...@@ -24,6 +24,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -24,6 +24,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'HTMLMathWidget' represents a HTML Math widget from IPython.html.widgets. -- | A 'HTMLMathWidget' represents a HTML Math widget from IPython.html.widgets.
type HTMLMathWidget = IPythonWidget 'HTMLMathType type HTMLMathWidget = IPythonWidget 'HTMLMathType
...@@ -34,8 +35,9 @@ mkHTMLMathWidget = do ...@@ -34,8 +35,9 @@ mkHTMLMathWidget = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultStringWidget "HTMLMathView" "HTMLMathModel" layout let widgetState = WidgetState $ defaultStringWidget "HTMLMathView" "HTMLMathModel" layout dstyle
stateIO <- newIORef widgetState stateIO <- newIORef widgetState
......
...@@ -24,6 +24,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -24,6 +24,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'LabelWidget' represents a Label widget from IPython.html.widgets. -- | A 'LabelWidget' represents a Label widget from IPython.html.widgets.
type LabelWidget = IPythonWidget 'LabelType type LabelWidget = IPythonWidget 'LabelType
...@@ -34,8 +35,9 @@ mkLabelWidget = do ...@@ -34,8 +35,9 @@ mkLabelWidget = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultStringWidget "LabelView" "LabelModel" layout let widgetState = WidgetState $ defaultStringWidget "LabelView" "LabelModel" layout dstyle
stateIO <- newIORef widgetState stateIO <- newIORef widgetState
......
...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'PasswordWidget' represents a Password widget from IPython.html.widgets. -- | A 'PasswordWidget' represents a Password widget from IPython.html.widgets.
type PasswordWidget = IPythonWidget 'PasswordType type PasswordWidget = IPythonWidget 'PasswordType
...@@ -37,8 +38,9 @@ mkPasswordWidget = do ...@@ -37,8 +38,9 @@ mkPasswordWidget = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultTextWidget "PasswordView" "PasswordModel" layout let widgetState = WidgetState $ defaultTextWidget "PasswordView" "PasswordModel" layout dstyle
stateIO <- newIORef widgetState stateIO <- newIORef widgetState
......
...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -27,6 +27,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'TextWidget' represents a Text widget from IPython.html.widgets. -- | A 'TextWidget' represents a Text widget from IPython.html.widgets.
type TextWidget = IPythonWidget 'TextType type TextWidget = IPythonWidget 'TextType
...@@ -37,8 +38,9 @@ mkTextWidget = do ...@@ -37,8 +38,9 @@ mkTextWidget = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultTextWidget "TextView" "TextModel" layout let widgetState = WidgetState $ defaultTextWidget "TextView" "TextModel" layout dstyle
stateIO <- newIORef widgetState stateIO <- newIORef widgetState
......
...@@ -26,6 +26,7 @@ import IHaskell.IPython.Message.UUID as U ...@@ -26,6 +26,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
-- | A 'TextArea' represents a Textarea widget from IPython.html.widgets. -- | A 'TextArea' represents a Textarea widget from IPython.html.widgets.
type TextArea = IPythonWidget 'TextAreaType type TextArea = IPythonWidget 'TextAreaType
...@@ -36,8 +37,9 @@ mkTextArea = do ...@@ -36,8 +37,9 @@ mkTextArea = do
-- Default properties, with a random uuid -- Default properties, with a random uuid
wid <- U.random wid <- U.random
layout <- mkLayout layout <- mkLayout
dstyle <- mkDescriptionStyle
let strAttrs = defaultStringWidget "TextareaView" "TextareaModel" layout let strAttrs = defaultStringWidget "TextareaView" "TextareaModel" layout dstyle
wgtAttrs = (Rows =:: Nothing) wgtAttrs = (Rows =:: Nothing)
:& (Disabled =:: False) :& (Disabled =:: False)
:& (ContinuousUpdate =:: True) :& (ContinuousUpdate =:: True)
......
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module IHaskell.Display.Widgets.Style.ButtonStyle
( -- * Button style
ButtonStyle
-- * Create a new button style
, mkButtonStyle
) where
-- To keep `cabal repl` happy when running from the ihaskell repo
import Prelude
import Data.Aeson
import Data.IORef (newIORef)
import Data.Vinyl (Rec(..), (<+>))
import IHaskell.Display
import IHaskell.Eval.Widgets
import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common
-- | A 'ButtonStyle' represents a Button Style from IPython.html.widgets.
type ButtonStyle = IPythonWidget 'ButtonStyleType
-- | Create a new button style
mkButtonStyle :: IO ButtonStyle
mkButtonStyle = do
wid <- U.random
let stl = defaultStyleWidget "ButtonStyleModel"
but = (ButtonColor =:: Nothing)
:& (FontWeight =:: DefaultWeight)
:& RNil
btnStlState = WidgetState (stl <+> but)
stateIO <- newIORef btnStlState
let style = IPythonWidget wid stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen style $ toJSON btnStlState
-- Return the style widget
return style
instance IHaskellWidget ButtonStyle where
getCommUUID = uuid
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module IHaskell.Display.Widgets.Style.DescriptionStyle
( -- * Description style
DescriptionStyle
-- * Create a new description style
, mkDescriptionStyle
) where
-- To keep `cabal repl` happy when running from the ihaskell repo
import Prelude
import Data.Aeson
import Data.IORef (newIORef)
import Data.Vinyl (Rec(..), (<+>))
import IHaskell.Display
import IHaskell.Eval.Widgets
import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common
-- | A 'DescriptionStyle' represents a Button Style from IPython.html.widgets.
type DescriptionStyle = IPythonWidget 'DescriptionStyleType
-- | Create a new button style
mkDescriptionStyle :: IO DescriptionStyle
mkDescriptionStyle = do
wid <- U.random
let stl = defaultStyleWidget "DescriptionStyleModel"
but = (DescriptionWidth =:: "")
:& RNil
btnStlState = WidgetState (stl <+> but)
stateIO <- newIORef btnStlState
let style = IPythonWidget wid stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen style $ toJSON btnStlState
-- Return the style widget
return style
instance IHaskellWidget DescriptionStyle where
getCommUUID = uuid
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment