mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 17:50:10 +00:00
enums: Add a GtkSymbolicColor enum
That way we don't nedmagic numbres to index the colors array. Use it in the symbolic paintable demo.
This commit is contained in:
parent
7cdbdb663c
commit
6c87d362c5
@ -61,10 +61,10 @@ gtk_nuclear_symbolic_snapshot_symbolic (GtkSymbolicPaintable *paintable,
|
||||
bg_color = &transparent;
|
||||
break;
|
||||
case WARNING_ALERT:
|
||||
bg_color = &colors[2]; /* warning color */
|
||||
bg_color = &colors[GTK_SYMBOLIC_COLOR_WARNING];
|
||||
break;
|
||||
case WARNING_EMERGENCY:
|
||||
bg_color = &colors[1]; /* error color */
|
||||
bg_color = &colors[GTK_SYMBOLIC_COLOR_ERROR];
|
||||
break;
|
||||
default:
|
||||
/* This should never happen, but we better do defensive coding
|
||||
@ -76,7 +76,7 @@ gtk_nuclear_symbolic_snapshot_symbolic (GtkSymbolicPaintable *paintable,
|
||||
|
||||
/* Draw the icon with the selected warning color */
|
||||
gtk_nuclear_snapshot (snapshot,
|
||||
&colors[0], /* foreground color */
|
||||
&colors[GTK_SYMBOLIC_COLOR_FOREGROUND],
|
||||
bg_color,
|
||||
width, height,
|
||||
0);
|
||||
|
@ -1131,6 +1131,25 @@ typedef enum {
|
||||
GTK_SYSTEM_SETTING_ICON_THEME
|
||||
} GtkSystemSetting;
|
||||
|
||||
/**
|
||||
* GtkSymbolicColor:
|
||||
* @GTK_SYMBOLIC_COLOR_FOREGROUND: The default foreground color
|
||||
* @GTK_SYMBOLIC_COLOR_ERROR: Indication color for errors
|
||||
* @GTK_SYMBOLIC_COLOR_WARNING: Indication color for warnings
|
||||
* @GTK_SYMBOLIC_COLOR_SUCCESS: Indication color for success
|
||||
*
|
||||
* The indexes of colors passed to symbolic color rendering, such as
|
||||
* [vfunc.GtkSymbolicPaintable.snapshot_symbolic].
|
||||
*
|
||||
* More values may be added over time.
|
||||
*/
|
||||
typedef enum {
|
||||
GTK_SYMBOLIC_COLOR_FOREGROUND = 0,
|
||||
GTK_SYMBOLIC_COLOR_ERROR = 1,
|
||||
GTK_SYMBOLIC_COLOR_WARNING = 2,
|
||||
GTK_SYMBOLIC_COLOR_SUCCESS = 3
|
||||
} GtkSymbolicColor;
|
||||
|
||||
/**
|
||||
* GtkAccessibleRole:
|
||||
* @GTK_ACCESSIBLE_ROLE_ALERT: An element with important, and usually
|
||||
|
Loading…
Reference in New Issue
Block a user