gtkmm 4.16.0
|
This interface can be implemented by widgets which allow the user to choose a color. More...
#include <gtkmm/colorchooser.h>
Public Member Functions | |
ColorChooser (ColorChooser &&src) noexcept | |
ColorChooser & | operator= (ColorChooser &&src) noexcept |
~ColorChooser () noexcept override | |
GtkColorChooser * | gobj () |
Provides access to the underlying C GObject. | |
const GtkColorChooser * | gobj () const |
Provides access to the underlying C GObject. | |
Gdk::RGBA | get_rgba () const |
Gets the currently selected color. | |
void | set_rgba (const Gdk::RGBA &color) |
Sets the color. | |
bool | get_use_alpha () const |
Returns whether the color chooser shows the alpha channel. | |
void | set_use_alpha (bool use_alpha=true) |
Sets whether or not the color chooser should use the alpha channel. | |
void | add_palette (Orientation orientation, int colors_per_line, const std::vector< Gdk::RGBA > &colors) |
Adds a palette to the color chooser. | |
Glib::SignalProxy< void(const Gdk::RGBA &)> | signal_color_activated () |
Glib::PropertyProxy< Gdk::RGBA > | property_rgba () |
The currently selected color, as a GdkRGBA struct. | |
Glib::PropertyProxy_ReadOnly< Gdk::RGBA > | property_rgba () const |
The currently selected color, as a GdkRGBA struct. | |
Glib::PropertyProxy< bool > | property_use_alpha () |
Whether colors may have alpha (translucency). | |
Glib::PropertyProxy_ReadOnly< bool > | property_use_alpha () const |
Whether colors may have alpha (translucency). | |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Protected Member Functions | |
ColorChooser () | |
You should derive from this class to use it. | |
virtual void | on_color_activated (const Gdk::RGBA &color) |
This is a default handler for the signal signal_color_activated(). | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::ColorChooser > | wrap (GtkColorChooser *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
This interface can be implemented by widgets which allow the user to choose a color.
Depending on the situation, colors may be allowed to have alpha (translucency). The main widgets that implement this interface are ColorChooserWidget, ColorChooserDialog and ColorChooserButton.
|
protected |
You should derive from this class to use it.
|
noexcept |
|
overridenoexcept |
void Gtk::ColorChooser::add_palette | ( | Orientation | orientation, |
int | colors_per_line, | ||
const std::vector< Gdk::RGBA > & | colors | ||
) |
Adds a palette to the color chooser.
If orientation is horizontal, the colors are grouped in rows, with colors_per_line colors in each row. If orientation is vertical, the colors are grouped in columns instead.
The default color palette of ColorChooserWidget has 27 colors, organized in columns of 3 colors. The default gray palette has 9 grays in a single row.
The layout of the color chooser widget works best when the palettes have 9-10 columns.
Calling this function for the first time has the side effect of removing the default color and gray palettes from the color chooser.
orientation | Orientation::HORIZONTAL if the palette should be displayed in rows, or Orientation::VERTICAL for columns |
colors_per_line | The number of colors to show in each row/column. |
colors | The colors of the palette. |
Gdk::RGBA Gtk::ColorChooser::get_rgba | ( | ) | const |
|
static |
Get the GType for this class, for use with the underlying GObject type system.
bool Gtk::ColorChooser::get_use_alpha | ( | ) | const |
Returns whether the color chooser shows the alpha channel.
Deprecated: 4.10: Use Gtk::ColorDialog instead
true
if the color chooser uses the alpha channel, false
if not.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
This is a default handler for the signal signal_color_activated().
|
noexcept |
Glib::PropertyProxy< Gdk::RGBA > Gtk::ColorChooser::property_rgba | ( | ) |
The currently selected color, as a GdkRGBA
struct.
The property can be set to change the current selection programmatically.
Deprecated: 4.10: Use Gtk::ColorDialog and Gtk::ColorDialogButton instead of widgets implementing Gtk::ColorChooser
Glib::PropertyProxy_ReadOnly< Gdk::RGBA > Gtk::ColorChooser::property_rgba | ( | ) | const |
The currently selected color, as a GdkRGBA
struct.
The property can be set to change the current selection programmatically.
Deprecated: 4.10: Use Gtk::ColorDialog and Gtk::ColorDialogButton instead of widgets implementing Gtk::ColorChooser
Glib::PropertyProxy< bool > Gtk::ColorChooser::property_use_alpha | ( | ) |
Whether colors may have alpha (translucency).
When signal_use_alpha() is false
, the GdkRGBA
struct obtained via the property_rgba() property will be forced to have alpha == 1.
Implementations are expected to show alpha by rendering the color over a non-uniform background (like a checkerboard pattern).
Deprecated: 4.10: Use Gtk::ColorDialog and Gtk::ColorDialogButton instead of widgets implementing Gtk::ColorChooser
Default value: true
Glib::PropertyProxy_ReadOnly< bool > Gtk::ColorChooser::property_use_alpha | ( | ) | const |
Whether colors may have alpha (translucency).
When signal_use_alpha() is false
, the GdkRGBA
struct obtained via the property_rgba() property will be forced to have alpha == 1.
Implementations are expected to show alpha by rendering the color over a non-uniform background (like a checkerboard pattern).
Deprecated: 4.10: Use Gtk::ColorDialog and Gtk::ColorDialogButton instead of widgets implementing Gtk::ColorChooser
Default value: true
Sets whether or not the color chooser should use the alpha channel.
Deprecated: 4.10: Use Gtk::ColorDialog instead
use_alpha | true if color chooser should use alpha channel, false if not. |
void on_my_color_activated(const Gdk::RGBA& color)
Flags: Run First
Emitted when a color is activated from the color chooser.
This usually happens when the user clicks a color swatch, or a color is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.
Deprecated: 4.10: Use Gtk::ColorDialog and Gtk::ColorDialogButton instead of widgets implementing Gtk::ColorChooser
color | The color. |
|
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. |