Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Monomer.Core.StyleTypes
Description
Basic types for styling widgets.
Synopsis
- data SizeReq = SizeReq {}
- data CursorIcon
- data Style = Style {}
- data StyleState = StyleState {
- _sstSizeReqW :: Maybe SizeReq
- _sstSizeReqH :: Maybe SizeReq
- _sstPadding :: Maybe Padding
- _sstBorder :: Maybe Border
- _sstRadius :: Maybe Radius
- _sstBgColor :: Maybe Color
- _sstFgColor :: Maybe Color
- _sstSndColor :: Maybe Color
- _sstHlColor :: Maybe Color
- _sstText :: Maybe TextStyle
- _sstCursorIcon :: Maybe CursorIcon
- data Padding = Padding {}
- data BorderSide = BorderSide {}
- data Border = Border {}
- data RadiusType
- newtype RadiusCorner = RadiusCorner {}
- data Radius = Radius {}
- data LineBreak
- data TextStyle = TextStyle {
- _txsFont :: Maybe Font
- _txsFontSize :: Maybe FontSize
- _txsFontSpaceH :: Maybe FontSpace
- _txsFontSpaceV :: Maybe FontSpace
- _txsFontColor :: Maybe Color
- _txsUnderline :: Maybe Bool
- _txsOverline :: Maybe Bool
- _txsThroughline :: Maybe Bool
- _txsAlignH :: Maybe AlignTH
- _txsAlignV :: Maybe AlignTV
- _txsLineBreak :: Maybe LineBreak
Documentation
Represents a size requirement for a specific axis. Mainly used by stack and box, with grid using it as the base for its calculations. Each field represents:
- Fixed: A minimum size required by the widget. This type of space is the first that gets assigned.
- Flex: Additional space the widget accepts, up to the provided value. After fixed requirements are satisfied, flex sizes are assigned proportionally considering factor.
- Extra: After flex is satisfied, the remaining space is distributed proportionally, considering factor, to all non zero extra requirements. There is no limit to how much extra space can be assigned.
- Factor: How much flex/extra space a widget will get proportionally. This also affects how much a requirement is willing to lose: a value less than 1 can receive less space, but gives up less too.
Constructors
SizeReq | |
Instances
data CursorIcon Source #
Different mouse pointer types.
Constructors
CursorArrow | |
CursorHand | |
CursorIBeam | |
CursorInvalid | |
CursorSizeH | |
CursorSizeV | |
CursorDiagTL | |
CursorDiagTR |
Instances
Main style type, comprised of configurations for the different states:
- Basic: Starting state for a widget, without any kind of interaction. This is used as the base for all other states, which override values as needed.
- Hover: The mouse pointer is on top of the current widget.
- Focus: The widget has keyboard focus.
- Focus-Hover: The widget has keyboard focus and mouse is on top. Without this state one of Hover or Focus would take precedence and it would not be possible to specify the desired behavior.
- Active: The mouse button is currently pressed and the pointer is within the boundaries of the widget.
- Disabled: The widget is disabled.
Constructors
Style | |
Instances
data StyleState Source #
Customizable style items for a specific state. All values are optional, and can be combined with the latest values taking precedence when the previous value is not empty.
Constructors
StyleState | |
Fields
|
Instances
Padding definitions (space between border and content) for each side.
Constructors
Padding | |
Instances
data BorderSide Source #
Defines width and color for a given border side.
Constructors
BorderSide | |
Instances
Border definitions for each side.
Constructors
Border | |
Fields |
Instances
data RadiusType Source #
Type of corner radius.
Constructors
RadiusInner | |
RadiusBoth |
Instances
Monoid RadiusType Source # | |
Defined in Monomer.Core.StyleTypes Methods mempty :: RadiusType # mappend :: RadiusType -> RadiusType -> RadiusType # mconcat :: [RadiusType] -> RadiusType # | |
Semigroup RadiusType Source # | |
Defined in Monomer.Core.StyleTypes Methods (<>) :: RadiusType -> RadiusType -> RadiusType # sconcat :: NonEmpty RadiusType -> RadiusType # stimes :: Integral b => b -> RadiusType -> RadiusType # | |
Generic RadiusType Source # | |
Defined in Monomer.Core.StyleTypes Associated Types type Rep RadiusType :: Type -> Type # | |
Show RadiusType Source # | |
Defined in Monomer.Core.StyleTypes Methods showsPrec :: Int -> RadiusType -> ShowS # show :: RadiusType -> String # showList :: [RadiusType] -> ShowS # | |
Default RadiusType Source # | |
Defined in Monomer.Core.StyleTypes Methods def :: RadiusType # | |
Eq RadiusType Source # | |
Defined in Monomer.Core.StyleTypes | |
type Rep RadiusType Source # | |
newtype RadiusCorner Source #
Defines radius type and width/radius for a given corner.
Constructors
RadiusCorner | |
Instances
Provides radius definitions for each corner.
Constructors
Radius | |
Instances
Defines how to break texts into lines.
Constructors
OnSpaces | |
OnCharacters |
Instances
Enum LineBreak Source # | |
Defined in Monomer.Core.StyleTypes Methods succ :: LineBreak -> LineBreak # pred :: LineBreak -> LineBreak # fromEnum :: LineBreak -> Int # enumFrom :: LineBreak -> [LineBreak] # enumFromThen :: LineBreak -> LineBreak -> [LineBreak] # enumFromTo :: LineBreak -> LineBreak -> [LineBreak] # enumFromThenTo :: LineBreak -> LineBreak -> LineBreak -> [LineBreak] # | |
Generic LineBreak Source # | |
Show LineBreak Source # | |
Default LineBreak Source # | |
Defined in Monomer.Core.StyleTypes | |
Eq LineBreak Source # | |
Ord LineBreak Source # | |
HasLineBreak TextStyle (Maybe LineBreak) Source # | |
type Rep LineBreak Source # | |
Text related definitions.
Constructors
TextStyle | |
Fields
|