mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 20:51:07 +00:00
win32: Allow querying names for colors
This commit is contained in:
parent
46d3611052
commit
ecaca073f1
@ -501,6 +501,31 @@ static struct {
|
||||
#undef RGB
|
||||
};
|
||||
|
||||
const char *
|
||||
gtk_win32_get_sys_color_name_for_id (gint id)
|
||||
{
|
||||
if (id >= 0 && id < G_N_ELEMENTS (win32_default_colors))
|
||||
return win32_default_colors[id].name;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
gtk_win32_get_sys_color_id_for_name (const char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (name != NULL, -1);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (win32_default_colors); i++)
|
||||
{
|
||||
if (g_str_equal (name, win32_default_colors[i].name))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_win32_get_sys_color (gint id,
|
||||
GdkRGBA *color)
|
||||
|
@ -168,6 +168,9 @@ void gtk_win32_get_theme_margins (const char
|
||||
GtkBorder *out_margins);
|
||||
|
||||
int gtk_win32_get_sys_metric (gint id);
|
||||
|
||||
const char * gtk_win32_get_sys_color_name_for_id (gint id);
|
||||
int gtk_win32_get_sys_color_id_for_name (const char *name);
|
||||
void gtk_win32_get_sys_color (gint id,
|
||||
GdkRGBA *color);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user