mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-18 20:36:08 +00:00
Unified widget builders naming convention
This commit is contained in:
parent
e2e4862486
commit
3cca06044d
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.Bool.Valid
|
||||
( -- * The Valid Widget
|
||||
ValidWidget
|
||||
-- * Constructor
|
||||
, mkValidWidget
|
||||
, mkValid
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -32,8 +32,8 @@ import IHaskell.Display.Widgets.Style.DescriptionStyle
|
||||
type ValidWidget = IPythonWidget 'ValidType
|
||||
|
||||
-- | Create a new output widget
|
||||
mkValidWidget :: IO ValidWidget
|
||||
mkValidWidget = do
|
||||
mkValid :: IO ValidWidget
|
||||
mkValid = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.Box.SelectionContainer.Tab
|
||||
( -- * The Tab widget
|
||||
TabWidget
|
||||
-- * Constructor
|
||||
, mkTabWidget
|
||||
, mkTab
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -33,8 +33,8 @@ import IHaskell.Display.Widgets.Layout.LayoutWidget
|
||||
type TabWidget = IPythonWidget 'TabType
|
||||
|
||||
-- | Create a new box
|
||||
mkTabWidget :: IO TabWidget
|
||||
mkTabWidget = do
|
||||
mkTab :: IO TabWidget
|
||||
mkTab = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -148,7 +148,7 @@ liftToWidgets func rc initvals = do
|
||||
initializers = rmap extractInitializer rc
|
||||
|
||||
bx <- mkBox
|
||||
out <- mkOutputWidget
|
||||
out <- mkOutput
|
||||
|
||||
-- Create a list of widgets
|
||||
widgets <- rtraverse createWidget constructors
|
||||
@ -214,7 +214,7 @@ instance FromWidget Text where
|
||||
type SuitableField Text = 'S.StringValue
|
||||
data Argument Text = TextVal Text
|
||||
initializer w (TextVal txt) = setField w StringValue txt
|
||||
wrapped = WrappedWidget mkTextWidget SubmitHandler StringValue
|
||||
wrapped = WrappedWidget mkText SubmitHandler StringValue
|
||||
|
||||
instance FromWidget Integer where
|
||||
type SuitableWidget Integer = 'IntSliderType
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.Media.Audio
|
||||
( -- * The Audio Widget
|
||||
AudioWidget
|
||||
-- * Constructor
|
||||
, mkAudioWidget
|
||||
, mkAudio
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -31,8 +31,8 @@ import IHaskell.Display.Widgets.Layout.LayoutWidget
|
||||
type AudioWidget = IPythonWidget 'AudioType
|
||||
|
||||
-- | Create a new audio widget
|
||||
mkAudioWidget :: IO AudioWidget
|
||||
mkAudioWidget = do
|
||||
mkAudio :: IO AudioWidget
|
||||
mkAudio = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.Media.Image
|
||||
( -- * The Image Widget
|
||||
ImageWidget
|
||||
-- * Constructor
|
||||
, mkImageWidget
|
||||
, mkImage
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -31,8 +31,8 @@ import IHaskell.Display.Widgets.Layout.LayoutWidget
|
||||
type ImageWidget = IPythonWidget 'ImageType
|
||||
|
||||
-- | Create a new image widget
|
||||
mkImageWidget :: IO ImageWidget
|
||||
mkImageWidget = do
|
||||
mkImage :: IO ImageWidget
|
||||
mkImage = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.Media.Video
|
||||
( -- * The Video Widget
|
||||
VideoWidget
|
||||
-- * Constructor
|
||||
, mkVideoWidget
|
||||
, mkVideo
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -31,8 +31,8 @@ import IHaskell.Display.Widgets.Layout.LayoutWidget
|
||||
type VideoWidget = IPythonWidget 'VideoType
|
||||
|
||||
-- | Create a new video widget
|
||||
mkVideoWidget :: IO VideoWidget
|
||||
mkVideoWidget = do
|
||||
mkVideo :: IO VideoWidget
|
||||
mkVideo = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.Output
|
||||
( -- * The Output Widget
|
||||
OutputWidget
|
||||
-- * Constructor
|
||||
, mkOutputWidget
|
||||
, mkOutput
|
||||
-- * Using the output widget
|
||||
, appendStdout
|
||||
, appendStderr
|
||||
@ -40,8 +40,8 @@ import IHaskell.Display.Widgets.Layout.LayoutWidget
|
||||
type OutputWidget = IPythonWidget 'OutputType
|
||||
|
||||
-- | Create a new output widget
|
||||
mkOutputWidget :: IO OutputWidget
|
||||
mkOutputWidget = do
|
||||
mkOutput :: IO OutputWidget
|
||||
mkOutput = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.String.Combobox
|
||||
( -- * The Combobox Widget
|
||||
ComboboxWidget
|
||||
-- * Constructor
|
||||
, mkComboboxWidget
|
||||
, mkCombobox
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -33,8 +33,8 @@ import IHaskell.Display.Widgets.Style.DescriptionStyle
|
||||
type ComboboxWidget = IPythonWidget 'ComboboxType
|
||||
|
||||
-- | Create a new Combobox widget
|
||||
mkComboboxWidget :: IO ComboboxWidget
|
||||
mkComboboxWidget = do
|
||||
mkCombobox :: IO ComboboxWidget
|
||||
mkCombobox = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.String.HTML
|
||||
( -- * The HTML Widget
|
||||
HTMLWidget
|
||||
-- * Constructor
|
||||
, mkHTMLWidget
|
||||
, mkHTML
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -30,8 +30,8 @@ import IHaskell.Display.Widgets.Style.DescriptionStyle
|
||||
type HTMLWidget = IPythonWidget 'HTMLType
|
||||
|
||||
-- | Create a new HTML widget
|
||||
mkHTMLWidget :: IO HTMLWidget
|
||||
mkHTMLWidget = do
|
||||
mkHTML :: IO HTMLWidget
|
||||
mkHTML = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.String.HTMLMath
|
||||
( -- * The HTMLMath Widget
|
||||
HTMLMathWidget
|
||||
-- * Constructor
|
||||
, mkHTMLMathWidget
|
||||
, mkHTMLMath
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -30,8 +30,8 @@ import IHaskell.Display.Widgets.Style.DescriptionStyle
|
||||
type HTMLMathWidget = IPythonWidget 'HTMLMathType
|
||||
|
||||
-- | Create a new HTML widget
|
||||
mkHTMLMathWidget :: IO HTMLMathWidget
|
||||
mkHTMLMathWidget = do
|
||||
mkHTMLMath :: IO HTMLMathWidget
|
||||
mkHTMLMath = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.String.Label
|
||||
( -- * The Label Widget
|
||||
LabelWidget
|
||||
-- * Constructor
|
||||
, mkLabelWidget
|
||||
, mkLabel
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -30,8 +30,8 @@ import IHaskell.Display.Widgets.Style.DescriptionStyle
|
||||
type LabelWidget = IPythonWidget 'LabelType
|
||||
|
||||
-- | Create a new Label widget
|
||||
mkLabelWidget :: IO LabelWidget
|
||||
mkLabelWidget = do
|
||||
mkLabel :: IO LabelWidget
|
||||
mkLabel = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.String.Password
|
||||
( -- * The Password Widget
|
||||
PasswordWidget
|
||||
-- * Constructor
|
||||
, mkPasswordWidget
|
||||
, mkPassword
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -32,8 +32,8 @@ import IHaskell.Display.Widgets.Style.DescriptionStyle
|
||||
type PasswordWidget = IPythonWidget 'PasswordType
|
||||
|
||||
-- | Create a new Password widget
|
||||
mkPasswordWidget :: IO PasswordWidget
|
||||
mkPasswordWidget = do
|
||||
mkPassword :: IO PasswordWidget
|
||||
mkPassword = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
@ -9,7 +9,7 @@ module IHaskell.Display.Widgets.String.Text
|
||||
( -- * The Text Widget
|
||||
TextWidget
|
||||
-- * Constructor
|
||||
, mkTextWidget
|
||||
, mkText
|
||||
) where
|
||||
|
||||
-- To keep `cabal repl` happy when running from the ihaskell repo
|
||||
@ -32,8 +32,8 @@ import IHaskell.Display.Widgets.Style.DescriptionStyle
|
||||
type TextWidget = IPythonWidget 'TextType
|
||||
|
||||
-- | Create a new Text widget
|
||||
mkTextWidget :: IO TextWidget
|
||||
mkTextWidget = do
|
||||
mkText :: IO TextWidget
|
||||
mkText = do
|
||||
-- Default properties, with a random uuid
|
||||
wid <- U.random
|
||||
layout <- mkLayout
|
||||
|
Loading…
x
Reference in New Issue
Block a user