diff src/layout_image.c @ 122:e2a8b7f2165b

Sat Dec 2 16:44:48 2006 John Ellis <johne@verizon.net> * image-overlay.[ch]: More work on osd icons. * image.c: Use correct flag when setting auto rotation state, and set the state again after the rotation so that osd can update. * img-view.c: Show osd icon when overlay is enabled. * layout.c, layout_image.[ch]: Enable overlay regardless of the full screen state, only difference now is that image description text is only shown when in full screen but icons will always appear. * layout_util.c: Make I key toggle overlay from windowed mode too. * typedefs.h (LayoutWindow): Remove no longer used full_screen_overlay_on.
author gqview
date Sat, 02 Dec 2006 21:57:12 +0000
parents 0c2e1f0a001b
children 271afad04d07
line wrap: on
line diff
--- a/src/layout_image.c	Fri Dec 01 19:41:45 2006 +0000
+++ b/src/layout_image.c	Sat Dec 02 21:57:12 2006 +0000
@@ -43,18 +43,22 @@
  *----------------------------------------------------------------------------
  */
 
-static void layout_image_overlay_set(LayoutWindow *lw, gint enable)
+void layout_image_overlay_toggle(LayoutWindow *lw)
 {
-	lw->full_screen_overlay_on = enable;
-
-	if (!lw->full_screen) return;
-
-	image_osd_set(lw->image, enable, enable);
+	if (image_osd_get(lw->image, NULL, NULL))
+		{
+		image_osd_set(lw->image, FALSE, FALSE);
+		}
+	else
+		{
+		image_osd_set(lw->image, (lw->full_screen != NULL), TRUE);
+		image_osd_icon(lw->image, IMAGE_OSD_ICON, -1);
+		}
 }
 
 void layout_image_overlay_update(LayoutWindow *lw)
 {
-	if (!lw || !lw->full_screen) return;
+	if (!lw) return;
 
 	image_osd_update(lw->image);
 }
@@ -307,7 +311,7 @@
 				layout_image_full_screen_menu_popup(lw);
 				break;
 			case 'I': case 'i':
-				layout_image_overlay_set(lw, !(lw->full_screen_overlay_on));
+				layout_image_overlay_toggle(lw);
 				break;
 			default:
 				stop_signal = FALSE;
@@ -360,7 +364,11 @@
 	if (lw->tools) gtk_widget_set_sensitive(lw->tools, FALSE);
 #endif
 
-	layout_image_overlay_set(lw, lw->full_screen_overlay_on);
+	if (image_osd_get(lw->full_screen->normal_imd, NULL, NULL))
+		{
+		image_osd_set(lw->image, TRUE, TRUE);
+		image_osd_set(lw->full_screen->normal_imd, FALSE, FALSE);
+		}
 }
 
 void layout_image_full_screen_stop(LayoutWindow *lw)
@@ -368,6 +376,10 @@
 	if (!layout_valid(&lw)) return;
 	if (!lw->full_screen) return;
 
+	if (image_osd_get(lw->image, NULL, NULL))
+		{
+		image_osd_set(lw->full_screen->normal_imd, FALSE, TRUE);
+		}
 	fullscreen_stop(lw->full_screen);
 
 #if 0
@@ -1191,7 +1203,14 @@
 	if (cd && info)
 		{
 		info = collection_next_by_info(cd, info);
-		if (info) layout_image_set_collection_real(lw, cd, info, TRUE);
+		if (info)
+			{
+			layout_image_set_collection_real(lw, cd, info, TRUE);
+			}
+		else
+			{
+			image_osd_icon(lw->image, IMAGE_OSD_LAST, -1);
+			}
 		return;
 		}
 
@@ -1203,6 +1222,10 @@
 			{
 			layout_image_set_index(lw, current + 1);
 			}
+		else
+			{
+			image_osd_icon(lw->image, IMAGE_OSD_LAST, -1);
+			}
 		}
 	else
 		{
@@ -1229,7 +1252,14 @@
 	if (cd && info)
 		{
 		info = collection_prev_by_info(cd, info);
-		if (info) layout_image_set_collection_real(lw, cd, info, FALSE);
+		if (info)
+			{
+			layout_image_set_collection_real(lw, cd, info, FALSE);
+			}
+		else
+			{
+			image_osd_icon(lw->image, IMAGE_OSD_FIRST, -1);
+			}
 		return;
 		}
 
@@ -1241,6 +1271,10 @@
 			{
 			layout_image_set_index(lw, current - 1);
 			}
+		else
+			{
+			image_osd_icon(lw->image, IMAGE_OSD_FIRST, -1);
+			}
 		}
 	else
 		{