Mercurial > pidgin.yaz
changeset 728:a509d6fad0de
[gaim-migrate @ 738]
set the color selections with the default color
committer: Tailor Script <tailor@pidgin.im>
author | Todd Kulesza <fflewddur> |
---|---|
date | Sun, 20 Aug 2000 13:53:53 +0000 |
parents | 8b9f0537f473 |
children | 8ec392eab812 |
files | src/dialogs.c src/gaim.h |
diffstat | 2 files changed, 28 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dialogs.c Sat Aug 19 21:21:59 2000 +0000 +++ b/src/dialogs.c Sun Aug 20 13:53:53 2000 +0000 @@ -67,6 +67,8 @@ #define DEFAULT_FONT_NAME "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1" int smiley_array[FACE_TOTAL]; +GdkColor bgcolor; +GdkColor fgcolor; static GtkWidget *imdialog = NULL; /*I only want ONE of these :) */ static GList *dialogwindows = NULL; @@ -2387,13 +2389,30 @@ } } +void set_color_selection(GtkWidget *selection, GdkColor color) +{ + gdouble colors[4]; + + colors[0] = color.red; + colors[1] = color.green; + colors[2] = color.blue; + colors[3] = 0; /* opacity, currently unused */ + gtk_color_selection_set_color(GTK_COLOR_SELECTION(selection), colors); + + return; +} + void show_color_dialog(struct conversation *c, GtkWidget *color) { GtkWidget *colorsel; + gdouble colors[4]; if ((int)color == 1) { /* foreground */ if (fgcseld) return; fgcseld = gtk_color_selection_dialog_new(_("Select Text Color")); + + set_color_selection(GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel, fgcolor); + gtk_signal_connect(GTK_OBJECT(fgcseld), "delete_event", GTK_SIGNAL_FUNC(destroy_colorsel), (void *)1); gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->cancel_button), "clicked", GTK_SIGNAL_FUNC(destroy_colorsel), (void *)1); gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->ok_button), "clicked", GTK_SIGNAL_FUNC(apply_color_dlg), (void *)1); @@ -2405,6 +2424,9 @@ } else if ((int)color == 2) { /* background */ if (bgcseld) return; bgcseld = gtk_color_selection_dialog_new(_("Select Background Color")); + + set_color_selection(GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel, bgcolor); + gtk_signal_connect(GTK_OBJECT(bgcseld), "delete_event", GTK_SIGNAL_FUNC(destroy_colorsel), NULL); gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->cancel_button), "clicked", GTK_SIGNAL_FUNC(destroy_colorsel), NULL); gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->ok_button), "clicked", GTK_SIGNAL_FUNC(apply_color_dlg), (void *)2); @@ -2417,9 +2439,12 @@ if (!c->color_dialog) { - c->color_dialog = gtk_color_selection_dialog_new(_("Select Text Color")); + c->color_dialog = gtk_color_selection_dialog_new(_("Select Text Color")); + colorsel = GTK_COLOR_SELECTION_DIALOG(c->color_dialog)->colorsel; + set_color_selection(colorsel, fgcolor); + gtk_object_set_user_data(GTK_OBJECT(colorsel), c); gtk_signal_connect(GTK_OBJECT(c->color_dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c);
--- a/src/gaim.h Sat Aug 19 21:21:59 2000 +0000 +++ b/src/gaim.h Sun Aug 20 13:53:53 2000 +0000 @@ -400,7 +400,7 @@ #define TYPE_SIGNOFF 4 #define TYPE_KEEPALIVE 5 -#define REVISION "gaim:$Revision: 723 $" +#define REVISION "gaim:$Revision: 738 $" #define FLAPON "FLAPON\r\n\r\n" #define ROAST "Tic/Toc" @@ -796,6 +796,7 @@ extern void show_font_dialog(struct conversation *c, GtkWidget *font); extern void cancel_font(GtkWidget *widget, struct conversation *c); extern void apply_font(GtkWidget *widget, GtkFontSelection *fontsel); +extern void set_color_selection(GtkWidget *selection, GdkColor color); /* Functions in rvous.c */ extern void accept_file_dialog(struct file_transfer *);