Revision: 1577
http://geeqie.svn.sourceforge.net/geeqie/?rev=1577&view=rev
Author: nadvornik
Date: 2009-03-28 15:31:04 +0000 (Sat, 28 Mar 2009)
Log Message:
-----------
active image follows keyboard focus
Modified Paths:
--------------
trunk/src/image.c
trunk/src/image.h
trunk/src/layout_image.c
trunk/src/typedefs.h
Modified: trunk/src/image.c
===================================================================
--- trunk/src/image.c 2009-03-28 15:09:09 UTC (rev 1576)
+++ trunk/src/image.c 2009-03-28 15:31:04 UTC (rev 1577)
@@ -867,6 +867,11 @@
GTK_WIDGET_SET_FLAGS(imd->widget, GTK_HAS_FOCUS);
image_focus_paint(imd, TRUE, NULL);
+ if (imd->func_focus_in)
+ {
+ imd->func_focus_in(imd, imd->data_focus_in);
+ }
+
return TRUE;
}
@@ -974,6 +979,14 @@
imd->data_scroll_notify = data;
}
+void image_set_focus_in_func(ImageWindow *imd,
+ void (*func)(ImageWindow *, gpointer),
+ gpointer data)
+{
+ imd->func_focus_in = func;
+ imd->data_focus_in = data;
+}
+
/* path, name */
const gchar *image_get_path(ImageWindow *imd)
Modified: trunk/src/image.h
===================================================================
--- trunk/src/image.h 2009-03-28 15:09:09 UTC (rev 1576)
+++ trunk/src/image.h 2009-03-28 15:31:04 UTC (rev 1577)
@@ -33,6 +33,9 @@
void image_set_scroll_func(ImageWindow *imd,
void (*func)(ImageWindow *, GdkEventScroll *event, gpointer),
gpointer data);
+void image_set_focus_in_func(ImageWindow *imd,
+ void (*func)(ImageWindow *, gpointer),
+ gpointer data);
void image_set_scroll_notify_func(ImageWindow *imd,
void (*func)(ImageWindow *imd, gint x, gint
y, gint width, gint height, gpointer data),
gpointer data);
Modified: trunk/src/layout_image.c
===================================================================
--- trunk/src/layout_image.c 2009-03-28 15:09:09 UTC (rev 1576)
+++ trunk/src/layout_image.c 2009-03-28 15:31:04 UTC (rev 1577)
@@ -1331,7 +1331,20 @@
return -1;
}
+static void layout_image_focus_in_cb(ImageWindow *imd, gpointer data)
+{
+ LayoutWindow *lw = data;
+ gint i = image_idx(lw, imd);
+
+ if (i != -1)
+ {
+ DEBUG_1("image activate focus_in %d", i);
+ layout_image_activate(lw, i);
+ }
+}
+
+
static void layout_image_button_cb(ImageWindow *imd, GdkEventButton *event,
gpointer data)
{
LayoutWindow *lw = data;
@@ -1604,6 +1617,8 @@
gtk_size_group_add_widget(lw->split_image_sizegroup,
lw->split_images[i]->widget);
gtk_widget_set_size_request(lw->split_images[i]->widget,
IMAGE_MIN_WIDTH, -1);
+ image_set_focus_in_func(lw->split_images[i],
layout_image_focus_in_cb, lw);
+
}
return lw->split_images[i]->widget;
Modified: trunk/src/typedefs.h
===================================================================
--- trunk/src/typedefs.h 2009-03-28 15:09:09 UTC (rev 1576)
+++ trunk/src/typedefs.h 2009-03-28 15:31:04 UTC (rev 1577)
@@ -394,10 +394,12 @@
void (*func_button)(ImageWindow *, GdkEventButton *event, gpointer);
void (*func_drag)(ImageWindow *, GdkEventButton *event, gdouble dx,
gdouble dy, gpointer);
void (*func_scroll)(ImageWindow *, GdkEventScroll *event, gpointer);
+ void (*func_focus_in)(ImageWindow *, gpointer);
gpointer data_button;
gpointer data_drag;
gpointer data_scroll;
+ gpointer data_focus_in;
/* scroll notification (for scroll bar implementation) */
void (*func_scroll_notify)(ImageWindow *, gint x, gint y, gint width,
gint height, gpointer);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn