[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
xc189-bgcolor-toolbox.diff (was: Re: X-chat: odds and ends questions)
Hi Paul,
On Mon, 24 Jun 2002 05:51:33 -0600
"contactbox@softhome.net" <contactbox@softhome.net> wrote:
> (5) BTW its good being able to click on colours directly, neat touch
> that mIRC doesnt have, but I think somethings missing. If the cursor
> is in front of one colour, or you've just clicked on one colour, then
> RIGHT clicking on a colour shouldn't add %C<n> but ,<n> thus setting
> the _background_ colour instead. At present to set the background
> colour you have to click, then go back and delete the %C replacing it
> with "," manually. Wasteful.
try the attached diff, it does what you suggtested ;-)
to use the diff go to the src/fe-gtk subdirectory of the xchat source and do a
patch < /where/you/saved/xc189-bgcolor-toolbox.diff
and rerun the make; make install
hth,
Hanno / Vetinari
--
need [x]chat "online help"? /join #xchat on IRCNet ;-)
--- ../../../xchat-1.8.9/src/fe-gtk/maingui.c Tue Apr 23 05:46:54 2002
+++ maingui.c Tue Jun 25 18:34:51 2002
@@ -1478,11 +1478,14 @@
}
static void
-toolbox_color (GtkWidget * button, int color_no)
+toolbox_color (GtkWidget * button, GdkEventButton * even, int color_no)
{
char buf[8];
- sprintf (buf, "%%C%d", color_no);
+ if (even->button == 3)
+ sprintf (buf, ",%d", color_no);
+ else
+ sprintf (buf, "%%C%d", color_no);
if (menu_sess)
key_action_insert (menu_sess->gui->inputgad, 0, buf, 0, menu_sess);
@@ -1527,7 +1530,7 @@
style->bg[0] = colors[i];
wid = toolbox_button (" ", 0, toolbox, 0);
gtk_widget_set_style (wid, style);
- gtk_signal_connect (GTK_OBJECT (wid), "clicked",
+ gtk_signal_connect (GTK_OBJECT (wid), "button_press_event",
GTK_SIGNAL_FUNC (toolbox_color), GINT_TO_POINTER (i));
gtk_style_unref (style);
}