image_osd_get() now returns OsdShowFlags.
authorLaurent Monin <geeqie@norz.org>
Sat, 10 May 2008 14:22:18 +0000 (14:22 +0000)
committerLaurent Monin <geeqie@norz.org>
Sat, 10 May 2008 14:22:18 +0000 (14:22 +0000)
src/image-overlay.c
src/image-overlay.h
src/img-view.c
src/layout_image.c
src/main.c

index 1aad88e..2614aa4 100644 (file)
@@ -845,19 +845,11 @@ void image_osd_set(ImageWindow *imd, OsdShowFlags show)
        image_osd_enable(imd, show);
 }
 
-gint image_osd_get(ImageWindow *imd, OsdShowFlags *show)
+OsdShowFlags image_osd_get(ImageWindow *imd)
 {
        OverlayStateData *osd = image_get_osd_data(imd);
 
-       if (!osd)
-               {
-               if (show) *show = OSD_SHOW_NOTHING;
-               return FALSE;
-               }
-
-       if (show) *show = osd->show;
-
-       return TRUE;
+       return osd ? osd->show : OSD_SHOW_NOTHING;
 }
 
 /* duration:
index 331cf82..4f833d3 100644 (file)
@@ -34,7 +34,7 @@ typedef enum {
 void set_default_image_overlay_template_string(ConfOptions *options);
 
 void image_osd_set(ImageWindow *imd, OsdShowFlags show);
-gint image_osd_get(ImageWindow *imd, OsdShowFlags *show);
+OsdShowFlags image_osd_get(ImageWindow *imd);
 
 void image_osd_update(ImageWindow *imd);
 
index 3890736..efe335c 100644 (file)
@@ -695,11 +695,9 @@ static void view_fullscreen_toggle(ViewWindow *vw, gint force_off)
 
        if (vw->fs)
                {
-               if (image_osd_get(vw->fs->imd, NULL))
-                       {
-                       image_osd_set(vw->imd, OSD_SHOW_INFO | OSD_SHOW_STATUS);
-                       }
-
+               if (image_osd_get(vw->imd) & OSD_SHOW_INFO)
+                       image_osd_set(vw->imd, image_osd_get(vw->fs->imd));
+               
                fullscreen_stop(vw->fs);
                }
        else
@@ -712,10 +710,10 @@ static void view_fullscreen_toggle(ViewWindow *vw, gint force_off)
 
                if (vw->ss) vw->ss->imd = vw->fs->imd;
 
-               if (image_osd_get(vw->imd, NULL))
+               if (image_osd_get(vw->imd) & OSD_SHOW_INFO)
                        {
+                       image_osd_set(vw->fs->imd, image_osd_get(vw->imd));
                        image_osd_set(vw->imd, OSD_SHOW_NOTHING);
-                       image_osd_set(vw->fs->imd, OSD_SHOW_INFO | OSD_SHOW_STATUS);
                        }
                }
 }
index a40fec4..5861c56 100644 (file)
@@ -358,9 +358,9 @@ void layout_image_full_screen_start(LayoutWindow *lw)
        if (lw->tools) gtk_widget_set_sensitive(lw->tools, FALSE);
 #endif
 
-       if (image_osd_get(lw->full_screen->normal_imd, NULL))
+       if (image_osd_get(lw->full_screen->normal_imd) & OSD_SHOW_INFO)
                {
-               image_osd_set(lw->image, OSD_SHOW_INFO | OSD_SHOW_STATUS);
+               image_osd_set(lw->image, image_osd_get(lw->full_screen->normal_imd));
                image_osd_set(lw->full_screen->normal_imd, OSD_SHOW_NOTHING);
                }
 }
@@ -370,10 +370,9 @@ void layout_image_full_screen_stop(LayoutWindow *lw)
        if (!layout_valid(&lw)) return;
        if (!lw->full_screen) return;
 
-       if (image_osd_get(lw->image, NULL))
-               {
-               image_osd_set(lw->full_screen->normal_imd, OSD_SHOW_STATUS);
-               }
+       if (image_osd_get(lw->full_screen->normal_imd) & OSD_SHOW_INFO)
+               image_osd_set(lw->full_screen->normal_imd, image_osd_get(lw->image));
+
        fullscreen_stop(lw->full_screen);
 
 #if 0
index dd22385..838bfc8 100644 (file)
@@ -1209,7 +1209,7 @@ static void exit_program_final(void)
                                            &options->layout.main_window.w, &options->layout.main_window.h);
                        }
 
-               image_osd_get(lw->image, &options->image_overlay.common.enabled);
+               options->image_overlay.common.enabled = image_osd_get(lw->image);
                }
 
        layout_geometry_get_dividers(NULL, &options->layout.main_window.hdivider_pos, &options->layout.main_window.vdivider_pos);