comparison src/layout_util.c @ 1860:01a8b98abf09

added Cycle through stereo modes menu entry
author Vladimir Nadvornik <nadvornik@suse.cz>
date Sat, 14 May 2011 22:16:49 +0200
parents 584bff9effee
children d1a5b8633919
comparison
equal deleted inserted replaced
1859:22fe1d41cfa1 1860:01a8b98abf09
834 LayoutWindow *lw = data; 834 LayoutWindow *lw = data;
835 835
836 layout_image_slideshow_pause_toggle(lw); 836 layout_image_slideshow_pause_toggle(lw);
837 } 837 }
838 838
839 /* 839
840 static void layout_menu_stereo_swap_cb(GtkAction *action, gpointer data) 840 static void layout_menu_stereo_mode_next_cb(GtkAction *action, gpointer data)
841 { 841 {
842 LayoutWindow *lw = data; 842 LayoutWindow *lw = data;
843 843 gint mode = layout_image_stereo_pixbuf_get(lw);
844 layout_image_stereo_swap(lw); 844
845 } 845 /* 0->1, 1->2, 2->3, 3->1 - disable auto, then cycle */
846 */ 846 mode = mode % 3 + 1;
847
848 GtkAction *radio = gtk_action_group_get_action(lw->action_group, "StereoAuto");
849 radio_action_set_current_value(GTK_RADIO_ACTION(radio), mode);
850
851 /*
852 this is called via fallback in layout_menu_stereo_mode_cb
853 layout_image_stereo_pixbuf_set(lw, mode);
854 */
855
856 }
857
847 static void layout_menu_stereo_mode_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) 858 static void layout_menu_stereo_mode_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data)
848 { 859 {
849 LayoutWindow *lw = data; 860 LayoutWindow *lw = data;
850 gint mode = gtk_radio_action_get_current_value(action); 861 gint mode = gtk_radio_action_get_current_value(action);
851 layout_image_stereo_pixbuf_set(lw, mode); 862 layout_image_stereo_pixbuf_set(lw, mode);
1369 { "HelpShortcuts", NULL, N_("_Keyboard shortcuts"), NULL, N_("Keyboard shortcuts"), CB(layout_menu_help_keys_cb) }, 1380 { "HelpShortcuts", NULL, N_("_Keyboard shortcuts"), NULL, N_("Keyboard shortcuts"), CB(layout_menu_help_keys_cb) },
1370 { "HelpNotes", NULL, N_("_Release notes"), NULL, N_("Release notes"), CB(layout_menu_notes_cb) }, 1381 { "HelpNotes", NULL, N_("_Release notes"), NULL, N_("Release notes"), CB(layout_menu_notes_cb) },
1371 { "About", GTK_STOCK_ABOUT, N_("_About"), NULL, N_("About"), CB(layout_menu_about_cb) }, 1382 { "About", GTK_STOCK_ABOUT, N_("_About"), NULL, N_("About"), CB(layout_menu_about_cb) },
1372 { "LogWindow", NULL, N_("_Log Window"), NULL, N_("Log Window"), CB(layout_menu_log_window_cb) }, 1383 { "LogWindow", NULL, N_("_Log Window"), NULL, N_("Log Window"), CB(layout_menu_log_window_cb) },
1373 { "ExifWin", NULL, N_("_Exif window"), "<control>E", N_("Exif window"), CB(layout_menu_bar_exif_cb) }, 1384 { "ExifWin", NULL, N_("_Exif window"), "<control>E", N_("Exif window"), CB(layout_menu_bar_exif_cb) },
1385 { "StereoCycle", NULL, N_("_Cycle through stereo modes"), NULL, N_("Cycle through stereo modes"), CB(layout_menu_stereo_mode_next_cb) },
1374 1386
1375 }; 1387 };
1376 1388
1377 static GtkToggleActionEntry menu_toggle_entries[] = { 1389 static GtkToggleActionEntry menu_toggle_entries[] = {
1378 { "Thumbnails", PIXBUF_INLINE_ICON_THUMB,N_("Show _Thumbnails"), "T", N_("Show Thumbnails"), CB(layout_menu_thumb_cb), FALSE }, 1390 { "Thumbnails", PIXBUF_INLINE_ICON_THUMB,N_("Show _Thumbnails"), "T", N_("Show Thumbnails"), CB(layout_menu_thumb_cb), FALSE },
1386 { "UseColorProfiles", GTK_STOCK_SELECT_COLOR, N_("Use _color profiles"), NULL, N_("Use color profiles"), CB(layout_color_menu_enable_cb), FALSE}, 1398 { "UseColorProfiles", GTK_STOCK_SELECT_COLOR, N_("Use _color profiles"), NULL, N_("Use color profiles"), CB(layout_color_menu_enable_cb), FALSE},
1387 { "UseImageProfile", NULL, N_("Use profile from _image"), NULL, N_("Use profile from image"), CB(layout_color_menu_use_image_cb), FALSE}, 1399 { "UseImageProfile", NULL, N_("Use profile from _image"), NULL, N_("Use profile from image"), CB(layout_color_menu_use_image_cb), FALSE},
1388 { "Grayscale", NULL, N_("Toggle _grayscale"), "<shift>G", N_("Toggle grayscale"), CB(layout_menu_alter_desaturate_cb), FALSE}, 1400 { "Grayscale", NULL, N_("Toggle _grayscale"), "<shift>G", N_("Toggle grayscale"), CB(layout_menu_alter_desaturate_cb), FALSE},
1389 { "ImageOverlay", NULL, N_("Image _Overlay"), NULL, N_("Image Overlay"), CB(layout_menu_overlay_cb), FALSE }, 1401 { "ImageOverlay", NULL, N_("Image _Overlay"), NULL, N_("Image Overlay"), CB(layout_menu_overlay_cb), FALSE },
1390 { "ImageHistogram", NULL, N_("_Show Histogram"), NULL, N_("Show Histogram"), CB(layout_menu_histogram_cb), FALSE }, 1402 { "ImageHistogram", NULL, N_("_Show Histogram"), NULL, N_("Show Histogram"), CB(layout_menu_histogram_cb), FALSE },
1391 /*
1392 { "StereoSwap", NULL, N_("Swap stereo images"), NULL, N_("Swap stereo images"), CB(layout_menu_stereo_swap_cb), FALSE },
1393 */
1394 }; 1403 };
1395 1404
1396 static GtkRadioActionEntry menu_radio_entries[] = { 1405 static GtkRadioActionEntry menu_radio_entries[] = {
1397 { "ViewList", NULL, N_("Image _List"), "<control>L", N_("View Images as List"), FILEVIEW_LIST }, 1406 { "ViewList", NULL, N_("Image _List"), "<control>L", N_("View Images as List"), FILEVIEW_LIST },
1398 { "ViewIcons", NULL, N_("I_cons"), "<control>I", N_("View Images as Icons"), FILEVIEW_ICON } 1407 { "ViewIcons", NULL, N_("I_cons"), "<control>I", N_("View Images as Icons"), FILEVIEW_ICON }
1580 " <menu action='StereoMenu'>" 1589 " <menu action='StereoMenu'>"
1581 " <menuitem action='StereoAuto'/>" 1590 " <menuitem action='StereoAuto'/>"
1582 " <menuitem action='StereoSBS'/>" 1591 " <menuitem action='StereoSBS'/>"
1583 " <menuitem action='StereoCross'/>" 1592 " <menuitem action='StereoCross'/>"
1584 " <menuitem action='StereoOff'/>" 1593 " <menuitem action='StereoOff'/>"
1594 " <separator/>"
1595 " <menuitem action='StereoCycle'/>"
1585 " </menu>" 1596 " </menu>"
1586 " <menu action='ColorMenu'>" 1597 " <menu action='ColorMenu'>"
1587 " <menuitem action='UseColorProfiles'/>" 1598 " <menuitem action='UseColorProfiles'/>"
1588 " <menuitem action='UseImageProfile'/>" 1599 " <menuitem action='UseImageProfile'/>"
1589 " <menuitem action='ColorProfile0'/>" 1600 " <menuitem action='ColorProfile0'/>"