Commit 299dad1d authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

invalidate the preview when the toggle buttons are used. Reported by

2004-10-08  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/apply_lens.c (lens_dialog): invalidate the
	preview when the toggle buttons are used. Reported by Olivier.

	* app/widgets/gimpview.c: minor cleanup.
parent 8a622048
2004-10-08 Sven Neumann <sven@gimp.org>
* plug-ins/common/apply_lens.c (lens_dialog): invalidate the
preview when the toggle buttons are used. Reported by Olivier.
* app/widgets/gimpview.c: minor cleanup.
2004-10-08 Michael Natterer <mitch@gimp.org>
* app/tools/gimpmeasuretool.c: implement GimpTool::key_press() and
......
......@@ -124,11 +124,8 @@ gimp_view_get_type (void)
static void
gimp_view_class_init (GimpViewClass *klass)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
object_class = GTK_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
......@@ -199,9 +196,7 @@ gimp_view_init (GimpView *view)
static void
gimp_view_destroy (GtkObject *object)
{
GimpView *view;
view = GIMP_VIEW (object);
GimpView *view = GIMP_VIEW (object);
if (view->viewable)
gimp_view_set_viewable (view, NULL);
......@@ -218,12 +213,10 @@ gimp_view_destroy (GtkObject *object)
static void
gimp_view_realize (GtkWidget *widget)
{
GimpView *view;
GimpView *view = GIMP_VIEW (widget);
GdkWindowAttr attributes;
gint attributes_mask;
view = GIMP_VIEW (widget);
GTK_WIDGET_CLASS (parent_class)->realize (widget);
attributes.window_type = GDK_WINDOW_CHILD;
......@@ -290,9 +283,7 @@ static void
gimp_view_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GimpView *view;
view = GIMP_VIEW (widget);
GimpView *view = GIMP_VIEW (widget);
if (view->expand)
{
......@@ -315,12 +306,10 @@ static void
gimp_view_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GimpView *view;
GimpView *view = GIMP_VIEW (widget);
gint width;
gint height;
view = GIMP_VIEW (widget);
if (view->expand)
{
width = MIN (GIMP_VIEWABLE_MAX_PREVIEW_SIZE,
......@@ -429,9 +418,7 @@ static gboolean
gimp_view_button_press_event (GtkWidget *widget,
GdkEventButton *bevent)
{
GimpView *view;
view = GIMP_VIEW (widget);
GimpView *view = GIMP_VIEW (widget);
#ifdef DEBUG_MEMSIZE
if (bevent->type == GDK_BUTTON_PRESS && bevent->button == 2)
......@@ -499,9 +486,7 @@ static gboolean
gimp_view_button_release_event (GtkWidget *widget,
GdkEventButton *bevent)
{
GimpView *view;
view = GIMP_VIEW (widget);
GimpView *view = GIMP_VIEW (widget);
if (! view->clickable &&
! view->show_popup)
......@@ -531,11 +516,8 @@ static gboolean
gimp_view_enter_notify_event (GtkWidget *widget,
GdkEventCrossing *event)
{
GimpView *view;
GtkWidget *event_widget;
view = GIMP_VIEW (widget);
event_widget = gtk_get_event_widget ((GdkEvent *) event);
GimpView *view = GIMP_VIEW (widget);
GtkWidget *event_widget = gtk_get_event_widget ((GdkEvent *) event);
if ((event_widget == widget) &&
(event->detail != GDK_NOTIFY_INFERIOR))
......@@ -550,11 +532,8 @@ static gboolean
gimp_view_leave_notify_event (GtkWidget *widget,
GdkEventCrossing *event)
{
GimpView *view;
GtkWidget *event_widget;
view = GIMP_VIEW (widget);
event_widget = gtk_get_event_widget ((GdkEvent *) event);
GimpView *view = GIMP_VIEW (widget);
GtkWidget *event_widget = gtk_get_event_widget ((GdkEvent *) event);
if ((event_widget == widget) &&
(event->detail != GDK_NOTIFY_INFERIOR))
......@@ -767,12 +746,10 @@ static void
gimp_view_update_callback (GimpViewRenderer *renderer,
GimpView *view)
{
GtkWidget *widget;
GtkWidget *widget = GTK_WIDGET (view);
gint width;
gint height;
widget = GTK_WIDGET (view);
width = renderer->width + 2 * renderer->border_width;
height = renderer->height + 2 * renderer->border_width;
......
......@@ -381,6 +381,7 @@ lens_dialog (GimpDrawable *drawable)
GtkWidget *label;
GtkWidget *toggle;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *spinbutton;
GtkObject *adj;
gboolean run;
......@@ -408,34 +409,44 @@ lens_dialog (GimpDrawable *drawable)
G_CALLBACK (drawlens),
drawable);
vbox = gtk_vbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
gtk_widget_show (vbox);
toggle = gtk_radio_button_new_with_mnemonic_from_widget
(NULL, _("_Keep original surroundings"));
gtk_box_pack_start (GTK_BOX (main_vbox), toggle, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), lvals.keep_surr);
gtk_widget_show (toggle);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&lvals.keep_surr);
g_signal_connect_swapped (toggle, "toggled",
G_CALLBACK (gimp_preview_invalidate),
preview);
toggle = gtk_radio_button_new_with_mnemonic_from_widget
(GTK_RADIO_BUTTON (toggle),
gimp_drawable_is_indexed (drawable->drawable_id)
? _("_Set surroundings to index 0")
: _("_Set surroundings to background color"));
gtk_box_pack_start(GTK_BOX (main_vbox), toggle, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), lvals.use_bkgr);
gtk_widget_show (toggle);
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&lvals.use_bkgr);
g_signal_connect_swapped (toggle, "toggled",
G_CALLBACK (gimp_preview_invalidate),
preview);
if (gimp_drawable_has_alpha (drawable->drawable_id))
{
toggle = gtk_radio_button_new_with_mnemonic_from_widget
(GTK_RADIO_BUTTON (toggle), _("_Make surroundings transparent"));
gtk_box_pack_start (GTK_BOX (main_vbox), toggle, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
lvals.set_transparent);
gtk_widget_show (toggle);
......@@ -443,6 +454,9 @@ lens_dialog (GimpDrawable *drawable)
g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update),
&lvals.set_transparent);
g_signal_connect_swapped (toggle, "toggled",
G_CALLBACK (gimp_preview_invalidate),
preview);
}
hbox = gtk_hbox_new (FALSE, 6);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment