mirror of
https://github.com/fjvallarino/monomer.git
synced 2024-09-20 16:27:49 +03:00
Add Cmb prefix to combinator typeclasses. Remove trailing _ from the name of those where it was being used
This commit is contained in:
parent
193a1c08d0
commit
8546126244
@ -11,164 +11,164 @@ import Monomer.Core.WidgetTypes
|
||||
import Monomer.Graphics.Types
|
||||
|
||||
-- Input
|
||||
class ValidInput t s | t -> s where
|
||||
class CmbValidInput t s | t -> s where
|
||||
validInput :: ALens' s Bool -> t
|
||||
|
||||
class SelectOnFocus t where
|
||||
class CmbSelectOnFocus t where
|
||||
selectOnFocus :: Bool -> t
|
||||
|
||||
-- Caption
|
||||
class AcceptCaption t where
|
||||
class CmbAcceptCaption t where
|
||||
acceptCaption :: Text -> t
|
||||
|
||||
class CancelCaption t where
|
||||
class CmbCancelCaption t where
|
||||
cancelCaption :: Text -> t
|
||||
|
||||
class CloseCaption t where
|
||||
class CmbCloseCaption t where
|
||||
closeCaption :: Text -> t
|
||||
|
||||
-- Numeric
|
||||
class Num a => MinValue t a | t -> a where
|
||||
class Num a => CmbMinValue t a | t -> a where
|
||||
minValue :: a -> t
|
||||
|
||||
class Num a => MaxValue t a | t -> a where
|
||||
class Num a => CmbMaxValue t a | t -> a where
|
||||
maxValue :: a -> t
|
||||
|
||||
-- Container
|
||||
class IgnoreEmptyClick t where
|
||||
class CmbIgnoreEmptyClick t where
|
||||
ignoreEmptyClick :: Bool -> t
|
||||
|
||||
-- Text
|
||||
class Decimals t where
|
||||
class CmbDecimals t where
|
||||
decimals :: Int -> t
|
||||
|
||||
class MaxLength t where
|
||||
class CmbMaxLength t where
|
||||
maxLength :: Int -> t
|
||||
|
||||
class TextMode_ t where
|
||||
class CmbTextMode t where
|
||||
textSingleLine :: t
|
||||
textMultiLine :: t
|
||||
|
||||
class TextOverflow_ t where
|
||||
class CmbTextOverflow t where
|
||||
textEllipsis :: t
|
||||
textClip :: t
|
||||
|
||||
class TextTrim_ t where
|
||||
class CmbTextTrim t where
|
||||
textTrim :: t
|
||||
textKeepSpaces :: t
|
||||
|
||||
class SelectOnBlur t where
|
||||
class CmbSelectOnBlur t where
|
||||
selectOnBlur :: Bool -> t
|
||||
|
||||
-- Text style
|
||||
class TextFont t where
|
||||
class CmbTextFont t where
|
||||
textFont :: Font -> t
|
||||
|
||||
class TextSize t where
|
||||
class CmbTextSize t where
|
||||
textSize :: Double -> t
|
||||
|
||||
class TextColor t where
|
||||
class CmbTextColor t where
|
||||
textColor :: Color -> t
|
||||
|
||||
class TextLeft t where
|
||||
class CmbTextLeft t where
|
||||
textLeft :: t
|
||||
|
||||
class TextCenter t where
|
||||
class CmbTextCenter t where
|
||||
textCenter :: t
|
||||
|
||||
class TextRight t where
|
||||
class CmbTextRight t where
|
||||
textRight :: t
|
||||
|
||||
class TextTop t where
|
||||
class CmbTextTop t where
|
||||
textTop :: t
|
||||
|
||||
class TextMiddle t where
|
||||
class CmbTextMiddle t where
|
||||
textMiddle :: t
|
||||
|
||||
class TextBottom t where
|
||||
class CmbTextBottom t where
|
||||
textBottom :: t
|
||||
|
||||
-- Events
|
||||
class OnFocus t e | t -> e where
|
||||
class CmbOnFocus t e | t -> e where
|
||||
onFocus :: e -> t
|
||||
|
||||
class OnFocusReq t s | t -> s where
|
||||
class CmbOnFocusReq t s | t -> s where
|
||||
onFocusReq :: WidgetRequest s -> t
|
||||
|
||||
class OnBlur t e | t -> e where
|
||||
class CmbOnBlur t e | t -> e where
|
||||
onBlur :: e -> t
|
||||
|
||||
class OnBlurReq t s | t -> s where
|
||||
class CmbOnBlurReq t s | t -> s where
|
||||
onBlurReq :: WidgetRequest s -> t
|
||||
|
||||
class OnClick t e | t -> e where
|
||||
class CmbOnClick t e | t -> e where
|
||||
onClick :: e -> t
|
||||
|
||||
class OnClickReq t s | t -> s where
|
||||
class CmbOnClickReq t s | t -> s where
|
||||
onClickReq :: WidgetRequest s -> t
|
||||
|
||||
class OnClickEmpty t e | t -> e where
|
||||
class CmbOnClickEmpty t e | t -> e where
|
||||
onClickEmpty :: e -> t
|
||||
|
||||
class OnClickEmptyReq t s | t -> s where
|
||||
class CmbOnClickEmptyReq t s | t -> s where
|
||||
onClickEmptyReq :: WidgetRequest s -> t
|
||||
|
||||
class OnChange t a e | t -> e where
|
||||
class CmbOnChange t a e | t -> e where
|
||||
onChange :: (a -> e) -> t
|
||||
|
||||
class OnChangeIdx t a e | t -> e where
|
||||
class CmbOnChangeIdx t a e | t -> e where
|
||||
onChangeIdx :: (Int -> a -> e) -> t
|
||||
|
||||
class OnChangeReq t s | t -> s where
|
||||
class CmbOnChangeReq t s | t -> s where
|
||||
onChangeReq :: WidgetRequest s -> t
|
||||
|
||||
class OnChangeIdxReq t s | t -> s where
|
||||
class CmbOnChangeIdxReq t s | t -> s where
|
||||
onChangeIdxReq :: (Int -> WidgetRequest s) -> t
|
||||
|
||||
class OnLoadError t a e | t -> e where
|
||||
class CmbOnLoadError t a e | t -> e where
|
||||
onLoadError :: (a -> e) -> t
|
||||
|
||||
-- Size
|
||||
class RangeWidth t where
|
||||
class CmbRangeWidth t where
|
||||
rangeWidth :: Double -> Double -> t
|
||||
|
||||
class RangeHeight t where
|
||||
class CmbRangeHeight t where
|
||||
rangeHeight :: Double -> Double -> t
|
||||
|
||||
class FlexWidth t where
|
||||
class CmbFlexWidth t where
|
||||
flexWidth :: Double -> t
|
||||
|
||||
class FlexHeight t where
|
||||
class CmbFlexHeight t where
|
||||
flexHeight :: Double -> t
|
||||
|
||||
class Width t where
|
||||
class CmbWidth t where
|
||||
width :: Double -> t
|
||||
|
||||
class Height t where
|
||||
class CmbHeight t where
|
||||
height :: Double -> t
|
||||
|
||||
class MinWidth t where
|
||||
class CmbMinWidth t where
|
||||
minWidth :: Double -> t
|
||||
|
||||
class MinHeight t where
|
||||
class CmbMinHeight t where
|
||||
minHeight :: Double -> t
|
||||
|
||||
class MaxWidth t where
|
||||
class CmbMaxWidth t where
|
||||
maxWidth :: Double -> t
|
||||
|
||||
class MaxHeight t where
|
||||
class CmbMaxHeight t where
|
||||
maxHeight :: Double -> t
|
||||
|
||||
class SizeReqW t where
|
||||
class CmbSizeReqW t where
|
||||
sizeReqW :: SizeReq -> t
|
||||
|
||||
class SizeReqH t where
|
||||
class CmbSizeReqH t where
|
||||
sizeReqH :: SizeReq -> t
|
||||
|
||||
class ResizeFactor t where
|
||||
class CmbResizeFactor t where
|
||||
resizeFactor :: Double -> t
|
||||
|
||||
class ResizeFactorDim t where
|
||||
class CmbResizeFactorDim t where
|
||||
resizeFactorW :: Double -> t
|
||||
resizeFactorH :: Double -> t
|
||||
|
||||
@ -178,138 +178,138 @@ infixl 5 `hover`
|
||||
infixl 5 `focus`
|
||||
infixl 5 `disabled`
|
||||
|
||||
class Style_ t where
|
||||
class CmbStyle t where
|
||||
style :: t -> [StyleState] -> t
|
||||
|
||||
class Hover_ t where
|
||||
class CmbHover t where
|
||||
hover :: t -> [StyleState] -> t
|
||||
|
||||
class Focus_ t where
|
||||
class CmbFocus t where
|
||||
focus :: t -> [StyleState] -> t
|
||||
|
||||
class Disabled_ t where
|
||||
class CmbDisabled t where
|
||||
disabled :: t -> [StyleState] -> t
|
||||
|
||||
class BgColor t where
|
||||
class CmbBgColor t where
|
||||
bgColor :: Color -> t
|
||||
|
||||
class FgColor t where
|
||||
class CmbFgColor t where
|
||||
fgColor :: Color -> t
|
||||
|
||||
class HlColor t where
|
||||
class CmbHlColor t where
|
||||
hlColor :: Color -> t
|
||||
|
||||
class Transparency t where
|
||||
class CmbTransparency t where
|
||||
transparency :: Double -> t
|
||||
|
||||
-- Item List
|
||||
class ItemListStyle t s | t -> s where
|
||||
class CmbItemListStyle t s | t -> s where
|
||||
itemListStyle :: s -> t
|
||||
|
||||
class ItemNormalStyle t s | t -> s where
|
||||
class CmbItemNormalStyle t s | t -> s where
|
||||
itemNormalStyle :: s -> t
|
||||
|
||||
class ItemHoverStyle t s | t -> s where
|
||||
class CmbItemHoverStyle t s | t -> s where
|
||||
itemHoverStyle :: s -> t
|
||||
|
||||
class ItemSelectedStyle t s | t -> s where
|
||||
class CmbItemSelectedStyle t s | t -> s where
|
||||
itemSelectedStyle :: s -> t
|
||||
|
||||
-- Align
|
||||
class AlignLeft t where
|
||||
class CmbAlignLeft t where
|
||||
alignLeft :: t
|
||||
|
||||
class AlignCenter t where
|
||||
class CmbAlignCenter t where
|
||||
alignCenter :: t
|
||||
|
||||
class AlignRight t where
|
||||
class CmbAlignRight t where
|
||||
alignRight :: t
|
||||
|
||||
class AlignTop t where
|
||||
class CmbAlignTop t where
|
||||
alignTop :: t
|
||||
|
||||
class AlignMiddle t where
|
||||
class CmbAlignMiddle t where
|
||||
alignMiddle :: t
|
||||
|
||||
class AlignBottom t where
|
||||
class CmbAlignBottom t where
|
||||
alignBottom :: t
|
||||
|
||||
-- Margin
|
||||
class Margin_ t where
|
||||
class CmbMargin t where
|
||||
margin :: Double -> t
|
||||
|
||||
class MarginL t where
|
||||
class CmbMarginL t where
|
||||
marginL :: Double -> t
|
||||
|
||||
class MarginR t where
|
||||
class CmbMarginR t where
|
||||
marginR :: Double -> t
|
||||
|
||||
class MarginT t where
|
||||
class CmbMarginT t where
|
||||
marginT :: Double -> t
|
||||
|
||||
class MarginB t where
|
||||
class CmbMarginB t where
|
||||
marginB :: Double -> t
|
||||
|
||||
-- Padding
|
||||
class Padding_ t where
|
||||
class CmbPadding t where
|
||||
padding :: Double -> t
|
||||
|
||||
class PaddingL t where
|
||||
class CmbPaddingL t where
|
||||
paddingL :: Double -> t
|
||||
|
||||
class PaddingR t where
|
||||
class CmbPaddingR t where
|
||||
paddingR :: Double -> t
|
||||
|
||||
class PaddingT t where
|
||||
class CmbPaddingT t where
|
||||
paddingT :: Double -> t
|
||||
|
||||
class PaddingB t where
|
||||
class CmbPaddingB t where
|
||||
paddingB :: Double -> t
|
||||
|
||||
-- Border
|
||||
class Border_ t where
|
||||
class CmbBorder t where
|
||||
border :: Double -> Color -> t
|
||||
|
||||
class BorderL t where
|
||||
class CmbBorderL t where
|
||||
borderL :: Double -> Color -> t
|
||||
|
||||
class BorderR t where
|
||||
class CmbBorderR t where
|
||||
borderR :: Double -> Color -> t
|
||||
|
||||
class BorderT t where
|
||||
class CmbBorderT t where
|
||||
borderT :: Double -> Color -> t
|
||||
|
||||
class BorderB t where
|
||||
class CmbBorderB t where
|
||||
borderB :: Double -> Color -> t
|
||||
|
||||
-- Radius
|
||||
class Radius_ t where
|
||||
class CmbRadius t where
|
||||
radius :: Double -> t
|
||||
|
||||
class RadiusTL t where
|
||||
class CmbRadiusTL t where
|
||||
radiusTL :: Double -> t
|
||||
|
||||
class RadiusTR t where
|
||||
class CmbRadiusTR t where
|
||||
radiusTR :: Double -> t
|
||||
|
||||
class RadiusBL t where
|
||||
class CmbRadiusBL t where
|
||||
radiusBL :: Double -> t
|
||||
|
||||
class RadiusBR t where
|
||||
class CmbRadiusBR t where
|
||||
radiusBR :: Double -> t
|
||||
|
||||
-- Inner Radius
|
||||
class InnerRadius_ t where
|
||||
class CmbInnerRadius t where
|
||||
iradius :: Double -> t
|
||||
|
||||
class InnerRadiusTL t where
|
||||
class CmbInnerRadiusTL t where
|
||||
iradiusTL :: Double -> t
|
||||
|
||||
class InnerRadiusTR t where
|
||||
class CmbInnerRadiusTR t where
|
||||
iradiusTR :: Double -> t
|
||||
|
||||
class InnerRadiusBL t where
|
||||
class CmbInnerRadiusBL t where
|
||||
iradiusBL :: Double -> t
|
||||
|
||||
class InnerRadiusBR t where
|
||||
class CmbInnerRadiusBR t where
|
||||
iradiusBR :: Double -> t
|
||||
|
@ -15,141 +15,141 @@ import Monomer.Graphics.Types
|
||||
|
||||
import qualified Monomer.Core.Lens as L
|
||||
|
||||
paddingH :: (Semigroup a, PaddingL a, PaddingR a) => Double -> a
|
||||
paddingH :: (Semigroup a, CmbPaddingL a, CmbPaddingR a) => Double -> a
|
||||
paddingH p = paddingL p <> paddingR p
|
||||
|
||||
paddingV :: (Semigroup a, PaddingT a, PaddingB a) => Double -> a
|
||||
paddingV :: (Semigroup a, CmbPaddingT a, CmbPaddingB a) => Double -> a
|
||||
paddingV p = paddingT p <> paddingB p
|
||||
|
||||
-- Size
|
||||
instance Width SizeReq where
|
||||
instance CmbWidth SizeReq where
|
||||
width w = FixedSize w
|
||||
|
||||
instance Height SizeReq where
|
||||
instance CmbHeight SizeReq where
|
||||
height h = FixedSize h
|
||||
|
||||
instance FlexWidth SizeReq where
|
||||
instance CmbFlexWidth SizeReq where
|
||||
flexWidth w = FlexSize w 1
|
||||
|
||||
instance FlexHeight SizeReq where
|
||||
instance CmbFlexHeight SizeReq where
|
||||
flexHeight h = FlexSize h 1
|
||||
|
||||
instance RangeWidth SizeReq where
|
||||
instance CmbRangeWidth SizeReq where
|
||||
rangeWidth w1 w2 = RangeSize w1 w2 1
|
||||
|
||||
instance RangeHeight SizeReq where
|
||||
instance CmbRangeHeight SizeReq where
|
||||
rangeHeight h1 h2 = RangeSize h1 h2 1
|
||||
|
||||
instance MinWidth SizeReq where
|
||||
instance CmbMinWidth SizeReq where
|
||||
minWidth w = MinSize w 1
|
||||
|
||||
instance MinHeight SizeReq where
|
||||
instance CmbMinHeight SizeReq where
|
||||
minHeight h = MinSize h 1
|
||||
|
||||
instance MaxWidth SizeReq where
|
||||
instance CmbMaxWidth SizeReq where
|
||||
maxWidth w = MaxSize w 1
|
||||
|
||||
instance MaxHeight SizeReq where
|
||||
instance CmbMaxHeight SizeReq where
|
||||
maxHeight h = MaxSize h 1
|
||||
|
||||
-- Text
|
||||
instance TextFont TextStyle where
|
||||
instance CmbTextFont TextStyle where
|
||||
textFont font = def & L.font ?~ font
|
||||
|
||||
instance TextSize TextStyle where
|
||||
instance CmbTextSize TextStyle where
|
||||
textSize size = def & L.fontSize ?~ FontSize size
|
||||
|
||||
instance TextColor TextStyle where
|
||||
instance CmbTextColor TextStyle where
|
||||
textColor col = def & L.fontColor ?~ col
|
||||
|
||||
instance TextLeft TextStyle where
|
||||
instance CmbTextLeft TextStyle where
|
||||
textLeft = textAlignH ALeft
|
||||
|
||||
instance TextCenter TextStyle where
|
||||
instance CmbTextCenter TextStyle where
|
||||
textCenter = textAlignH ACenter
|
||||
|
||||
instance TextRight TextStyle where
|
||||
instance CmbTextRight TextStyle where
|
||||
textRight = textAlignH ARight
|
||||
|
||||
instance TextTop TextStyle where
|
||||
instance CmbTextTop TextStyle where
|
||||
textTop = textAlignV ATop
|
||||
|
||||
instance TextMiddle TextStyle where
|
||||
instance CmbTextMiddle TextStyle where
|
||||
textMiddle = textAlignV AMiddle
|
||||
|
||||
instance TextBottom TextStyle where
|
||||
instance CmbTextBottom TextStyle where
|
||||
textBottom = textAlignV ABottom
|
||||
|
||||
-- Padding
|
||||
|
||||
instance Padding_ Padding where
|
||||
instance CmbPadding Padding where
|
||||
padding padd = Padding jp jp jp jp where
|
||||
jp = Just padd
|
||||
|
||||
instance PaddingL Padding where
|
||||
instance CmbPaddingL Padding where
|
||||
paddingL padd = def & L.left ?~ padd
|
||||
|
||||
instance PaddingR Padding where
|
||||
instance CmbPaddingR Padding where
|
||||
paddingR padd = def & L.right ?~ padd
|
||||
|
||||
instance PaddingT Padding where
|
||||
instance CmbPaddingT Padding where
|
||||
paddingT padd = def & L.top ?~ padd
|
||||
|
||||
instance PaddingB Padding where
|
||||
instance CmbPaddingB Padding where
|
||||
paddingB padd = def & L.bottom ?~ padd
|
||||
|
||||
-- Border
|
||||
|
||||
instance Border_ Border where
|
||||
instance CmbBorder Border where
|
||||
border w col = Border bs bs bs bs where
|
||||
bs = Just (BorderSide w col)
|
||||
|
||||
instance BorderL Border where
|
||||
instance CmbBorderL Border where
|
||||
borderL w col = def & L.left ?~ BorderSide w col
|
||||
|
||||
instance BorderR Border where
|
||||
instance CmbBorderR Border where
|
||||
borderR w col = def & L.right ?~ BorderSide w col
|
||||
|
||||
instance BorderT Border where
|
||||
instance CmbBorderT Border where
|
||||
borderT w col = def & L.top ?~ BorderSide w col
|
||||
|
||||
instance BorderB Border where
|
||||
instance CmbBorderB Border where
|
||||
borderB w col = def & L.bottom ?~ BorderSide w col
|
||||
|
||||
-- Radius
|
||||
|
||||
instance Radius_ Radius where
|
||||
instance CmbRadius Radius where
|
||||
radius rad = Radius jrad jrad jrad jrad where
|
||||
jrad = Just $ radiusCorner rad
|
||||
|
||||
instance RadiusTL Radius where
|
||||
instance CmbRadiusTL Radius where
|
||||
radiusTL rad = def & L.topLeft ?~ radiusCorner rad
|
||||
|
||||
instance RadiusTR Radius where
|
||||
instance CmbRadiusTR Radius where
|
||||
radiusTR rad = def & L.topRight ?~ radiusCorner rad
|
||||
|
||||
instance RadiusBL Radius where
|
||||
instance CmbRadiusBL Radius where
|
||||
radiusBL rad = def & L.bottomLeft ?~ radiusCorner rad
|
||||
|
||||
instance RadiusBR Radius where
|
||||
instance CmbRadiusBR Radius where
|
||||
radiusBR rad = def & L.bottomRight ?~ radiusCorner rad
|
||||
|
||||
-- Inner radius
|
||||
|
||||
instance InnerRadius_ Radius where
|
||||
instance CmbInnerRadius Radius where
|
||||
iradius rad = Radius jrad jrad jrad jrad where
|
||||
jrad = Just $ iradiusCorner rad
|
||||
|
||||
instance InnerRadiusTL Radius where
|
||||
instance CmbInnerRadiusTL Radius where
|
||||
iradiusTL rad = def & L.topLeft ?~ iradiusCorner rad
|
||||
|
||||
instance InnerRadiusTR Radius where
|
||||
instance CmbInnerRadiusTR Radius where
|
||||
iradiusTR rad = def & L.topRight ?~ iradiusCorner rad
|
||||
|
||||
instance InnerRadiusBL Radius where
|
||||
instance CmbInnerRadiusBL Radius where
|
||||
iradiusBL rad = def & L.bottomLeft ?~ iradiusCorner rad
|
||||
|
||||
instance InnerRadiusBR Radius where
|
||||
instance CmbInnerRadiusBR Radius where
|
||||
iradiusBR rad = def & L.bottomRight ?~ iradiusCorner rad
|
||||
|
||||
--
|
||||
@ -157,143 +157,143 @@ instance InnerRadiusBR Radius where
|
||||
--
|
||||
|
||||
-- Size
|
||||
instance Width StyleState where
|
||||
instance CmbWidth StyleState where
|
||||
width w = def & L.sizeReqW ?~ FixedSize w
|
||||
|
||||
instance Height StyleState where
|
||||
instance CmbHeight StyleState where
|
||||
height h = def & L.sizeReqH ?~ FixedSize h
|
||||
|
||||
instance FlexWidth StyleState where
|
||||
instance CmbFlexWidth StyleState where
|
||||
flexWidth w = def & L.sizeReqW ?~ FlexSize w 1
|
||||
|
||||
instance FlexHeight StyleState where
|
||||
instance CmbFlexHeight StyleState where
|
||||
flexHeight h = def & L.sizeReqH ?~ FlexSize h 1
|
||||
|
||||
instance RangeWidth StyleState where
|
||||
instance CmbRangeWidth StyleState where
|
||||
rangeWidth w1 w2 = def & L.sizeReqW ?~ RangeSize w1 w2 1
|
||||
|
||||
instance RangeHeight StyleState where
|
||||
instance CmbRangeHeight StyleState where
|
||||
rangeHeight h1 h2 = def & L.sizeReqH ?~ RangeSize h1 h2 1
|
||||
|
||||
instance MinWidth StyleState where
|
||||
instance CmbMinWidth StyleState where
|
||||
minWidth w = def & L.sizeReqW ?~ MinSize w 1
|
||||
|
||||
instance MinHeight StyleState where
|
||||
instance CmbMinHeight StyleState where
|
||||
minHeight h = def & L.sizeReqH ?~ MinSize h 1
|
||||
|
||||
instance MaxWidth StyleState where
|
||||
instance CmbMaxWidth StyleState where
|
||||
maxWidth w = def & L.sizeReqW ?~ MaxSize w 1
|
||||
|
||||
instance MaxHeight StyleState where
|
||||
instance CmbMaxHeight StyleState where
|
||||
maxHeight h = def & L.sizeReqH ?~ MaxSize h 1
|
||||
|
||||
instance SizeReqW StyleState where
|
||||
instance CmbSizeReqW StyleState where
|
||||
sizeReqW srW = def & L.sizeReqW ?~ srW
|
||||
|
||||
instance SizeReqH StyleState where
|
||||
instance CmbSizeReqH StyleState where
|
||||
sizeReqH srH = def & L.sizeReqH ?~ srH
|
||||
|
||||
-- Color
|
||||
|
||||
instance BgColor StyleState where
|
||||
instance CmbBgColor StyleState where
|
||||
bgColor col = def & L.bgColor ?~ col
|
||||
|
||||
instance FgColor StyleState where
|
||||
instance CmbFgColor StyleState where
|
||||
fgColor col = def & L.fgColor ?~ col
|
||||
|
||||
instance HlColor StyleState where
|
||||
instance CmbHlColor StyleState where
|
||||
hlColor col = def & L.hlColor ?~ col
|
||||
|
||||
-- Text
|
||||
instance TextFont StyleState where
|
||||
instance CmbTextFont StyleState where
|
||||
textFont font = def & L.text ?~ textFont font
|
||||
|
||||
instance TextSize StyleState where
|
||||
instance CmbTextSize StyleState where
|
||||
textSize size = def & L.text ?~ textSize size
|
||||
|
||||
instance TextColor StyleState where
|
||||
instance CmbTextColor StyleState where
|
||||
textColor col = def & L.text ?~ textColor col
|
||||
|
||||
instance TextLeft StyleState where
|
||||
instance CmbTextLeft StyleState where
|
||||
textLeft = styleTextAlignH ALeft
|
||||
|
||||
instance TextCenter StyleState where
|
||||
instance CmbTextCenter StyleState where
|
||||
textCenter = styleTextAlignH ACenter
|
||||
|
||||
instance TextRight StyleState where
|
||||
instance CmbTextRight StyleState where
|
||||
textRight = styleTextAlignH ARight
|
||||
|
||||
instance TextTop StyleState where
|
||||
instance CmbTextTop StyleState where
|
||||
textTop = styleTextAlignV ATop
|
||||
|
||||
instance TextMiddle StyleState where
|
||||
instance CmbTextMiddle StyleState where
|
||||
textMiddle = styleTextAlignV AMiddle
|
||||
|
||||
instance TextBottom StyleState where
|
||||
instance CmbTextBottom StyleState where
|
||||
textBottom = styleTextAlignV ABottom
|
||||
|
||||
-- Padding
|
||||
instance Padding_ StyleState where
|
||||
instance CmbPadding StyleState where
|
||||
padding padd = def & L.padding ?~ padding padd
|
||||
|
||||
instance PaddingL StyleState where
|
||||
instance CmbPaddingL StyleState where
|
||||
paddingL padd = def & L.padding . non def . L.left ?~ padd
|
||||
|
||||
instance PaddingR StyleState where
|
||||
instance CmbPaddingR StyleState where
|
||||
paddingR padd = def & L.padding . non def . L.right ?~ padd
|
||||
|
||||
instance PaddingT StyleState where
|
||||
instance CmbPaddingT StyleState where
|
||||
paddingT padd = def & L.padding . non def . L.top ?~ padd
|
||||
|
||||
instance PaddingB StyleState where
|
||||
instance CmbPaddingB StyleState where
|
||||
paddingB padd = def & L.padding . non def . L.bottom ?~ padd
|
||||
|
||||
-- Border
|
||||
instance Border_ StyleState where
|
||||
instance CmbBorder StyleState where
|
||||
border w col = def & L.border ?~ border w col
|
||||
|
||||
instance BorderL StyleState where
|
||||
instance CmbBorderL StyleState where
|
||||
borderL w col = def & L.border . non def . L.left ?~ BorderSide w col
|
||||
|
||||
instance BorderR StyleState where
|
||||
instance CmbBorderR StyleState where
|
||||
borderR w col = def & L.border . non def . L.right ?~ BorderSide w col
|
||||
|
||||
instance BorderT StyleState where
|
||||
instance CmbBorderT StyleState where
|
||||
borderT w col = def & L.border . non def . L.top ?~ BorderSide w col
|
||||
|
||||
instance BorderB StyleState where
|
||||
instance CmbBorderB StyleState where
|
||||
borderB w col = def & L.border . non def . L.bottom ?~ BorderSide w col
|
||||
|
||||
-- Radius
|
||||
instance Radius_ StyleState where
|
||||
instance CmbRadius StyleState where
|
||||
radius rad = def & L.radius ?~ radius rad
|
||||
|
||||
instance RadiusTL StyleState where
|
||||
instance CmbRadiusTL StyleState where
|
||||
radiusTL rad = def & L.radius . non def . L.topLeft ?~ radiusCorner rad
|
||||
|
||||
instance RadiusTR StyleState where
|
||||
instance CmbRadiusTR StyleState where
|
||||
radiusTR rad = def & L.radius . non def . L.topRight ?~ radiusCorner rad
|
||||
|
||||
instance RadiusBL StyleState where
|
||||
instance CmbRadiusBL StyleState where
|
||||
radiusBL rad = def & L.radius . non def . L.bottomLeft ?~ radiusCorner rad
|
||||
|
||||
instance RadiusBR StyleState where
|
||||
instance CmbRadiusBR StyleState where
|
||||
radiusBR rad = def & L.radius . non def . L.bottomRight ?~ radiusCorner rad
|
||||
|
||||
-- Inner radius
|
||||
instance InnerRadius_ StyleState where
|
||||
instance CmbInnerRadius StyleState where
|
||||
iradius rad = def & L.radius ?~ iradius rad
|
||||
|
||||
instance InnerRadiusTL StyleState where
|
||||
instance CmbInnerRadiusTL StyleState where
|
||||
iradiusTL rad = def & L.radius . non def . L.topLeft ?~ iradiusCorner rad
|
||||
|
||||
instance InnerRadiusTR StyleState where
|
||||
instance CmbInnerRadiusTR StyleState where
|
||||
iradiusTR rad = def & L.radius . non def . L.topRight ?~ iradiusCorner rad
|
||||
|
||||
instance InnerRadiusBL StyleState where
|
||||
instance CmbInnerRadiusBL StyleState where
|
||||
iradiusBL rad = def & L.radius . non def . L.bottomLeft ?~ iradiusCorner rad
|
||||
|
||||
instance InnerRadiusBR StyleState where
|
||||
instance CmbInnerRadiusBR StyleState where
|
||||
iradiusBR rad = def & L.radius . non def . L.bottomRight ?~ iradiusCorner rad
|
||||
|
||||
-- Internal
|
||||
|
@ -45,45 +45,45 @@ getContentArea :: StyleState -> WidgetInstance s e -> Rect
|
||||
getContentArea style inst = fromMaybe def area where
|
||||
area = removeOuterBounds style (_wiRenderArea inst)
|
||||
|
||||
instance Style_ Style where
|
||||
instance CmbStyle Style where
|
||||
style oldStyle states = newStyle where
|
||||
state = mconcat states
|
||||
newStyle = oldStyle & L.basic ?~ state
|
||||
|
||||
instance Hover_ Style where
|
||||
instance CmbHover Style where
|
||||
hover oldStyle states = newStyle where
|
||||
state = mconcat states
|
||||
newStyle = oldStyle & L.hover ?~ state
|
||||
|
||||
instance Focus_ Style where
|
||||
instance CmbFocus Style where
|
||||
focus oldStyle states = newStyle where
|
||||
state = mconcat states
|
||||
newStyle = oldStyle & L.focus ?~ state
|
||||
|
||||
instance Disabled_ Style where
|
||||
instance CmbDisabled Style where
|
||||
disabled oldStyle states = newStyle where
|
||||
state = mconcat states
|
||||
newStyle = oldStyle & L.disabled ?~ state
|
||||
|
||||
instance Style_ (WidgetInstance s e) where
|
||||
instance CmbStyle (WidgetInstance s e) where
|
||||
style inst states = inst & L.style .~ newStyle where
|
||||
state = mconcat states
|
||||
oldStyle = inst ^. L.style
|
||||
newStyle = oldStyle & L.basic ?~ state
|
||||
|
||||
instance Hover_ (WidgetInstance s e) where
|
||||
instance CmbHover (WidgetInstance s e) where
|
||||
hover inst states = inst & L.style .~ newStyle where
|
||||
state = mconcat states
|
||||
oldStyle = inst ^. L.style
|
||||
newStyle = oldStyle & L.hover ?~ state
|
||||
|
||||
instance Focus_ (WidgetInstance s e) where
|
||||
instance CmbFocus (WidgetInstance s e) where
|
||||
focus inst states = inst & L.style .~ newStyle where
|
||||
state = mconcat states
|
||||
oldStyle = inst ^. L.style
|
||||
newStyle = oldStyle & L.focus ?~ state
|
||||
|
||||
instance Disabled_ (WidgetInstance s e) where
|
||||
instance CmbDisabled (WidgetInstance s e) where
|
||||
disabled inst states = inst & L.style .~ newStyle where
|
||||
state = mconcat states
|
||||
oldStyle = inst ^. L.style
|
||||
|
@ -44,7 +44,7 @@ instance Semigroup AlertCfg where
|
||||
instance Monoid AlertCfg where
|
||||
mempty = def
|
||||
|
||||
instance CloseCaption AlertCfg where
|
||||
instance CmbCloseCaption AlertCfg where
|
||||
closeCaption t = def {
|
||||
_alcClose = Just t
|
||||
}
|
||||
|
@ -51,52 +51,52 @@ instance Semigroup (BoxCfg s e) where
|
||||
instance Monoid (BoxCfg s e) where
|
||||
mempty = def
|
||||
|
||||
instance AlignLeft (BoxCfg s e) where
|
||||
instance CmbAlignLeft (BoxCfg s e) where
|
||||
alignLeft = def {
|
||||
_boxAlignH = Just ALeft
|
||||
}
|
||||
|
||||
instance AlignCenter (BoxCfg s e) where
|
||||
instance CmbAlignCenter (BoxCfg s e) where
|
||||
alignCenter = def {
|
||||
_boxAlignH = Just ACenter
|
||||
}
|
||||
|
||||
instance AlignRight (BoxCfg s e) where
|
||||
instance CmbAlignRight (BoxCfg s e) where
|
||||
alignRight = def {
|
||||
_boxAlignH = Just ARight
|
||||
}
|
||||
|
||||
instance AlignTop (BoxCfg s e) where
|
||||
instance CmbAlignTop (BoxCfg s e) where
|
||||
alignTop = def {
|
||||
_boxAlignV = Just ATop
|
||||
}
|
||||
|
||||
instance AlignMiddle (BoxCfg s e) where
|
||||
instance CmbAlignMiddle (BoxCfg s e) where
|
||||
alignMiddle = def {
|
||||
_boxAlignV = Just AMiddle
|
||||
}
|
||||
|
||||
instance AlignBottom (BoxCfg s e) where
|
||||
instance CmbAlignBottom (BoxCfg s e) where
|
||||
alignBottom = def {
|
||||
_boxAlignV = Just ABottom
|
||||
}
|
||||
|
||||
instance OnClick (BoxCfg s e) e where
|
||||
instance CmbOnClick (BoxCfg s e) e where
|
||||
onClick handler = def {
|
||||
_boxOnClick = [handler]
|
||||
}
|
||||
|
||||
instance OnClickReq (BoxCfg s e) s where
|
||||
instance CmbOnClickReq (BoxCfg s e) s where
|
||||
onClickReq req = def {
|
||||
_boxOnClickReq = [req]
|
||||
}
|
||||
|
||||
instance OnClickEmpty (BoxCfg s e) e where
|
||||
instance CmbOnClickEmpty (BoxCfg s e) e where
|
||||
onClickEmpty handler = def {
|
||||
_boxOnClickEmpty = [handler]
|
||||
}
|
||||
|
||||
instance OnClickEmptyReq (BoxCfg s e) s where
|
||||
instance CmbOnClickEmptyReq (BoxCfg s e) s where
|
||||
onClickEmptyReq req = def {
|
||||
_boxOnClickEmptyReq = [req]
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ instance Semigroup (ButtonCfg s e) where
|
||||
instance Monoid (ButtonCfg s e) where
|
||||
mempty = def
|
||||
|
||||
instance TextOverflow_ (ButtonCfg s e) where
|
||||
instance CmbTextOverflow (ButtonCfg s e) where
|
||||
textEllipsis = def {
|
||||
_btnTextOverflow = Just Ellipsis
|
||||
}
|
||||
@ -84,7 +84,7 @@ instance TextOverflow_ (ButtonCfg s e) where
|
||||
_btnTextOverflow = Just ClipText
|
||||
}
|
||||
|
||||
instance TextMode_ (ButtonCfg s e) where
|
||||
instance CmbTextMode (ButtonCfg s e) where
|
||||
textSingleLine = def {
|
||||
_btnTextMode = Just SingleLine
|
||||
}
|
||||
@ -92,7 +92,7 @@ instance TextMode_ (ButtonCfg s e) where
|
||||
_btnTextMode = Just MultiLine
|
||||
}
|
||||
|
||||
instance TextTrim_ (ButtonCfg s e) where
|
||||
instance CmbTextTrim (ButtonCfg s e) where
|
||||
textTrim = def {
|
||||
_btnTrim = Just TrimSpaces
|
||||
}
|
||||
@ -100,37 +100,37 @@ instance TextTrim_ (ButtonCfg s e) where
|
||||
_btnTrim = Just KeepSpaces
|
||||
}
|
||||
|
||||
instance OnFocus (ButtonCfg s e) e where
|
||||
instance CmbOnFocus (ButtonCfg s e) e where
|
||||
onFocus fn = def {
|
||||
_btnOnFocus = [fn]
|
||||
}
|
||||
|
||||
instance OnFocusReq (ButtonCfg s e) s where
|
||||
instance CmbOnFocusReq (ButtonCfg s e) s where
|
||||
onFocusReq req = def {
|
||||
_btnOnFocusReq = [req]
|
||||
}
|
||||
|
||||
instance OnBlur (ButtonCfg s e) e where
|
||||
instance CmbOnBlur (ButtonCfg s e) e where
|
||||
onBlur fn = def {
|
||||
_btnOnBlur = [fn]
|
||||
}
|
||||
|
||||
instance OnBlurReq (ButtonCfg s e) s where
|
||||
instance CmbOnBlurReq (ButtonCfg s e) s where
|
||||
onBlurReq req = def {
|
||||
_btnOnBlurReq = [req]
|
||||
}
|
||||
|
||||
instance OnClick (ButtonCfg s e) e where
|
||||
instance CmbOnClick (ButtonCfg s e) e where
|
||||
onClick handler = def {
|
||||
_btnOnClick = [handler]
|
||||
}
|
||||
|
||||
instance OnClickReq (ButtonCfg s e) s where
|
||||
instance CmbOnClickReq (ButtonCfg s e) s where
|
||||
onClickReq req = def {
|
||||
_btnOnClickReq = [req]
|
||||
}
|
||||
|
||||
instance ResizeFactorDim (ButtonCfg s e) where
|
||||
instance CmbResizeFactorDim (ButtonCfg s e) where
|
||||
resizeFactorW w = def {
|
||||
_btnFactorW = Just w
|
||||
}
|
||||
|
@ -59,32 +59,32 @@ instance Semigroup (CheckboxCfg s e) where
|
||||
instance Monoid (CheckboxCfg s e) where
|
||||
mempty = def
|
||||
|
||||
instance OnFocus (CheckboxCfg s e) e where
|
||||
instance CmbOnFocus (CheckboxCfg s e) e where
|
||||
onFocus fn = def {
|
||||
_ckcOnFocus = [fn]
|
||||
}
|
||||
|
||||
instance OnFocusReq (CheckboxCfg s e) s where
|
||||
instance CmbOnFocusReq (CheckboxCfg s e) s where
|
||||
onFocusReq req = def {
|
||||
_ckcOnFocusReq = [req]
|
||||
}
|
||||
|
||||
instance OnBlur (CheckboxCfg s e) e where
|
||||
instance CmbOnBlur (CheckboxCfg s e) e where
|
||||
onBlur fn = def {
|
||||
_ckcOnBlur = [fn]
|
||||
}
|
||||
|
||||
instance OnBlurReq (CheckboxCfg s e) s where
|
||||
instance CmbOnBlurReq (CheckboxCfg s e) s where
|
||||
onBlurReq req = def {
|
||||
_ckcOnBlurReq = [req]
|
||||
}
|
||||
|
||||
instance OnChange (CheckboxCfg s e) Bool e where
|
||||
instance CmbOnChange (CheckboxCfg s e) Bool e where
|
||||
onChange fn = def {
|
||||
_ckcOnChange = [fn]
|
||||
}
|
||||
|
||||
instance OnChangeReq (CheckboxCfg s e) s where
|
||||
instance CmbOnChangeReq (CheckboxCfg s e) s where
|
||||
onChangeReq req = def {
|
||||
_ckcOnChangeReq = [req]
|
||||
}
|
||||
|
@ -47,12 +47,12 @@ instance Semigroup ConfirmCfg where
|
||||
instance Monoid ConfirmCfg where
|
||||
mempty = def
|
||||
|
||||
instance AcceptCaption ConfirmCfg where
|
||||
instance CmbAcceptCaption ConfirmCfg where
|
||||
acceptCaption t = def {
|
||||
_cfcAccept = Just t
|
||||
}
|
||||
|
||||
instance CancelCaption ConfirmCfg where
|
||||
instance CmbCancelCaption ConfirmCfg where
|
||||
cancelCaption t = def {
|
||||
_cfcCancel = Just t
|
||||
}
|
||||
|
@ -67,42 +67,42 @@ instance Semigroup (DropdownCfg s e a) where
|
||||
instance Monoid (DropdownCfg s e a) where
|
||||
mempty = def
|
||||
|
||||
instance OnChange (DropdownCfg s e a) a e where
|
||||
instance CmbOnChange (DropdownCfg s e a) a e where
|
||||
onChange fn = def {
|
||||
_ddcOnChange = [fn]
|
||||
}
|
||||
|
||||
instance OnChangeReq (DropdownCfg s e a) s where
|
||||
instance CmbOnChangeReq (DropdownCfg s e a) s where
|
||||
onChangeReq req = def {
|
||||
_ddcOnChangeReq = [req]
|
||||
}
|
||||
|
||||
instance OnChangeIdx (DropdownCfg s e a) a e where
|
||||
instance CmbOnChangeIdx (DropdownCfg s e a) a e where
|
||||
onChangeIdx fn = def {
|
||||
_ddcOnChangeIdx = [fn]
|
||||
}
|
||||
|
||||
instance OnChangeIdxReq (DropdownCfg s e a) s where
|
||||
instance CmbOnChangeIdxReq (DropdownCfg s e a) s where
|
||||
onChangeIdxReq req = def {
|
||||
_ddcOnChangeIdxReq = [req]
|
||||
}
|
||||
|
||||
instance MaxHeight (DropdownCfg s e a) where
|
||||
instance CmbMaxHeight (DropdownCfg s e a) where
|
||||
maxHeight h = def {
|
||||
_ddcMaxHeight = Just h
|
||||
}
|
||||
|
||||
instance ItemListStyle (DropdownCfg s e a) Style where
|
||||
instance CmbItemListStyle (DropdownCfg s e a) Style where
|
||||
itemListStyle style = def {
|
||||
_ddcListStyle = Just style
|
||||
}
|
||||
|
||||
instance ItemNormalStyle (DropdownCfg s e a) Style where
|
||||
instance CmbItemNormalStyle (DropdownCfg s e a) Style where
|
||||
itemNormalStyle style = def {
|
||||
_ddcItemStyle = Just style
|
||||
}
|
||||
|
||||
instance ItemSelectedStyle (DropdownCfg s e a) Style where
|
||||
instance CmbItemSelectedStyle (DropdownCfg s e a) Style where
|
||||
itemSelectedStyle style = def {
|
||||
_ddcItemSelectedStyle = Just style
|
||||
}
|
||||
|
@ -82,57 +82,57 @@ instance Semigroup (FloatingFieldCfg s e a) where
|
||||
instance Monoid (FloatingFieldCfg s e a) where
|
||||
mempty = def
|
||||
|
||||
instance ValidInput (FloatingFieldCfg s e a) s where
|
||||
instance CmbValidInput (FloatingFieldCfg s e a) s where
|
||||
validInput field = def {
|
||||
_ffcValid = Just (WidgetLens field)
|
||||
}
|
||||
|
||||
instance SelectOnFocus (FloatingFieldCfg s e a) where
|
||||
instance CmbSelectOnFocus (FloatingFieldCfg s e a) where
|
||||
selectOnFocus sel = def {
|
||||
_ffcSelectOnFocus = Just sel
|
||||
}
|
||||
|
||||
instance FormattableFloat a => MinValue (FloatingFieldCfg s e a) a where
|
||||
instance FormattableFloat a => CmbMinValue (FloatingFieldCfg s e a) a where
|
||||
minValue len = def {
|
||||
_ffcMinValue = Just len
|
||||
}
|
||||
|
||||
instance FormattableFloat a => MaxValue (FloatingFieldCfg s e a) a where
|
||||
instance FormattableFloat a => CmbMaxValue (FloatingFieldCfg s e a) a where
|
||||
maxValue len = def {
|
||||
_ffcMaxValue = Just len
|
||||
}
|
||||
|
||||
instance Decimals (FloatingFieldCfg s e a) where
|
||||
instance CmbDecimals (FloatingFieldCfg s e a) where
|
||||
decimals num = def {
|
||||
_ffcDecimals = Just num
|
||||
}
|
||||
|
||||
instance OnFocus (FloatingFieldCfg s e a) e where
|
||||
instance CmbOnFocus (FloatingFieldCfg s e a) e where
|
||||
onFocus fn = def {
|
||||
_ffcOnFocus = [fn]
|
||||
}
|
||||
|
||||
instance OnFocusReq (FloatingFieldCfg s e a) s where
|
||||
instance CmbOnFocusReq (FloatingFieldCfg s e a) s where
|
||||
onFocusReq req = def {
|
||||
_ffcOnFocusReq = [req]
|
||||
}
|
||||
|
||||
instance OnBlur (FloatingFieldCfg s e a) e where
|
||||
instance CmbOnBlur (FloatingFieldCfg s e a) e where
|
||||
onBlur fn = def {
|
||||
_ffcOnBlur = [fn]
|
||||
}
|
||||
|
||||
instance OnBlurReq (FloatingFieldCfg s e a) s where
|
||||
instance CmbOnBlurReq (FloatingFieldCfg s e a) s where
|
||||
onBlurReq req = def {
|
||||
_ffcOnBlurReq = [req]
|
||||
}
|
||||
|
||||
instance OnChange (FloatingFieldCfg s e a) a e where
|
||||
instance CmbOnChange (FloatingFieldCfg s e a) a e where
|
||||
onChange fn = def {
|
||||
_ffcOnChange = [fn]
|
||||
}
|
||||
|
||||
instance OnChangeReq (FloatingFieldCfg s e a) s where
|
||||
instance CmbOnChangeReq (FloatingFieldCfg s e a) s where
|
||||
onChangeReq req = def {
|
||||
_ffcOnChangeReq = [req]
|
||||
}
|
||||
|
@ -68,12 +68,12 @@ instance Semigroup (ImageCfg s e) where
|
||||
instance Monoid (ImageCfg s e) where
|
||||
mempty = def
|
||||
|
||||
instance Transparency (ImageCfg s e) where
|
||||
instance CmbTransparency (ImageCfg s e) where
|
||||
transparency alpha = def {
|
||||
_imcTransparency = Just alpha
|
||||
}
|
||||
|
||||
instance OnLoadError (ImageCfg s e) ImageLoadError e where
|
||||
instance CmbOnLoadError (ImageCfg s e) ImageLoadError e where
|
||||
onLoadError err = def {
|
||||
_imcLoadError = [err]
|
||||
}
|
||||
|
@ -79,52 +79,52 @@ instance Semigroup (IntegralFieldCfg s e a) where
|
||||
instance Monoid (IntegralFieldCfg s e a) where
|
||||
mempty = def
|
||||
|
||||
instance ValidInput (IntegralFieldCfg s e a) s where
|
||||
instance CmbValidInput (IntegralFieldCfg s e a) s where
|
||||
validInput field = def {
|
||||
_nfcValid = Just (WidgetLens field)
|
||||
}
|
||||
|
||||
instance SelectOnFocus (IntegralFieldCfg s e a) where
|
||||
instance CmbSelectOnFocus (IntegralFieldCfg s e a) where
|
||||
selectOnFocus sel = def {
|
||||
_nfcSelectOnFocus = Just sel
|
||||
}
|
||||
|
||||
instance FormattableInt a => MinValue (IntegralFieldCfg s e a) a where
|
||||
instance FormattableInt a => CmbMinValue (IntegralFieldCfg s e a) a where
|
||||
minValue len = def {
|
||||
_nfcMinValue = Just len
|
||||
}
|
||||
|
||||
instance FormattableInt a => MaxValue (IntegralFieldCfg s e a) a where
|
||||
instance FormattableInt a => CmbMaxValue (IntegralFieldCfg s e a) a where
|
||||
maxValue len = def {
|
||||
_nfcMaxValue = Just len
|
||||
}
|
||||
|
||||
instance OnFocus (IntegralFieldCfg s e a) e where
|
||||
instance CmbOnFocus (IntegralFieldCfg s e a) e where
|
||||
onFocus fn = def {
|
||||
_nfcOnFocus = [fn]
|
||||
}
|
||||
|
||||
instance OnFocusReq (IntegralFieldCfg s e a) s where
|
||||
instance CmbOnFocusReq (IntegralFieldCfg s e a) s where
|
||||
onFocusReq req = def {
|
||||
_nfcOnFocusReq = [req]
|
||||
}
|
||||
|
||||
instance OnBlur (IntegralFieldCfg s e a) e where
|
||||
instance CmbOnBlur (IntegralFieldCfg s e a) e where
|
||||
onBlur fn = def {
|
||||
_nfcOnBlur = [fn]
|
||||
}
|
||||
|
||||
instance OnBlurReq (IntegralFieldCfg s e a) s where
|
||||
instance CmbOnBlurReq (IntegralFieldCfg s e a) s where
|
||||
onBlurReq req = def {
|
||||
_nfcOnBlurReq = [req]
|
||||
}
|
||||
|
||||
instance OnChange (IntegralFieldCfg s e a) a e where
|
||||
instance CmbOnChange (IntegralFieldCfg s e a) a e where
|
||||
onChange fn = def {
|
||||
_nfcOnChange = [fn]
|
||||
}
|
||||
|
||||
instance OnChangeReq (IntegralFieldCfg s e a) s where
|
||||
instance CmbOnChangeReq (IntegralFieldCfg s e a) s where
|
||||
onChangeReq req = def {
|
||||
_nfcOnChangeReq = [req]
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ instance Semigroup LabelCfg where
|
||||
instance Monoid LabelCfg where
|
||||
mempty = def
|
||||
|
||||
instance TextOverflow_ LabelCfg where
|
||||
instance CmbTextOverflow LabelCfg where
|
||||
textEllipsis = def {
|
||||
_lscTextOverflow = Just Ellipsis
|
||||
}
|
||||
@ -55,7 +55,7 @@ instance TextOverflow_ LabelCfg where
|
||||
_lscTextOverflow = Just ClipText
|
||||
}
|
||||
|
||||
instance TextMode_ LabelCfg where
|
||||
instance CmbTextMode LabelCfg where
|
||||
textSingleLine = def {
|
||||
_lscTextMode = Just SingleLine
|
||||
}
|
||||
@ -63,7 +63,7 @@ instance TextMode_ LabelCfg where
|
||||
_lscTextMode = Just MultiLine
|
||||
}
|
||||
|
||||
instance TextTrim_ LabelCfg where
|
||||
instance CmbTextTrim LabelCfg where
|
||||
textTrim = def {
|
||||
_lscTrim = Just TrimSpaces
|
||||
}
|
||||
@ -71,7 +71,7 @@ instance TextTrim_ LabelCfg where
|
||||
_lscTrim = Just KeepSpaces
|
||||
}
|
||||
|
||||
instance ResizeFactorDim LabelCfg where
|
||||
instance CmbResizeFactorDim LabelCfg where
|
||||
resizeFactorW w = def {
|
||||
_lscFactorW = Just w
|
||||
}
|
||||
|
@ -93,57 +93,57 @@ instance Monoid (ListViewCfg s e a) where
|
||||
_lvcOnChangeIdxReq = []
|
||||
}
|
||||
|
||||
instance OnFocus (ListViewCfg s e a) e where
|
||||
instance CmbOnFocus (ListViewCfg s e a) e where
|
||||
onFocus fn = def {
|
||||
_lvcOnFocus = [fn]
|
||||
}
|
||||
|
||||
instance OnFocusReq (ListViewCfg s e a) s where
|
||||
instance CmbOnFocusReq (ListViewCfg s e a) s where
|
||||
onFocusReq req = def {
|
||||
_lvcOnFocusReq = [req]
|
||||
}
|
||||
|
||||
instance OnBlur (ListViewCfg s e a) e where
|
||||
instance CmbOnBlur (ListViewCfg s e a) e where
|
||||
onBlur fn = def {
|
||||
_lvcOnBlur = [fn]
|
||||
}
|
||||
|
||||
instance OnBlurReq (ListViewCfg s e a) s where
|
||||
instance CmbOnBlurReq (ListViewCfg s e a) s where
|
||||
onBlurReq req = def {
|
||||
_lvcOnBlurReq = [req]
|
||||
}
|
||||
|
||||
instance OnChange (ListViewCfg s e a) a e where
|
||||
instance CmbOnChange (ListViewCfg s e a) a e where
|
||||
onChange fn = def {
|
||||
_lvcOnChange = [fn]
|
||||
}
|
||||
|
||||
instance OnChangeReq (ListViewCfg s e a) s where
|
||||
instance CmbOnChangeReq (ListViewCfg s e a) s where
|
||||
onChangeReq req = def {
|
||||
_lvcOnChangeReq = [req]
|
||||
}
|
||||
|
||||
instance OnChangeIdx (ListViewCfg s e a) a e where
|
||||
instance CmbOnChangeIdx (ListViewCfg s e a) a e where
|
||||
onChangeIdx fn = def {
|
||||
_lvcOnChangeIdx = [fn]
|
||||
}
|
||||
|
||||
instance OnChangeIdxReq (ListViewCfg s e a) s where
|
||||
instance CmbOnChangeIdxReq (ListViewCfg s e a) s where
|
||||
onChangeIdxReq req = def {
|
||||
_lvcOnChangeIdxReq = [req]
|
||||
}
|
||||
|
||||
instance SelectOnBlur (ListViewCfg s e a) where
|
||||
instance CmbSelectOnBlur (ListViewCfg s e a) where
|
||||
selectOnBlur select = def {
|
||||
_lvcSelectOnBlur = Just select
|
||||
}
|
||||
|
||||
instance ItemNormalStyle (ListViewCfg s e a) Style where
|
||||
instance CmbItemNormalStyle (ListViewCfg s e a) Style where
|
||||
itemNormalStyle style = def {
|
||||
_lvcItemStyle = Just style
|
||||
}
|
||||
|
||||
instance ItemSelectedStyle (ListViewCfg s e a) Style where
|
||||
instance CmbItemSelectedStyle (ListViewCfg s e a) Style where
|
||||
itemSelectedStyle style = def {
|
||||
_lvcItemSelectedStyle = Just style
|
||||
}
|
||||
|
@ -57,32 +57,32 @@ instance Semigroup (RadioCfg s e a) where
|
||||
instance Monoid (RadioCfg s e a) where
|
||||
mempty = def
|
||||
|
||||
instance OnFocus (RadioCfg s e a) e where
|
||||
instance CmbOnFocus (RadioCfg s e a) e where
|
||||
onFocus fn = def {
|
||||
_rdcOnFocus = [fn]
|
||||
}
|
||||
|
||||
instance OnFocusReq (RadioCfg s e a) s where
|
||||
instance CmbOnFocusReq (RadioCfg s e a) s where
|
||||
onFocusReq req = def {
|
||||
_rdcOnFocusReq = [req]
|
||||
}
|
||||
|
||||
instance OnBlur (RadioCfg s e a) e where
|
||||
instance CmbOnBlur (RadioCfg s e a) e where
|
||||
onBlur fn = def {
|
||||
_rdcOnBlur = [fn]
|
||||
}
|
||||
|
||||
instance OnBlurReq (RadioCfg s e a) s where
|
||||
instance CmbOnBlurReq (RadioCfg s e a) s where
|
||||
onBlurReq req = def {
|
||||
_rdcOnBlurReq = [req]
|
||||
}
|
||||
|
||||
instance OnChange (RadioCfg s e a) a e where
|
||||
instance CmbOnChange (RadioCfg s e a) a e where
|
||||
onChange fn = def {
|
||||
_rdcOnChange = [fn]
|
||||
}
|
||||
|
||||
instance OnChangeReq (RadioCfg s e a) s where
|
||||
instance CmbOnChangeReq (RadioCfg s e a) s where
|
||||
onChangeReq req = def {
|
||||
_rdcOnChangeReq = [req]
|
||||
}
|
||||
|
@ -32,17 +32,17 @@ instance Semigroup SpacerCfg where
|
||||
instance Monoid SpacerCfg where
|
||||
mempty = def
|
||||
|
||||
instance Width SpacerCfg where
|
||||
instance CmbWidth SpacerCfg where
|
||||
width w = def {
|
||||
_spcWidth = Just w
|
||||
}
|
||||
|
||||
instance Height SpacerCfg where
|
||||
instance CmbHeight SpacerCfg where
|
||||
height h = def {
|
||||
_spcHeight = Just h
|
||||
}
|
||||
|
||||
instance ResizeFactor SpacerCfg where
|
||||
instance CmbResizeFactor SpacerCfg where
|
||||
resizeFactor f = def {
|
||||
_spcFactor = Just f
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ instance Semigroup StackCfg where
|
||||
instance Monoid StackCfg where
|
||||
mempty = def
|
||||
|
||||
instance IgnoreEmptyClick StackCfg where
|
||||
instance CmbIgnoreEmptyClick StackCfg where
|
||||
ignoreEmptyClick ignore = def {
|
||||
_stcIgnoreEmptyClick = Just ignore
|
||||
}
|
||||
|
@ -66,47 +66,47 @@ instance Semigroup (TextFieldCfg s e) where
|
||||
instance Monoid (TextFieldCfg s e) where
|
||||
mempty = def
|
||||
|
||||
instance ValidInput (TextFieldCfg s e) s where
|
||||
instance CmbValidInput (TextFieldCfg s e) s where
|
||||
validInput field = def {
|
||||
_tfcValid = Just (WidgetLens field)
|
||||
}
|
||||
|
||||
instance SelectOnFocus (TextFieldCfg s e) where
|
||||
instance CmbSelectOnFocus (TextFieldCfg s e) where
|
||||
selectOnFocus sel = def {
|
||||
_tfcSelectOnFocus = Just sel
|
||||
}
|
||||
|
||||
instance MaxLength (TextFieldCfg s e) where
|
||||
instance CmbMaxLength (TextFieldCfg s e) where
|
||||
maxLength len = def {
|
||||
_tfcMaxLength = Just len
|
||||
}
|
||||
|
||||
instance OnFocus (TextFieldCfg s e) e where
|
||||
instance CmbOnFocus (TextFieldCfg s e) e where
|
||||
onFocus fn = def {
|
||||
_tfcOnFocus = [fn]
|
||||
}
|
||||
|
||||
instance OnFocusReq (TextFieldCfg s e) s where
|
||||
instance CmbOnFocusReq (TextFieldCfg s e) s where
|
||||
onFocusReq req = def {
|
||||
_tfcOnFocusReq = [req]
|
||||
}
|
||||
|
||||
instance OnBlur (TextFieldCfg s e) e where
|
||||
instance CmbOnBlur (TextFieldCfg s e) e where
|
||||
onBlur fn = def {
|
||||
_tfcOnBlur = [fn]
|
||||
}
|
||||
|
||||
instance OnBlurReq (TextFieldCfg s e) s where
|
||||
instance CmbOnBlurReq (TextFieldCfg s e) s where
|
||||
onBlurReq req = def {
|
||||
_tfcOnBlurReq = [req]
|
||||
}
|
||||
|
||||
instance OnChange (TextFieldCfg s e) Text e where
|
||||
instance CmbOnChange (TextFieldCfg s e) Text e where
|
||||
onChange fn = def {
|
||||
_tfcOnChange = [fn]
|
||||
}
|
||||
|
||||
instance OnChangeReq (TextFieldCfg s e) s where
|
||||
instance CmbOnChangeReq (TextFieldCfg s e) s where
|
||||
onChangeReq req = def {
|
||||
_tfcOnChangeReq = [req]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user