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 |
GtkNumerableIcon is a subclass of EmblemedIcon
that can
show a number or short string as an emblem. The number can
be overlayed on top of another emblem, if desired.
It supports theming by taking font and color information
from a provided StyleContext
; see
numerableIconSetStyleContext
.
Typical numerable icons:
- newtype NumerableIcon = NumerableIcon (ManagedPtr NumerableIcon)
- class GObject o => IsNumerableIcon o
- toNumerableIcon :: IsNumerableIcon o => o -> IO NumerableIcon
- noNumerableIcon :: Maybe NumerableIcon
- data NumerableIconGetBackgroundGiconMethodInfo
- numerableIconGetBackgroundGicon :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe Icon)
- data NumerableIconGetBackgroundIconNameMethodInfo
- numerableIconGetBackgroundIconName :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe Text)
- data NumerableIconGetCountMethodInfo
- numerableIconGetCount :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m Int32
- data NumerableIconGetLabelMethodInfo
- numerableIconGetLabel :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe Text)
- data NumerableIconGetStyleContextMethodInfo
- numerableIconGetStyleContext :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe StyleContext)
- numerableIconNew :: (HasCallStack, MonadIO m, IsIcon a) => a -> m Icon
- numerableIconNewWithStyleContext :: (HasCallStack, MonadIO m, IsIcon a, IsStyleContext b) => a -> b -> m Icon
- data NumerableIconSetBackgroundGiconMethodInfo
- numerableIconSetBackgroundGicon :: (HasCallStack, MonadIO m, IsNumerableIcon a, IsIcon b) => a -> Maybe b -> m ()
- data NumerableIconSetBackgroundIconNameMethodInfo
- numerableIconSetBackgroundIconName :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> Maybe Text -> m ()
- data NumerableIconSetCountMethodInfo
- numerableIconSetCount :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> Int32 -> m ()
- data NumerableIconSetLabelMethodInfo
- numerableIconSetLabel :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> Maybe Text -> m ()
- data NumerableIconSetStyleContextMethodInfo
- numerableIconSetStyleContext :: (HasCallStack, MonadIO m, IsNumerableIcon a, IsStyleContext b) => a -> b -> m ()
- data NumerableIconBackgroundIconPropertyInfo
- clearNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m ()
- constructNumerableIconBackgroundIcon :: (IsNumerableIcon o, IsIcon a) => a -> IO (GValueConstruct o)
- getNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Icon)
- numerableIconBackgroundIcon :: AttrLabelProxy "backgroundIcon"
- setNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o, IsIcon a) => o -> a -> m ()
- data NumerableIconBackgroundIconNamePropertyInfo
- clearNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m ()
- constructNumerableIconBackgroundIconName :: IsNumerableIcon o => Text -> IO (GValueConstruct o)
- getNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text)
- numerableIconBackgroundIconName :: AttrLabelProxy "backgroundIconName"
- setNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m ()
- data NumerableIconCountPropertyInfo
- constructNumerableIconCount :: IsNumerableIcon o => Int32 -> IO (GValueConstruct o)
- getNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> m Int32
- numerableIconCount :: AttrLabelProxy "count"
- setNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> Int32 -> m ()
- data NumerableIconLabelPropertyInfo
- clearNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m ()
- constructNumerableIconLabel :: IsNumerableIcon o => Text -> IO (GValueConstruct o)
- getNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text)
- numerableIconLabel :: AttrLabelProxy "label"
- setNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m ()
- data NumerableIconStyleContextPropertyInfo
- constructNumerableIconStyleContext :: (IsNumerableIcon o, IsStyleContext a) => a -> IO (GValueConstruct o)
- getNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe StyleContext)
- numerableIconStyleContext :: AttrLabelProxy "styleContext"
- setNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o, IsStyleContext a) => o -> a -> m ()
Exported types
newtype NumerableIcon Source #
GObject NumerableIcon Source # | |
IsEmblemedIcon NumerableIcon Source # | |
IsIcon NumerableIcon Source # | |
IsObject NumerableIcon Source # | |
IsNumerableIcon NumerableIcon Source # | |
((~) * info (ResolveNumerableIconMethod t NumerableIcon), MethodInfo * info NumerableIcon p) => IsLabel t (NumerableIcon -> p) Source # | |
((~) * info (ResolveNumerableIconMethod t NumerableIcon), MethodInfo * info NumerableIcon p) => IsLabelProxy t (NumerableIcon -> p) Source # | |
HasAttributeList * NumerableIcon Source # | |
type AttributeList NumerableIcon Source # | |
type SignalList NumerableIcon Source # | |
class GObject o => IsNumerableIcon o Source #
toNumerableIcon :: IsNumerableIcon o => o -> IO NumerableIcon Source #
Methods
getBackgroundGicon
data NumerableIconGetBackgroundGiconMethodInfo Source #
((~) * signature (m (Maybe Icon)), MonadIO m, IsNumerableIcon a) => MethodInfo * NumerableIconGetBackgroundGiconMethodInfo a signature Source # | |
numerableIconGetBackgroundGicon Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a) | |
=> a |
|
-> m (Maybe Icon) |
getBackgroundIconName
data NumerableIconGetBackgroundIconNameMethodInfo Source #
((~) * signature (m (Maybe Text)), MonadIO m, IsNumerableIcon a) => MethodInfo * NumerableIconGetBackgroundIconNameMethodInfo a signature Source # | |
numerableIconGetBackgroundIconName Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a) | |
=> a |
|
-> m (Maybe Text) | Returns: an icon name, or |
Deprecated: (Since version 3.14)
Returns the icon name used as the base background image,
or Nothing
if there’s none.
Since: 3.0
getCount
data NumerableIconGetCountMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsNumerableIcon a) => MethodInfo * NumerableIconGetCountMethodInfo a signature Source # | |
numerableIconGetCount Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a) | |
=> a |
|
-> m Int32 | Returns: the currently displayed value |
Deprecated: (Since version 3.14)
Returns the value currently displayed by self
.
Since: 3.0
getLabel
data NumerableIconGetLabelMethodInfo Source #
((~) * signature (m (Maybe Text)), MonadIO m, IsNumerableIcon a) => MethodInfo * NumerableIconGetLabelMethodInfo a signature Source # | |
numerableIconGetLabel Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a) | |
=> a |
|
-> m (Maybe Text) | Returns: the currently displayed label |
Deprecated: (Since version 3.14)
Returns the currently displayed label of the icon, or Nothing
.
Since: 3.0
getStyleContext
data NumerableIconGetStyleContextMethodInfo Source #
((~) * signature (m (Maybe StyleContext)), MonadIO m, IsNumerableIcon a) => MethodInfo * NumerableIconGetStyleContextMethodInfo a signature Source # | |
numerableIconGetStyleContext Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a) | |
=> a |
|
-> m (Maybe StyleContext) | Returns: a |
Deprecated: (Since version 3.14)
Returns the StyleContext
used by the icon for theming,
or Nothing
if there’s none.
Since: 3.0
new
newWithStyleContext
numerableIconNewWithStyleContext Source #
:: (HasCallStack, MonadIO m, IsIcon a, IsStyleContext b) | |
=> a |
|
-> b |
|
-> m Icon | Returns: a new |
Deprecated: (Since version 3.14)
Creates a new NumerableIcon
which will themed according
to the passed StyleContext
. This is a convenience constructor
that calls numerableIconSetStyleContext
internally.
Since: 3.0
setBackgroundGicon
data NumerableIconSetBackgroundGiconMethodInfo Source #
((~) * signature (Maybe b -> m ()), MonadIO m, IsNumerableIcon a, IsIcon b) => MethodInfo * NumerableIconSetBackgroundGiconMethodInfo a signature Source # | |
numerableIconSetBackgroundGicon Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a, IsIcon b) | |
=> a |
|
-> Maybe b | |
-> m () |
Deprecated: (Since version 3.14)
Updates the icon to use icon
as the base background image.
If icon
is Nothing
, self
will go back using style information
or default theming for its background image.
If this method is called and an icon name was already set as
background for the icon, icon
will be used, i.e. the last method
called between numerableIconSetBackgroundGicon
and
numerableIconSetBackgroundIconName
has always priority.
Since: 3.0
setBackgroundIconName
data NumerableIconSetBackgroundIconNameMethodInfo Source #
((~) * signature (Maybe Text -> m ()), MonadIO m, IsNumerableIcon a) => MethodInfo * NumerableIconSetBackgroundIconNameMethodInfo a signature Source # | |
numerableIconSetBackgroundIconName Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Deprecated: (Since version 3.14)
Updates the icon to use the icon named iconName
from the
current icon theme as the base background image. If iconName
is Nothing
, self
will go back using style information or default
theming for its background image.
If this method is called and a Icon
was already set as
background for the icon, iconName
will be used, i.e. the
last method called between numerableIconSetBackgroundIconName
and numerableIconSetBackgroundGicon
has always priority.
Since: 3.0
setCount
data NumerableIconSetCountMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsNumerableIcon a) => MethodInfo * NumerableIconSetCountMethodInfo a signature Source # | |
numerableIconSetCount Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a) | |
=> a |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 3.14)
Sets the currently displayed value of self
to count
.
The numeric value is always clamped to make it two digits, i.e.
between -99 and 99. Setting a count of zero removes the emblem.
If this method is called, and a label was already set on the icon,
it will automatically be reset to Nothing
before rendering the number,
i.e. the last method called between numerableIconSetCount
and numerableIconSetLabel
has always priority.
Since: 3.0
setLabel
data NumerableIconSetLabelMethodInfo Source #
((~) * signature (Maybe Text -> m ()), MonadIO m, IsNumerableIcon a) => MethodInfo * NumerableIconSetLabelMethodInfo a signature Source # | |
numerableIconSetLabel Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Deprecated: (Since version 3.14)
Sets the currently displayed value of self
to the string
in label
. Setting an empty label removes the emblem.
Note that this is meant for displaying short labels, such as roman numbers, or single letters. For roman numbers, consider using the Unicode characters U+2160 - U+217F. Strings longer than two characters will likely not be rendered very well.
If this method is called, and a number was already set on the
icon, it will automatically be reset to zero before rendering
the label, i.e. the last method called between
numerableIconSetLabel
and numerableIconSetCount
has always priority.
Since: 3.0
setStyleContext
data NumerableIconSetStyleContextMethodInfo Source #
((~) * signature (b -> m ()), MonadIO m, IsNumerableIcon a, IsStyleContext b) => MethodInfo * NumerableIconSetStyleContextMethodInfo a signature Source # | |
numerableIconSetStyleContext Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a, IsStyleContext b) | |
=> a |
|
-> b |
|
-> m () |
Deprecated: (Since version 3.14)
Updates the icon to fetch theme information from the
given StyleContext
.
Since: 3.0
Properties
backgroundIcon
data NumerableIconBackgroundIconPropertyInfo Source #
clearNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m () Source #
constructNumerableIconBackgroundIcon :: (IsNumerableIcon o, IsIcon a) => a -> IO (GValueConstruct o) Source #
getNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Icon) Source #
numerableIconBackgroundIcon :: AttrLabelProxy "backgroundIcon" Source #
setNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o, IsIcon a) => o -> a -> m () Source #
backgroundIconName
data NumerableIconBackgroundIconNamePropertyInfo Source #
clearNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m () Source #
constructNumerableIconBackgroundIconName :: IsNumerableIcon o => Text -> IO (GValueConstruct o) Source #
getNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text) Source #
numerableIconBackgroundIconName :: AttrLabelProxy "backgroundIconName" Source #
setNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m () Source #
count
data NumerableIconCountPropertyInfo Source #
constructNumerableIconCount :: IsNumerableIcon o => Int32 -> IO (GValueConstruct o) Source #
getNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> m Int32 Source #
numerableIconCount :: AttrLabelProxy "count" Source #
setNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> Int32 -> m () Source #
label
data NumerableIconLabelPropertyInfo Source #
clearNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m () Source #
constructNumerableIconLabel :: IsNumerableIcon o => Text -> IO (GValueConstruct o) Source #
getNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text) Source #
numerableIconLabel :: AttrLabelProxy "label" Source #
setNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m () Source #
styleContext
data NumerableIconStyleContextPropertyInfo Source #
constructNumerableIconStyleContext :: (IsNumerableIcon o, IsStyleContext a) => a -> IO (GValueConstruct o) Source #
getNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe StyleContext) Source #
numerableIconStyleContext :: AttrLabelProxy "styleContext" Source #
setNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o, IsStyleContext a) => o -> a -> m () Source #