| 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 |
GI.Gtk.Objects.Style
Contents
Description
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 :: (MonadIO m, IsStyle o) => o -> m Style
- noStyle :: Maybe Style
- styleApplyDefaultBackground :: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) => a -> Context -> b -> StateType -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- styleCopy :: (HasCallStack, MonadIO m, IsStyle a) => a -> m Style
- styleDetach :: (HasCallStack, MonadIO m, IsStyle a) => a -> m ()
- styleGetStyleProperty :: (HasCallStack, MonadIO m, IsStyle a) => a -> GType -> Text -> m GValue
- styleHasContext :: (HasCallStack, MonadIO m, IsStyle a) => a -> m Bool
- styleLookupColor :: (HasCallStack, MonadIO m, IsStyle a) => a -> Text -> m (Bool, Color)
- styleLookupIconSet :: (HasCallStack, MonadIO m, IsStyle a) => a -> Text -> m IconSet
- styleNew :: (HasCallStack, MonadIO m) => m Style
- styleRenderIcon :: (HasCallStack, MonadIO m, IsStyle a, IsWidget b) => a -> IconSource -> TextDirection -> StateType -> Int32 -> Maybe b -> Maybe Text -> m Pixbuf
- styleSetBackground :: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) => a -> b -> StateType -> m ()
- constructStyleContext :: (IsStyle o, IsStyleContext a) => a -> IO (GValueConstruct o)
- getStyleContext :: (MonadIO m, IsStyle o) => o -> m (Maybe StyleContext)
- type C_StyleRealizeCallback = Ptr () -> Ptr () -> IO ()
- type StyleRealizeCallback = IO ()
- afterStyleRealize :: (IsStyle a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId
- genClosure_StyleRealize :: StyleRealizeCallback -> IO Closure
- mk_StyleRealizeCallback :: C_StyleRealizeCallback -> IO (FunPtr C_StyleRealizeCallback)
- noStyleRealizeCallback :: Maybe StyleRealizeCallback
- onStyleRealize :: (IsStyle a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId
- wrap_StyleRealizeCallback :: StyleRealizeCallback -> Ptr () -> Ptr () -> IO ()
- type C_StyleUnrealizeCallback = Ptr () -> Ptr () -> IO ()
- type StyleUnrealizeCallback = IO ()
- afterStyleUnrealize :: (IsStyle a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId
- genClosure_StyleUnrealize :: StyleUnrealizeCallback -> IO Closure
- mk_StyleUnrealizeCallback :: C_StyleUnrealizeCallback -> IO (FunPtr C_StyleUnrealizeCallback)
- noStyleUnrealizeCallback :: Maybe StyleUnrealizeCallback
- onStyleUnrealize :: (IsStyle a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId
- wrap_StyleUnrealizeCallback :: StyleUnrealizeCallback -> Ptr () -> Ptr () -> IO ()
Exported types
Constructors
| Style (ManagedPtr Style) |
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
Arguments
| :: (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
Arguments
| :: (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 #
Arguments
| :: (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
Arguments
| :: (HasCallStack, MonadIO m, IsStyle a) | |
| => a |
|
| -> m Bool | Returns: |
Returns whether style has an associated StyleContext.
Since: 3.0
lookupColor
Arguments
| :: (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
Arguments
| :: (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
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Style | Returns: a new |
Deprecated: (Since version 3.0)Use StyleContext
Creates a new Style.
renderIcon
Arguments
| :: (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
Arguments
| :: (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
constructStyleContext :: (IsStyle o, IsStyleContext a) => a -> IO (GValueConstruct o) Source #
getStyleContext :: (MonadIO m, IsStyle o) => o -> m (Maybe StyleContext) Source #
Signals
realize
type StyleRealizeCallback = IO () Source #
afterStyleRealize :: (IsStyle a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId Source #
onStyleRealize :: (IsStyle a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId Source #
wrap_StyleRealizeCallback :: StyleRealizeCallback -> Ptr () -> Ptr () -> IO () Source #
unrealize
type StyleUnrealizeCallback = IO () Source #
afterStyleUnrealize :: (IsStyle a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId Source #
mk_StyleUnrealizeCallback :: C_StyleUnrealizeCallback -> IO (FunPtr C_StyleUnrealizeCallback) Source #
onStyleUnrealize :: (IsStyle a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId Source #
wrap_StyleUnrealizeCallback :: StyleUnrealizeCallback -> Ptr () -> Ptr () -> IO () Source #