Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
A Style
object encapsulates the information that provides the look and
feel for a widget.
In GTK+ 3.0, GtkStyle has been deprecated and replaced by 'GI.Gtk.Objects.StyleContext.StyleContext'.
Each Widget
has an associated Style
object that is used when
rendering that widget. Also, a Style
holds information for the five
possible widget states though not every widget supports all five
states; see StateType
.
Usually the Style
for a widget is the same as the default style that
is set by GTK+ and modified the theme engine.
Usually applications should not need to use or modify the Style
of
their widgets.
- newtype Style = Style (ManagedPtr Style)
- class GObject o => IsStyle o
- toStyle :: IsStyle o => o -> IO Style
- noStyle :: Maybe Style
- data StyleApplyDefaultBackgroundMethodInfo
- styleApplyDefaultBackground :: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) => a -> Context -> b -> StateType -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- data StyleCopyMethodInfo
- styleCopy :: (HasCallStack, MonadIO m, IsStyle a) => a -> m Style
- data StyleDetachMethodInfo
- styleDetach :: (HasCallStack, MonadIO m, IsStyle a) => a -> m ()
- data StyleGetStylePropertyMethodInfo
- styleGetStyleProperty :: (HasCallStack, MonadIO m, IsStyle a) => a -> GType -> Text -> m GValue
- data StyleHasContextMethodInfo
- styleHasContext :: (HasCallStack, MonadIO m, IsStyle a) => a -> m Bool
- data StyleLookupColorMethodInfo
- styleLookupColor :: (HasCallStack, MonadIO m, IsStyle a) => a -> Text -> m (Bool, Color)
- data StyleLookupIconSetMethodInfo
- styleLookupIconSet :: (HasCallStack, MonadIO m, IsStyle a) => a -> Text -> m IconSet
- styleNew :: (HasCallStack, MonadIO m) => m Style
- data StyleRenderIconMethodInfo
- styleRenderIcon :: (HasCallStack, MonadIO m, IsStyle a, IsWidget b) => a -> IconSource -> TextDirection -> StateType -> Int32 -> Maybe b -> Maybe Text -> m Pixbuf
- data StyleSetBackgroundMethodInfo
- styleSetBackground :: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) => a -> b -> StateType -> m ()
- data StyleContextPropertyInfo
- constructStyleContext :: (IsStyle o, IsStyleContext a) => a -> IO (GValueConstruct o)
- getStyleContext :: (MonadIO m, IsStyle o) => o -> m (Maybe StyleContext)
- styleContext :: AttrLabelProxy "context"
- type C_StyleRealizeCallback = Ptr () -> Ptr () -> IO ()
- type StyleRealizeCallback = IO ()
- data StyleRealizeSignalInfo
- afterStyleRealize :: (GObject a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId
- genClosure_StyleRealize :: StyleRealizeCallback -> IO Closure
- mk_StyleRealizeCallback :: C_StyleRealizeCallback -> IO (FunPtr C_StyleRealizeCallback)
- noStyleRealizeCallback :: Maybe StyleRealizeCallback
- onStyleRealize :: (GObject a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId
- wrap_StyleRealizeCallback :: StyleRealizeCallback -> Ptr () -> Ptr () -> IO ()
- type C_StyleUnrealizeCallback = Ptr () -> Ptr () -> IO ()
- type StyleUnrealizeCallback = IO ()
- data StyleUnrealizeSignalInfo
- afterStyleUnrealize :: (GObject a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId
- genClosure_StyleUnrealize :: StyleUnrealizeCallback -> IO Closure
- mk_StyleUnrealizeCallback :: C_StyleUnrealizeCallback -> IO (FunPtr C_StyleUnrealizeCallback)
- noStyleUnrealizeCallback :: Maybe StyleUnrealizeCallback
- onStyleUnrealize :: (GObject a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId
- wrap_StyleUnrealizeCallback :: StyleUnrealizeCallback -> Ptr () -> Ptr () -> IO ()
Exported types
GObject Style Source # | |
IsObject Style Source # | |
IsStyle Style Source # | |
((~) * info (ResolveStyleMethod t Style), MethodInfo * info Style p) => IsLabel t (Style -> p) Source # | |
((~) * info (ResolveStyleMethod t Style), MethodInfo * info Style p) => IsLabelProxy t (Style -> p) Source # | |
HasAttributeList * Style Source # | |
type AttributeList Style Source # | |
type SignalList Style Source # | |
Methods
applyDefaultBackground
styleApplyDefaultBackground :: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) => a -> Context -> b -> StateType -> Int32 -> Int32 -> Int32 -> Int32 -> m () Source #
Deprecated: (Since version 3.0)Use StyleContext
instead
No description available in the introspection data.
copy
data StyleCopyMethodInfo Source #
((~) * signature (m Style), MonadIO m, IsStyle a) => MethodInfo * StyleCopyMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsStyle a) | |
=> a |
|
-> m Style | Returns: a copy of |
Deprecated: (Since version 3.0)Use StyleContext
instead
Creates a copy of the passed in Style
object.
detach
data StyleDetachMethodInfo Source #
((~) * signature (m ()), MonadIO m, IsStyle a) => MethodInfo * StyleDetachMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsStyle a) | |
=> a |
|
-> m () |
Deprecated: (Since version 3.0)Use StyleContext
instead
Detaches a style from a window. If the style is not attached
to any windows anymore, it is unrealized. See gtk_style_attach()
.
getStyleProperty
styleGetStyleProperty Source #
:: (HasCallStack, MonadIO m, IsStyle a) | |
=> a |
|
-> GType | |
-> Text |
|
-> m GValue |
Queries the value of a style property corresponding to a widget class is in the given style.
Since: 2.16
hasContext
data StyleHasContextMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsStyle a) => MethodInfo * StyleHasContextMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsStyle a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether style
has an associated StyleContext
.
Since: 3.0
lookupColor
:: (HasCallStack, MonadIO m, IsStyle a) | |
=> a |
|
-> Text |
|
-> m (Bool, Color) | Returns: |
Deprecated: (Since version 3.0)Use styleContextLookupColor
instead
Looks up colorName
in the style’s logical color mappings,
filling in color
and returning True
if found, otherwise
returning False
. Do not cache the found mapping, because
it depends on the Style
and might change when a theme
switch occurs.
Since: 2.10
lookupIconSet
data StyleLookupIconSetMethodInfo Source #
((~) * signature (Text -> m IconSet), MonadIO m, IsStyle a) => MethodInfo * StyleLookupIconSetMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsStyle a) | |
=> a |
|
-> Text |
|
-> m IconSet | Returns: icon set of |
Deprecated: (Since version 3.0)Use styleContextLookupIconSet
instead
Looks up stockId
in the icon factories associated with style
and the default icon factory, returning an icon set if found,
otherwise Nothing
.
new
:: (HasCallStack, MonadIO m) | |
=> m Style | Returns: a new |
Deprecated: (Since version 3.0)Use StyleContext
Creates a new Style
.
renderIcon
data StyleRenderIconMethodInfo Source #
((~) * signature (IconSource -> TextDirection -> StateType -> Int32 -> Maybe b -> Maybe Text -> m Pixbuf), MonadIO m, IsStyle a, IsWidget b) => MethodInfo * StyleRenderIconMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsStyle a, IsWidget b) | |
=> a |
|
-> IconSource |
|
-> TextDirection |
|
-> StateType |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe Text |
|
-> m Pixbuf | Returns: a newly-created |
Deprecated: (Since version 3.0)Use renderIconPixbuf
instead
Renders the icon specified by source
at the given size
according to the given parameters and returns the result in a
pixbuf.
setBackground
data StyleSetBackgroundMethodInfo Source #
((~) * signature (b -> StateType -> m ()), MonadIO m, IsStyle a, IsWindow b) => MethodInfo * StyleSetBackgroundMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) | |
=> a |
|
-> b |
|
-> StateType |
|
-> m () |
Deprecated: (Since version 3.0)Use styleContextSetBackground
instead
Sets the background of window
to the background color or pixmap
specified by style
for the given state.
Properties
context
data StyleContextPropertyInfo Source #
constructStyleContext :: (IsStyle o, IsStyleContext a) => a -> IO (GValueConstruct o) Source #
getStyleContext :: (MonadIO m, IsStyle o) => o -> m (Maybe StyleContext) Source #
styleContext :: AttrLabelProxy "context" Source #
Signals
realize
type StyleRealizeCallback = IO () Source #
afterStyleRealize :: (GObject a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId Source #
onStyleRealize :: (GObject a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId Source #
wrap_StyleRealizeCallback :: StyleRealizeCallback -> Ptr () -> Ptr () -> IO () Source #
unrealize
type StyleUnrealizeCallback = IO () Source #
afterStyleUnrealize :: (GObject a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId Source #
mk_StyleUnrealizeCallback :: C_StyleUnrealizeCallback -> IO (FunPtr C_StyleUnrealizeCallback) Source #
onStyleUnrealize :: (GObject a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId Source #
wrap_StyleUnrealizeCallback :: StyleUnrealizeCallback -> Ptr () -> Ptr () -> IO () Source #