Commit c3519365 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

allow keyboard activation.

2003-03-28  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpcellrenderertoggle.c
	(gimp_cell_renderer_toggle_activate) *
	app/widgets/gimpcellrendererviewable.c
	(gimp_cell_renderer_viewable_activate): allow keyboard activation.

	* app/widgets/gimpcellrendererviewable.c
	(gimp_cell_renderer_viewable_render): fixed the if() which resets
	the renderer's border color to black. Fixes layer borders to be
	always correct now.
parent bc9ef72c
2003-03-28 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcellrenderertoggle.c
(gimp_cell_renderer_toggle_activate) *
app/widgets/gimpcellrendererviewable.c
(gimp_cell_renderer_viewable_activate): allow keyboard activation.
* app/widgets/gimpcellrendererviewable.c
(gimp_cell_renderer_viewable_render): fixed the if() which resets
the renderer's border color to black. Fixes layer borders to be
always correct now.
2003-03-28 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcellrenderertoggle.c
......@@ -417,15 +417,15 @@ gimp_cell_renderer_toggle_activate (GtkCellRenderer *cell,
celltoggle = GTK_CELL_RENDERER_TOGGLE (cell);
if (celltoggle->activatable && event)
if (celltoggle->activatable)
{
GdkModifierType state = 0;
if (((GdkEventAny *) event)->type == GDK_BUTTON_PRESS)
if (event && ((GdkEventAny *) event)->type == GDK_BUTTON_PRESS)
state = ((GdkEventButton *) event)->state;
g_signal_emit (cell, toggle_cell_signals[CLICKED], 0,
path, state);
gimp_cell_renderer_toggle_clicked (GIMP_CELL_RENDERER_TOGGLE (cell),
path, state);
return TRUE;
}
......
......@@ -289,7 +289,7 @@ gimp_cell_renderer_viewable_render (GtkCellRenderer *cell,
if (cellviewable->renderer)
{
if (! flags & GTK_CELL_RENDERER_SELECTED)
if (! (flags & GTK_CELL_RENDERER_SELECTED))
{
GimpRGB black = { 0.0, 0.0, 0.0, 1.0 };
......@@ -316,20 +316,20 @@ gimp_cell_renderer_viewable_activate (GtkCellRenderer *cell,
cellviewable = GIMP_CELL_RENDERER_VIEWABLE (cell);
if (cellviewable->renderer && event)
if (cellviewable->renderer)
{
if (((GdkEventAny *) event)->type == GDK_BUTTON_PRESS &&
((GdkEventButton *) event)->button == 1)
GdkModifierType state = 0;
if (event && ((GdkEventAny *) event)->type == GDK_BUTTON_PRESS)
state = ((GdkEventButton *) event)->state;
if (! event ||
(((GdkEventAny *) event)->type == GDK_BUTTON_PRESS &&
((GdkEventButton *) event)->button == 1))
{
g_signal_emit (cell, viewable_cell_signals[CLICKED], 0,
path, ((GdkEventButton *) event)->state);
return gimp_preview_popup_show (widget,
(GdkEventButton *) event,
cellviewable->renderer->viewable,
cellviewable->renderer->width,
cellviewable->renderer->height,
TRUE);
gimp_cell_renderer_viewable_clicked (cellviewable, path, state);
return TRUE;
}
}
......@@ -358,7 +358,6 @@ gimp_cell_renderer_viewable_clicked (GimpCellRendererViewable *cell,
if (event)
{
if (((GdkEventAny *) event)->type == GDK_BUTTON_PRESS &&
((GdkEventButton *) event)->button == 1)
gimp_preview_popup_show (gtk_get_event_widget (event),
......
......@@ -417,15 +417,15 @@ gimp_cell_renderer_toggle_activate (GtkCellRenderer *cell,
celltoggle = GTK_CELL_RENDERER_TOGGLE (cell);
if (celltoggle->activatable && event)
if (celltoggle->activatable)
{
GdkModifierType state = 0;
if (((GdkEventAny *) event)->type == GDK_BUTTON_PRESS)
if (event && ((GdkEventAny *) event)->type == GDK_BUTTON_PRESS)
state = ((GdkEventButton *) event)->state;
g_signal_emit (cell, toggle_cell_signals[CLICKED], 0,
path, state);
gimp_cell_renderer_toggle_clicked (GIMP_CELL_RENDERER_TOGGLE (cell),
path, state);
return TRUE;
}
......
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