changeset 822:df541dc41707

Allow to set image overlay info position through options: - image_overlay.common.x - image_overlay.common.y For now, there are only editable through rc file.
author zas_
date Thu, 12 Jun 2008 20:33:51 +0000
parents fb249b8e63e4
children ed82f5bf8082
files src/image-overlay.c src/options.c src/options.h src/rcfile.c
diffstat 4 files changed, 18 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/image-overlay.c	Thu Jun 12 20:17:22 2008 +0000
+++ b/src/image-overlay.c	Thu Jun 12 20:33:51 2008 +0000
@@ -42,6 +42,9 @@
 	OsdShowFlags show;
 
 	gint ovl_info;
+	
+	gint x;
+	gint y;
 
 	gint icon_time[IMAGE_OSD_COUNT];
 	gint icon_id[IMAGE_OSD_COUNT];
@@ -73,9 +76,6 @@
 
 #define OSD_DATA "overlay-data"
 
-#define OSD_INFO_X 10
-#define OSD_INFO_Y -10
-
 #define IMAGE_OSD_DEFAULT_DURATION 30
 
 #define HISTOGRAM_HEIGHT 140
@@ -761,11 +761,11 @@
 				if (osd->ovl_info == 0)
 					{
 					osd->ovl_info = image_overlay_add(osd->imd, pixbuf,
-									  OSD_INFO_X, OSD_INFO_Y, TRUE, FALSE);
+									  osd->x, osd->y, TRUE, FALSE);
 					}
 				else
 					{
-					image_overlay_set(osd->imd, osd->ovl_info, pixbuf, OSD_INFO_X, OSD_INFO_Y);
+					image_overlay_set(osd->imd, osd->ovl_info, pixbuf, osd->x, osd->y);
 					}
 				g_object_unref(pixbuf);
 				}
@@ -970,7 +970,9 @@
 		osd->timer_id = -1;
 		osd->show = OSD_SHOW_NOTHING;
 		osd->histogram = NULL;
-
+		osd->x = options->image_overlay.common.x;
+		osd->y = options->image_overlay.common.y;
+		
 		osd->destroy_id = g_signal_connect(G_OBJECT(imd->pr), "destroy",
 						   G_CALLBACK(image_osd_destroy_cb), osd);
 		image_set_osd_data(imd, osd);
--- a/src/options.c	Thu Jun 12 20:17:22 2008 +0000
+++ b/src/options.c	Thu Jun 12 20:33:51 2008 +0000
@@ -86,6 +86,8 @@
 	options->image_overlay.common.state = (guint)OSD_SHOW_NOTHING;
 	options->image_overlay.common.show_at_startup = FALSE;
 	options->image_overlay.common.template_string = NULL;
+	options->image_overlay.common.x = 10;
+	options->image_overlay.common.y = -10;
 
 	options->layout.dir_view_type = DIRVIEW_LIST;
 	options->layout.file_view_type = FILEVIEW_LIST;
--- a/src/options.h	Thu Jun 12 20:17:22 2008 +0000
+++ b/src/options.h	Thu Jun 12 20:33:51 2008 +0000
@@ -150,6 +150,8 @@
 			guint state;
 			gint show_at_startup;
 			gchar *template_string;
+			gint x;
+			gint y;
 		} common;
 	} image_overlay;
 
--- a/src/rcfile.c	Thu Jun 12 20:17:22 2008 +0000
+++ b/src/rcfile.c	Thu Jun 12 20:33:51 2008 +0000
@@ -491,6 +491,8 @@
 	WRITE_UINT(image_overlay.common.state);
 	WRITE_BOOL(image_overlay.common.show_at_startup);
 	WRITE_CHAR(image_overlay.common.template_string);
+	WRITE_INT(image_overlay.common.x);
+	WRITE_INT(image_overlay.common.y);
 
 
 	WRITE_SUBTITLE("Slideshow Options");
@@ -841,6 +843,10 @@
 		COMPAT_READ_CHAR(fullscreen.info, image_overlay.common.template_string); /* 2008-04-21 */
 		READ_CHAR(image_overlay.common.template_string);
 
+		READ_INT(image_overlay.common.x);
+		READ_INT(image_overlay.common.y);
+
+
 		/* slideshow options */
 		READ_INT_UNIT(slideshow.delay, SLIDESHOW_SUBSECOND_PRECISION);
 		READ_BOOL(slideshow.random);