gi-adwaita-1.0.7: Adwaita bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Adw.Structs.BreakpointCondition

Description

Describes condition for an [classbreakpoint].

Since: 1.4

Synopsis

Exported types

newtype BreakpointCondition Source #

Memory-managed wrapper type.

Constructors

BreakpointCondition (ManagedPtr BreakpointCondition) 

Instances

Instances details
Eq BreakpointCondition Source # 
Instance details

Defined in GI.Adw.Structs.BreakpointCondition

GBoxed BreakpointCondition Source # 
Instance details

Defined in GI.Adw.Structs.BreakpointCondition

ManagedPtrNewtype BreakpointCondition Source # 
Instance details

Defined in GI.Adw.Structs.BreakpointCondition

TypedObject BreakpointCondition Source # 
Instance details

Defined in GI.Adw.Structs.BreakpointCondition

Methods

glibType :: IO GType

HasParentTypes BreakpointCondition Source # 
Instance details

Defined in GI.Adw.Structs.BreakpointCondition

IsGValue (Maybe BreakpointCondition) Source #

Convert BreakpointCondition to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Adw.Structs.BreakpointCondition

type ParentTypes BreakpointCondition Source # 
Instance details

Defined in GI.Adw.Structs.BreakpointCondition

type ParentTypes BreakpointCondition = '[] :: [Type]

Methods

Click to display all available methods, including inherited ones

Expand

Methods

copy, free, toString.

Getters

None.

Setters

None.

copy

breakpointConditionCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BreakpointCondition

self: a breakpoint condition

-> m BreakpointCondition

Returns: a copy of self

Copies self.

Since: 1.4

free

breakpointConditionFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BreakpointCondition

self: a breakpoint condition

-> m () 

Frees self.

Since: 1.4

newAnd

breakpointConditionNewAnd Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BreakpointCondition

condition1: first condition

-> BreakpointCondition

condition2: second condition

-> m BreakpointCondition

Returns: the newly created condition

Creates a condition that triggers when condition1 and condition2 are both true.

Since: 1.4

newLength

breakpointConditionNewLength Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BreakpointConditionLengthType

type: the length type

-> Double

value: the length value

-> LengthUnit

unit: the length unit

-> m BreakpointCondition

Returns: the newly created condition

Creates a condition that triggers on length changes.

Since: 1.4

newOr

breakpointConditionNewOr Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BreakpointCondition

condition1: first condition

-> BreakpointCondition

condition2: second condition

-> m BreakpointCondition

Returns: the newly created condition

Creates a condition that triggers when either condition1 or condition2 is true.

Since: 1.4

newRatio

breakpointConditionNewRatio Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BreakpointConditionRatioType

type: the ratio type

-> Int32

width: ratio width

-> Int32

height: ratio height

-> m BreakpointCondition

Returns: the newly created condition

Creates a condition that triggers on ratio changes.

The ratio is represented as width divided by height.

Since: 1.4

parse

breakpointConditionParse Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

str: the string specifying the condition

-> m BreakpointCondition

Returns: the parsed condition

Parses a condition from a string.

Length conditions are specified as <type>: <value>[<unit>], where:

  • <type> can be min-width, max-width, min-height or max-height
  • <value> is a fractional number
  • <unit> can be px, pt or sp

If the unit is omitted, px is assumed.

See [ctorbreakpointCondition.new_length].

Examples:

  • min-width: 500px
  • min-height: 400pt
  • max-width: 100sp
  • max-height: 500

Ratio conditions are specified as <type>: <width>[/<height>], where:

  • <type> can be min-aspect-ratio or max-aspect-ratio
  • <width> and <height> are integer numbers

See [ctorbreakpointCondition.new_ratio].

The ratio is represented as <width> divided by <height>.

If <height> is omitted, it's assumed to be 1.

Examples:

  • min-aspect-ratio: 4/3
  • max-aspect-ratio: 1

The logical operators and, or can be used to compose a complex condition as follows:

  • <condition> and <condition>: the condition is true when both <condition>s are true, same as when using [ctorbreakpointCondition.new_and]
  • <condition> or <condition>: the condition is true when either of the <condition>s is true, same as when using [ctorbreakpointCondition.new_or]

Examples:

  • min-width: 400px and max-aspect-ratio: 4/3
  • max-width: 360sp or max-width: 360px

Conditions can be further nested using parentheses, for example:

  • min-width: 400px and (max-aspect-ratio: 4/3 or max-height: 400px)

If parentheses are omitted, the first operator takes priority.

Since: 1.4

toString

breakpointConditionToString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BreakpointCondition

self: a breakpoint condition

-> m Text

Returns: A newly allocated text string

Returns a textual representation of self.

The returned string can be parsed by BreakpointCondition.parse.

Since: 1.4