menu: add View menu with fullscreen item

This commit is contained in:
Stefan Sauer 2010-12-21 13:18:38 +02:00
parent ab4afec78b
commit ff0b99ecbf

View file

@ -88,6 +88,17 @@ public class MediaInfo.App : Window
sub_menu.append (item); sub_menu.append (item);
item.activate.connect (Gtk.main_quit); item.activate.connect (Gtk.main_quit);
item = new MenuItem.with_label (_("View"));
menu_bar.append (item);
sub_menu = new Menu ();
item.set_submenu (sub_menu);
// TODO: need F11 accelerator
CheckMenuItem citem = new CheckMenuItem.with_label (_("Full Screen"));
sub_menu.append (citem);
citem.toggled.connect (on_fullscreen_toggled);
// TODO: add "help" menu with "about" item // TODO: add "help" menu with "about" item
return (menu_bar); return (menu_bar);
@ -105,5 +116,14 @@ public class MediaInfo.App : Window
} }
chooser.set_preview_widget_active (res); chooser.set_preview_widget_active (res);
} }
private void on_fullscreen_toggled (CheckMenuItem item)
{
if (item.active) {
fullscreen();
} else {
unfullscreen();
}
}
} }