Represents registered icon sizes.
More...
#include <gtkmm/enums.h>
|
static bool | lookup (IconSize size, int & width, int & height) |
| Obtains the pixel size of a semantic icon size, possibly modified by user preferences for the default Gtk::Settings. More...
|
|
static bool | lookup (IconSize size, int & width, int & height, const Glib::RefPtr< Gtk::Settings > & settings) |
| Obtains the pixel size of a semantic icon size, possibly modified by user preferences for a particular Gtk::Settings. More...
|
|
static IconSize | register_new (const Glib::ustring & name, int width, int height) |
| Registers a new icon size, along the same lines as ICON_SIZE_MENU, etc. More...
|
|
static void | register_alias (const Glib::ustring & alias, IconSize target) |
| Registers alias as another name for target so calling from_name() with alias as argument will return target. More...
|
|
static IconSize | from_name (const Glib::ustring & name) |
| Looks up the icon size associated with name. More...
|
|
static Glib::ustring | get_name (IconSize size) |
| Gets the canonical name of the given icon size. More...
|
|
Represents registered icon sizes.
You can also use a Gtk::BuiltinIconSize instead of an IconSize.
◆ IconSize() [1/3]
Gtk::IconSize::IconSize |
( |
| ) |
|
|
inline |
◆ IconSize() [2/3]
◆ IconSize() [3/3]
Gtk::IconSize::IconSize |
( |
int |
size | ) |
|
|
inlineexplicit |
◆ from_name()
static IconSize Gtk::IconSize::from_name |
( |
const Glib::ustring & |
name | ) |
|
|
static |
Looks up the icon size associated with name.
- Parameters
-
- Returns
- The icon size with the given name.
- Deprecated:
- Use Gtk::IconTheme instead.
◆ get_name()
static Glib::ustring Gtk::IconSize::get_name |
( |
IconSize |
size | ) |
|
|
static |
Gets the canonical name of the given icon size.
- Parameters
-
- Returns
- The name of the given icon size.
- Deprecated:
- Use Gtk::IconTheme instead.
◆ lookup() [1/2]
static bool Gtk::IconSize::lookup |
( |
IconSize |
size, |
|
|
int & |
width, |
|
|
int & |
height |
|
) |
| |
|
static |
Obtains the pixel size of a semantic icon size, possibly modified by user preferences for the default Gtk::Settings.
Normally size would be Gtk::ICON_SIZE_MENU, Gtk::ICON_SIZE_BUTTON, etc. This function isn't normally needed because Gtk::Widget::render_icon() is the usual way to get an icon for rendering - then just look at the size of the rendered pixbuf. The rendered pixbuf may not even correspond to the width/height returned by IconSize::lookup(), because themes are free to render the pixbuf however they like, including changing the usual size.
- Parameters
-
size | An icon size. |
width | Location to store icon width. |
height | Location to store icon height. |
- Returns
- true if size was a valid size.
◆ lookup() [2/2]
static bool Gtk::IconSize::lookup |
( |
IconSize |
size, |
|
|
int & |
width, |
|
|
int & |
height, |
|
|
const Glib::RefPtr< Gtk::Settings > & |
settings |
|
) |
| |
|
static |
Obtains the pixel size of a semantic icon size, possibly modified by user preferences for a particular Gtk::Settings.
Normally size would be Gtk::ICON_SIZE_MENU, Gtk::ICON_SIZE_BUTTON, etc. This function isn't normally needed because Gtk::Widget::render_icon() is the usual way to get an icon for rendering - then just look at the size of the rendered pixbuf. The rendered pixbuf may not even correspond to the width/height returned by IconSize::lookup(), because themes are free to render the pixbuf however they like, including changing the usual size.
- Parameters
-
size | An icon size. |
width | Location to store icon width. |
height | Location to store icon height. |
settings | A Gtk::Settings object, used to determine which set of user preferences to used. |
- Returns
- true if size was a valid size.
- Deprecated:
- Use IconSize::lookup() without the settings parameter instead.
- Since gtkmm 2.14:
◆ operator int()
Gtk::IconSize::operator int |
( |
| ) |
const |
|
inline |
◆ register_alias()
static void Gtk::IconSize::register_alias |
( |
const Glib::ustring & |
alias, |
|
|
IconSize |
target |
|
) |
| |
|
static |
Registers alias as another name for target so calling from_name() with alias as argument will return target.
- Parameters
-
alias | An alias for target. |
target | An existing icon size. |
- Deprecated:
- Use Gtk::IconTheme instead.
◆ register_new()
static IconSize Gtk::IconSize::register_new |
( |
const Glib::ustring & |
name, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
static |
Registers a new icon size, along the same lines as ICON_SIZE_MENU, etc.
Returns the integer value for the size.
- Parameters
-
name | Name of the icon size. |
width | The icon width. |
height | The icon height. |
- Returns
- Integer value representing the size.
- Deprecated:
- Use Gtk::IconTheme instead.