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 |
ThemedIcon
is an implementation of Icon
that supports icon themes.
ThemedIcon
contains a list of all of the icons present in an icon
theme, so that icons can be looked up quickly. ThemedIcon
does
not provide actual pixmaps for icons, just the icon names.
Ideally something like gtk_icon_theme_choose_icon()
should be used to
resolve the list of names so that fallback icons work nicely with
themes that inherit other themes.
- newtype ThemedIcon = ThemedIcon (ManagedPtr ThemedIcon)
- class GObject o => IsThemedIcon o
- toThemedIcon :: (MonadIO m, IsThemedIcon o) => o -> m ThemedIcon
- noThemedIcon :: Maybe ThemedIcon
- themedIconAppendName :: (HasCallStack, MonadIO m, IsThemedIcon a) => a -> Text -> m ()
- themedIconGetNames :: (HasCallStack, MonadIO m, IsThemedIcon a) => a -> m [Text]
- themedIconNew :: (HasCallStack, MonadIO m) => Text -> m ThemedIcon
- themedIconNewFromNames :: (HasCallStack, MonadIO m) => [Text] -> m ThemedIcon
- themedIconNewWithDefaultFallbacks :: (HasCallStack, MonadIO m) => Text -> m ThemedIcon
- themedIconPrependName :: (HasCallStack, MonadIO m, IsThemedIcon a) => a -> Text -> m ()
- constructThemedIconName :: IsThemedIcon o => Text -> IO (GValueConstruct o)
- constructThemedIconNames :: IsThemedIcon o => [Text] -> IO (GValueConstruct o)
- getThemedIconNames :: (MonadIO m, IsThemedIcon o) => o -> m [Text]
- constructThemedIconUseDefaultFallbacks :: IsThemedIcon o => Bool -> IO (GValueConstruct o)
- getThemedIconUseDefaultFallbacks :: (MonadIO m, IsThemedIcon o) => o -> m Bool
Exported types
newtype ThemedIcon Source #
class GObject o => IsThemedIcon o Source #
toThemedIcon :: (MonadIO m, IsThemedIcon o) => o -> m ThemedIcon Source #
Methods
appendName
:: (HasCallStack, MonadIO m, IsThemedIcon a) | |
=> a |
|
-> Text |
|
-> m () |
Append a name to the list of icons from within icon
.
Note that doing so invalidates the hash computed by prior calls
to iconHash
.
getNames
:: (HasCallStack, MonadIO m, IsThemedIcon a) | |
=> a |
|
-> m [Text] | Returns: a list of icon names. |
Gets the names of icons from within icon
.
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m ThemedIcon | Returns: a new |
Creates a new themed icon for iconname
.
newFromNames
themedIconNewFromNames Source #
:: (HasCallStack, MonadIO m) | |
=> [Text] |
|
-> m ThemedIcon | Returns: a new |
Creates a new themed icon for iconnames
.
newWithDefaultFallbacks
themedIconNewWithDefaultFallbacks Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m ThemedIcon | Returns: a new |
Creates a new themed icon for iconname
, and all the names
that can be created by shortening iconname
at '-' characters.
In the following example, icon1
and icon2
are equivalent:
C code
const char *names[] = { "gnome-dev-cdrom-audio", "gnome-dev-cdrom", "gnome-dev", "gnome" }; icon1 = g_themed_icon_new_from_names (names, 4); icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
prependName
themedIconPrependName Source #
:: (HasCallStack, MonadIO m, IsThemedIcon a) | |
=> a |
|
-> Text |
|
-> m () |
Prepend a name to the list of icons from within icon
.
Note that doing so invalidates the hash computed by prior calls
to iconHash
.
Since: 2.18
Properties
name
constructThemedIconName :: IsThemedIcon o => Text -> IO (GValueConstruct o) Source #
names
constructThemedIconNames :: IsThemedIcon o => [Text] -> IO (GValueConstruct o) Source #
getThemedIconNames :: (MonadIO m, IsThemedIcon o) => o -> m [Text] Source #
useDefaultFallbacks
constructThemedIconUseDefaultFallbacks :: IsThemedIcon o => Bool -> IO (GValueConstruct o) Source #
getThemedIconUseDefaultFallbacks :: (MonadIO m, IsThemedIcon o) => o -> m Bool Source #