gtkmm 3.24.7
|
A Gio::Icon that allows numbered emblems. More...
#include <gtkmm/numerableicon.h>
Inherits Gio::EmblemedIcon.
Public Member Functions | |
NumerableIcon (NumerableIcon && src) noexcept | |
NumerableIcon & | operator= (NumerableIcon && src) noexcept |
~NumerableIcon () noexcept override | |
GtkNumerableIcon * | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkNumerableIcon * | gobj () const |
Provides access to the underlying C GObject. More... | |
GtkNumerableIcon * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
Glib::RefPtr< StyleContext > | get_style_context () |
Returns the Gtk::StyleContext used by the icon for theming, or nullptr if there’s none. More... | |
Glib::RefPtr< const StyleContext > | get_style_context () const |
Returns the Gtk::StyleContext used by the icon for theming, or nullptr if there’s none. More... | |
void | set_style_context (const Glib::RefPtr< StyleContext > & style) |
Updates the icon to fetch theme information from the given Gtk::StyleContext. More... | |
int | get_count () const |
Returns the value currently displayed by self. More... | |
void | set_count (int count) |
Sets the currently displayed value of self to count. More... | |
Glib::ustring | get_label () const |
Returns the currently displayed label of the icon, or nullptr . More... | |
void | set_label (const Glib::ustring & label) |
Sets the currently displayed value of self to the string in label. More... | |
void | set_background_gicon (const Glib::RefPtr< Gio::Icon > & icon) |
Updates the icon to use icon as the base background image. More... | |
Glib::RefPtr< Gio::Icon > | get_background_gicon () |
Returns the Gio::Icon that was set as the base background image, or nullptr if there’s none. More... | |
Glib::RefPtr< const Gio::Icon > | get_background_gicon () const |
Returns the Gio::Icon that was set as the base background image, or nullptr if there’s none. More... | |
void | set_background_icon_name (const Glib::ustring & icon_name) |
Updates the icon to use the icon named icon_name from the current icon theme as the base background image. More... | |
Glib::ustring | get_background_icon_name () const |
Returns the icon name used as the base background image, or nullptr if there’s none. More... | |
Glib::PropertyProxy< int > | property_count () |
The count of the emblem currently displayed. More... | |
Glib::PropertyProxy_ReadOnly< int > | property_count () const |
The count of the emblem currently displayed. More... | |
Glib::PropertyProxy< Glib::ustring > | property_label () |
The label to be displayed over the icon. More... | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_label () const |
The label to be displayed over the icon. More... | |
Glib::PropertyProxy< Glib::RefPtr< StyleContext > > | property_style_context () |
The style context to theme the icon appearance. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< StyleContext > > | property_style_context () const |
The style context to theme the icon appearance. More... | |
Glib::PropertyProxy< Glib::RefPtr< Gio::Icon > > | property_background_icon () |
The icon for the number emblem background. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gio::Icon > > | property_background_icon () const |
The icon for the number emblem background. More... | |
Glib::PropertyProxy< Glib::ustring > | property_background_icon_name () |
The icon name for the number emblem background. More... | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_background_icon_name () const |
The icon name for the number emblem background. More... | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static Glib::RefPtr< NumerableIcon > | create (const Glib::RefPtr< Gio::Icon > & icon) |
static Glib::RefPtr< NumerableIcon > | create (const Glib::RefPtr< Gio::Icon > & icon, const Glib::RefPtr< StyleContext > & context) |
Protected Member Functions | |
NumerableIcon (const Glib::RefPtr< Gio::Icon > & icon) | |
NumerableIcon (const Glib::RefPtr< Gio::Icon > & icon, const Glib::RefPtr< StyleContext > & style_context) | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gtk::NumerableIcon > | wrap (GtkNumerableIcon * object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
A Gio::Icon that allows numbered emblems.
Gtk::NumerableIcon is a subclass of Gio::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 set_style_context().
|
noexcept |
|
overridenoexcept |
|
explicitprotected |
|
explicitprotected |
|
static |
|
static |
Glib::RefPtr< Gio::Icon > Gtk::NumerableIcon::get_background_gicon | ( | ) |
Returns the Gio::Icon that was set as the base background image, or nullptr
if there’s none.
The caller of this function does not own a reference to the returned Gio::Icon.
Deprecated: 3.14
nullptr
. Glib::RefPtr< const Gio::Icon > Gtk::NumerableIcon::get_background_gicon | ( | ) | const |
Returns the Gio::Icon that was set as the base background image, or nullptr
if there’s none.
The caller of this function does not own a reference to the returned Gio::Icon.
Deprecated: 3.14
nullptr
. Glib::ustring Gtk::NumerableIcon::get_background_icon_name | ( | ) | const |
Returns the icon name used as the base background image, or nullptr
if there’s none.
Deprecated: 3.14
nullptr
. int Gtk::NumerableIcon::get_count | ( | ) | const |
Returns the value currently displayed by self.
Deprecated: 3.14
Glib::ustring Gtk::NumerableIcon::get_label | ( | ) | const |
Returns the currently displayed label of the icon, or nullptr
.
Deprecated: 3.14
Glib::RefPtr< StyleContext > Gtk::NumerableIcon::get_style_context | ( | ) |
Returns the Gtk::StyleContext used by the icon for theming, or nullptr
if there’s none.
Deprecated: 3.14
nullptr
. This object is internal to GTK+ and should not be unreffed. Use Glib::object_ref() if you want to keep it around. Glib::RefPtr< const StyleContext > Gtk::NumerableIcon::get_style_context | ( | ) | const |
Returns the Gtk::StyleContext used by the icon for theming, or nullptr
if there’s none.
Deprecated: 3.14
nullptr
. This object is internal to GTK+ and should not be unreffed. Use Glib::object_ref() if you want to keep it around.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkNumerableIcon * Gtk::NumerableIcon::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
noexcept |
Glib::PropertyProxy< Glib::RefPtr< Gio::Icon > > Gtk::NumerableIcon::property_background_icon | ( | ) |
The icon for the number emblem background.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gio::Icon > > Gtk::NumerableIcon::property_background_icon | ( | ) | const |
The icon for the number emblem background.
Glib::PropertyProxy< Glib::ustring > Gtk::NumerableIcon::property_background_icon_name | ( | ) |
The icon name for the number emblem background.
Default value: ""
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::NumerableIcon::property_background_icon_name | ( | ) | const |
The icon name for the number emblem background.
Default value: ""
Glib::PropertyProxy< int > Gtk::NumerableIcon::property_count | ( | ) |
The count of the emblem currently displayed.
Default value: 0
Glib::PropertyProxy_ReadOnly< int > Gtk::NumerableIcon::property_count | ( | ) | const |
The count of the emblem currently displayed.
Default value: 0
Glib::PropertyProxy< Glib::ustring > Gtk::NumerableIcon::property_label | ( | ) |
The label to be displayed over the icon.
Default value: ""
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::NumerableIcon::property_label | ( | ) | const |
The label to be displayed over the icon.
Default value: ""
Glib::PropertyProxy< Glib::RefPtr< StyleContext > > Gtk::NumerableIcon::property_style_context | ( | ) |
The style context to theme the icon appearance.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< StyleContext > > Gtk::NumerableIcon::property_style_context | ( | ) | const |
The style context to theme the icon appearance.
void Gtk::NumerableIcon::set_background_gicon | ( | const Glib::RefPtr< Gio::Icon > & | icon | ) |
Updates the icon to use icon as the base background image.
If icon is nullptr
, 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 set_background_gicon() and set_background_icon_name() has always priority.
Deprecated: 3.14
icon | A Gio::Icon, or nullptr . |
void Gtk::NumerableIcon::set_background_icon_name | ( | const Glib::ustring & | icon_name | ) |
Updates the icon to use the icon named icon_name from the current icon theme as the base background image.
If icon_name is nullptr
, self will go back using style information or default theming for its background image.
If this method is called and a Gio::Icon was already set as background for the icon, icon_name will be used, i.e. the last method called between set_background_icon_name() and set_background_gicon() has always priority.
Deprecated: 3.14
icon_name | An icon name, or nullptr . |
void Gtk::NumerableIcon::set_count | ( | int | count | ) |
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 nullptr
before rendering the number, i.e. the last method called between set_count() and set_label() has always priority.
Deprecated: 3.14
count | A number between -99 and 99. |
void Gtk::NumerableIcon::set_label | ( | const Glib::ustring & | label | ) |
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 set_label() and set_count() has always priority.
Deprecated: 3.14
label | A short label, or nullptr . |
void Gtk::NumerableIcon::set_style_context | ( | const Glib::RefPtr< StyleContext > & | style | ) |
Updates the icon to fetch theme information from the given Gtk::StyleContext.
Deprecated: 3.14
style | A Gtk::StyleContext. |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |