derive from GtkEventBox instead of GtkMisc, but use an input-only window.

2007-11-22  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpcolorbar.[ch]: derive from GtkEventBox instead
	of GtkMisc, but use an input-only window.

	* app/tools/gimplevelstool.c: redirect the events of the color
	bars to te handle bars. The historgram dialog has this change
	already. Functionality should be 100% restored now.


svn path=/trunk/; revision=24218
This commit is contained in:
Michael Natterer 2007-11-22 17:07:33 +00:00 committed by Michael Natterer
parent dc5d601675
commit 8fba0a2f27
4 changed files with 39 additions and 6 deletions

View file

@ -1,3 +1,12 @@
2007-11-22 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcolorbar.[ch]: derive from GtkEventBox instead
of GtkMisc, but use an input-only window.
* app/tools/gimplevelstool.c: redirect the events of the color
bars to te handle bars. The historgram dialog has this change
already. Functionality should be 100% restored now.
2007-11-22 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimphelpui.[ch]: use

View file

@ -428,6 +428,18 @@ gimp_levels_tool_dialog (GimpImageMapTool *image_map_tool)
gtk_box_pack_start (GTK_BOX (vbox3), tool->input_sliders, FALSE, FALSE, 0);
gtk_widget_show (tool->input_sliders);
g_signal_connect_swapped (tool->input_bar, "button-press-event",
G_CALLBACK (GTK_WIDGET_GET_CLASS (tool->input_sliders)->button_press_event),
tool->input_sliders);
g_signal_connect_swapped (tool->input_bar, "button-release-event",
G_CALLBACK (GTK_WIDGET_GET_CLASS (tool->input_sliders)->button_release_event),
tool->input_sliders);
g_signal_connect_swapped (tool->input_bar, "motion-notify-event",
G_CALLBACK (GTK_WIDGET_GET_CLASS (tool->input_sliders)->motion_notify_event),
tool->input_sliders);
/* Horizontal box for input levels spinbuttons */
hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
@ -526,6 +538,18 @@ gimp_levels_tool_dialog (GimpImageMapTool *image_map_tool)
gtk_box_pack_start (GTK_BOX (vbox2), tool->output_sliders, FALSE, FALSE, 0);
gtk_widget_show (tool->output_sliders);
g_signal_connect_swapped (tool->output_bar, "button-press-event",
G_CALLBACK (GTK_WIDGET_GET_CLASS (tool->output_sliders)->button_press_event),
tool->output_sliders);
g_signal_connect_swapped (tool->output_bar, "button-release-event",
G_CALLBACK (GTK_WIDGET_GET_CLASS (tool->output_sliders)->button_release_event),
tool->output_sliders);
g_signal_connect_swapped (tool->output_bar, "motion-notify-event",
G_CALLBACK (GTK_WIDGET_GET_CLASS (tool->output_sliders)->motion_notify_event),
tool->output_sliders);
/* Horizontal box for levels spin widgets */
hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);

View file

@ -55,7 +55,7 @@ static gboolean gimp_color_bar_expose (GtkWidget *widget,
GdkEventExpose *event);
G_DEFINE_TYPE (GimpColorBar, gimp_color_bar, GTK_TYPE_MISC)
G_DEFINE_TYPE (GimpColorBar, gimp_color_bar, GTK_TYPE_EVENT_BOX)
#define parent_class gimp_color_bar_parent_class
@ -98,7 +98,7 @@ gimp_color_bar_class_init (GimpColorBarClass *klass)
static void
gimp_color_bar_init (GimpColorBar *bar)
{
GTK_WIDGET_SET_FLAGS (bar, GTK_NO_WINDOW);
gtk_event_box_set_visible_window (GTK_EVENT_BOX (bar), FALSE);
bar->orientation = GTK_ORIENTATION_HORIZONTAL;
}
@ -161,8 +161,8 @@ gimp_color_bar_expose (GtkWidget *widget,
gint width, height;
gint i, j;
x = GTK_MISC (bar)->xpad;
y = GTK_MISC (bar)->ypad;
x = GTK_CONTAINER (bar)->border_width;
y = GTK_CONTAINER (bar)->border_width;
width = widget->allocation.width - 2 * x;
height = widget->allocation.height - 2 * y;

View file

@ -35,7 +35,7 @@ typedef struct _GimpColorBarClass GimpColorBarClass;
struct _GimpColorBar
{
GtkMisc parent_class;
GtkEventBox parent_class;
GtkOrientation orientation;
guchar buf[3 * 256];
@ -43,7 +43,7 @@ struct _GimpColorBar
struct _GimpColorBarClass
{
GtkMiscClass parent_class;
GtkEventBoxClass parent_class;
};