Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
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:
Synopsis
- newtype NumerableIcon = NumerableIcon (ManagedPtr NumerableIcon)
- class (GObject o, IsDescendantOf NumerableIcon o) => IsNumerableIcon o
- toNumerableIcon :: (MonadIO m, IsNumerableIcon o) => o -> m NumerableIcon
- numerableIconGetBackgroundGicon :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe Icon)
- numerableIconGetBackgroundIconName :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe Text)
- numerableIconGetCount :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m Int32
- numerableIconGetLabel :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe Text)
- 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
- numerableIconSetBackgroundGicon :: (HasCallStack, MonadIO m, IsNumerableIcon a, IsIcon b) => a -> Maybe b -> m ()
- numerableIconSetBackgroundIconName :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> Maybe Text -> m ()
- numerableIconSetCount :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> Int32 -> m ()
- numerableIconSetLabel :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> Maybe Text -> m ()
- numerableIconSetStyleContext :: (HasCallStack, MonadIO m, IsNumerableIcon a, IsStyleContext b) => a -> b -> m ()
- clearNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m ()
- constructNumerableIconBackgroundIcon :: (IsNumerableIcon o, MonadIO m, IsIcon a) => a -> m (GValueConstruct o)
- getNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Icon)
- setNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o, IsIcon a) => o -> a -> m ()
- clearNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m ()
- constructNumerableIconBackgroundIconName :: (IsNumerableIcon o, MonadIO m) => Text -> m (GValueConstruct o)
- getNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text)
- setNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m ()
- constructNumerableIconCount :: (IsNumerableIcon o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> m Int32
- setNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> Int32 -> m ()
- clearNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m ()
- constructNumerableIconLabel :: (IsNumerableIcon o, MonadIO m) => Text -> m (GValueConstruct o)
- getNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text)
- setNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m ()
- constructNumerableIconStyleContext :: (IsNumerableIcon o, MonadIO m, IsStyleContext a) => a -> m (GValueConstruct o)
- getNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe StyleContext)
- setNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o, IsStyleContext a) => o -> a -> m ()
Exported types
newtype NumerableIcon Source #
Memory-managed wrapper type.
NumerableIcon (ManagedPtr NumerableIcon) |
Instances
Eq NumerableIcon Source # | |
Defined in GI.Gtk.Objects.NumerableIcon (==) :: NumerableIcon -> NumerableIcon -> Bool # (/=) :: NumerableIcon -> NumerableIcon -> Bool # | |
GObject NumerableIcon Source # | |
Defined in GI.Gtk.Objects.NumerableIcon | |
ManagedPtrNewtype NumerableIcon Source # | |
Defined in GI.Gtk.Objects.NumerableIcon toManagedPtr :: NumerableIcon -> ManagedPtr NumerableIcon | |
TypedObject NumerableIcon Source # | |
Defined in GI.Gtk.Objects.NumerableIcon | |
HasParentTypes NumerableIcon Source # | |
Defined in GI.Gtk.Objects.NumerableIcon | |
IsGValue (Maybe NumerableIcon) Source # | Convert |
Defined in GI.Gtk.Objects.NumerableIcon gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe NumerableIcon -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe NumerableIcon) | |
type ParentTypes NumerableIcon Source # | |
Defined in GI.Gtk.Objects.NumerableIcon |
class (GObject o, IsDescendantOf NumerableIcon o) => IsNumerableIcon o Source #
Type class for types which can be safely cast to NumerableIcon
, for instance with toNumerableIcon
.
Instances
(GObject o, IsDescendantOf NumerableIcon o) => IsNumerableIcon o Source # | |
Defined in GI.Gtk.Objects.NumerableIcon |
toNumerableIcon :: (MonadIO m, IsNumerableIcon o) => o -> m NumerableIcon Source #
Cast to NumerableIcon
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
addEmblem, bindProperty, bindPropertyFull, clearEmblems, equal, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, serialize, stealData, stealQdata, thawNotify, toString, unref, watchClosure.
Getters
getBackgroundGicon, getBackgroundIconName, getCount, getData, getEmblems, getIcon, getLabel, getProperty, getQdata, getStyleContext.
Setters
setBackgroundGicon, setBackgroundIconName, setCount, setData, setDataFull, setLabel, setProperty, setStyleContext.
getBackgroundGicon
numerableIconGetBackgroundGicon Source #
:: (HasCallStack, MonadIO m, IsNumerableIcon a) | |
=> a |
|
-> m (Maybe Icon) |
getBackgroundIconName
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
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
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
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
:: (HasCallStack, MonadIO m, IsIcon a) | |
=> a |
|
-> m Icon | Returns: a 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
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
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
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
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
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
No description available in the introspection data.
clearNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m () Source #
Set the value of the “background-icon
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#backgroundIcon
constructNumerableIconBackgroundIcon :: (IsNumerableIcon o, MonadIO m, IsIcon a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “background-icon
” property. This is rarely needed directly, but it is used by new
.
getNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Icon) Source #
Get the value of the “background-icon
” property.
When overloading is enabled, this is equivalent to
get
numerableIcon #backgroundIcon
setNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o, IsIcon a) => o -> a -> m () Source #
Set the value of the “background-icon
” property.
When overloading is enabled, this is equivalent to
set
numerableIcon [ #backgroundIcon:=
value ]
backgroundIconName
No description available in the introspection data.
clearNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m () Source #
Set the value of the “background-icon-name
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#backgroundIconName
constructNumerableIconBackgroundIconName :: (IsNumerableIcon o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “background-icon-name
” property. This is rarely needed directly, but it is used by new
.
getNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text) Source #
Get the value of the “background-icon-name
” property.
When overloading is enabled, this is equivalent to
get
numerableIcon #backgroundIconName
setNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m () Source #
Set the value of the “background-icon-name
” property.
When overloading is enabled, this is equivalent to
set
numerableIcon [ #backgroundIconName:=
value ]
count
No description available in the introspection data.
constructNumerableIconCount :: (IsNumerableIcon o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “count
” property. This is rarely needed directly, but it is used by new
.
getNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> m Int32 Source #
Get the value of the “count
” property.
When overloading is enabled, this is equivalent to
get
numerableIcon #count
setNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> Int32 -> m () Source #
Set the value of the “count
” property.
When overloading is enabled, this is equivalent to
set
numerableIcon [ #count:=
value ]
label
No description available in the introspection data.
clearNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m () Source #
Set the value of the “label
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#label
constructNumerableIconLabel :: (IsNumerableIcon o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “label
” property. This is rarely needed directly, but it is used by new
.
getNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text) Source #
Get the value of the “label
” property.
When overloading is enabled, this is equivalent to
get
numerableIcon #label
setNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m () Source #
Set the value of the “label
” property.
When overloading is enabled, this is equivalent to
set
numerableIcon [ #label:=
value ]
styleContext
No description available in the introspection data.
constructNumerableIconStyleContext :: (IsNumerableIcon o, MonadIO m, IsStyleContext a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “style-context
” property. This is rarely needed directly, but it is used by new
.
getNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe StyleContext) Source #
Get the value of the “style-context
” property.
When overloading is enabled, this is equivalent to
get
numerableIcon #styleContext
setNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o, IsStyleContext a) => o -> a -> m () Source #
Set the value of the “style-context
” property.
When overloading is enabled, this is equivalent to
set
numerableIcon [ #styleContext:=
value ]