"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/gtk+/glade-attributes.c" between
glade-3.38.0.tar.xz and glade-3.38.1.tar.xz

About: Glade is a User Interface Designer for the GTK+ toolkit and the Gnome desktop environment.

glade-attributes.c  (glade-3.38.0.tar.xz):glade-attributes.c  (glade-3.38.1.tar.xz)
skipping to change at line 705 skipping to change at line 705
static void static void
value_icon_activate (GtkCellRendererToggle *cell_renderer, value_icon_activate (GtkCellRendererToggle *cell_renderer,
gchar *path, gchar *path,
GladeEPropAttrs *eprop_attrs) GladeEPropAttrs *eprop_attrs)
{ {
GtkWidget *dialog; GtkWidget *dialog;
GtkTreeIter iter; GtkTreeIter iter;
PangoAttrType type; PangoAttrType type;
AttrEditType edit_type; AttrEditType edit_type;
GdkRGBA color = {0,}; PangoColor color;
GdkRGBA rgba;
gchar *text = NULL, *new_text; gchar *text = NULL, *new_text;
/* Find type etc */ /* Find type etc */
if (!gtk_tree_model_get_iter_from_string (eprop_attrs->model, &iter, path)) if (!gtk_tree_model_get_iter_from_string (eprop_attrs->model, &iter, path))
return; return;
gtk_tree_model_get (eprop_attrs->model, &iter, gtk_tree_model_get (eprop_attrs->model, &iter,
COLUMN_TEXT, &text, COLUMN_TEXT, &text,
COLUMN_TYPE, &type, COLUMN_TYPE, &type,
COLUMN_EDIT_TYPE, &edit_type, -1); COLUMN_EDIT_TYPE, &edit_type, -1);
/* Launch dialog etc. */ /* Launch dialog etc. */
switch (edit_type) switch (edit_type)
{ {
case EDIT_COLOR: case EDIT_COLOR:
dialog = gtk_color_chooser_dialog_new (_("Select a color"), dialog = gtk_color_chooser_dialog_new (_("Select a color"),
GTK_WINDOW (glade_app_get_window ())); GTK_WINDOW (glade_app_get_window ()));
/* Get response etc... */ /* Get response etc... */
if (text && gdk_rgba_parse (&color, text)) if (text && pango_color_parse (&color, text))
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog), &color); {
rgba.red = color.red / 65535.0;
rgba.green = color.green / 65535.0;
rgba.blue = color.blue / 65535.0;
rgba.alpha = 1.0;
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog), &rgba);
}
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
{ {
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color); gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &rgba);
color.red = (gint16) (rgba.red * 65535);
color.green = (gint16) (rgba.green * 65535);
color.blue = (gint16) (rgba.blue * 65535);
/* Use PangoColor string format */ /* Use PangoColor string format */
if (((guint8)(color.red * 0xFF)) * 0x101 == (guint16)(color.red * 0x new_text = pango_color_to_string (&color);
FFFF) &&
((guint8)(color.green * 0xFF)) * 0x101 == (guint16)(color.green
* 0xFFFF) &&
((guint8)(color.blue * 0xFF)) * 0x101 == (guint16)(color.blue *
0xFFFF))
new_text = g_strdup_printf ("#%02X%02X%02X",
(guint8)(color.red * 0xFF),
(guint8)(color.green * 0xFF),
(guint8)(color.blue * 0xFF));
else
new_text = g_strdup_printf ("#%04X%04X%04X",
(guint16)(color.red * 0xFFFF),
(guint16)(color.green * 0xFFFF),
(guint16)(color.blue * 0xFFFF));
gtk_list_store_set (GTK_LIST_STORE (eprop_attrs->model), &iter, gtk_list_store_set (GTK_LIST_STORE (eprop_attrs->model), &iter,
COLUMN_TEXT, new_text, COLUMN_TEXT, new_text,
COLUMN_NAME_WEIGHT, PANGO_WEIGHT_BOLD, COLUMN_NAME_WEIGHT, PANGO_WEIGHT_BOLD,
COLUMN_TEXT_STYLE, PANGO_STYLE_NORMAL, COLUMN_TEXT_STYLE, PANGO_STYLE_NORMAL,
COLUMN_TEXT_FG, "Black", -1); COLUMN_TEXT_FG, "Black", -1);
g_free (new_text); g_free (new_text);
} }
gtk_widget_destroy (dialog); gtk_widget_destroy (dialog);
 End of changes. 4 change blocks. 
19 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)