Commits

arum...@gmail.com  committed 5abc171

Add "Full Screen" menu item.

  • Participants
  • Parent commits 6a5701a

Comments (0)

Files changed (1)

 
         self.connect('destroy', self.close_window)
 
+        self.is_fullscreen = False
         self._timer_id = None
 
         config = {}
         menu = terminal.create_popup()
 
         open_term_item = gtk.MenuItem('Open _Terminal')
+        fullscreen_item = gtk.CheckMenuItem('_Full Screen')
+        if self.is_fullscreen:
+            fullscreen_item.set_active(True)
 
         split_vert_item = gtk.MenuItem('Split Frame _Vertically')
         split_horiz_item = gtk.MenuItem('Split Frame _Horizontally')
         menu.prepend(split_horiz_item)
         menu.prepend(split_vert_item)
         menu.prepend(gtk.SeparatorMenuItem())
+        menu.prepend(fullscreen_item)
         menu.prepend(open_term_item)
 
         open_term_item.connect('activate', lambda x: MainWindow(self.opts))
+        fullscreen_item.connect('toggled', self.toggle_fullscreen)
         split_vert_item.connect('activate',
                 lambda x: self.split_frame_vertically(terminal))
         split_horiz_item.connect('activate',
 
         return menu
 
+    def toggle_fullscreen(self, fullscreen_item):
+        if fullscreen_item.get_active():
+            self.fullscreen()
+            self.is_fullscreen = True
+        else:
+            self.unfullscreen()
+            self.is_fullscreen = False
+
     def toggle_term_sync(self, sync_frame_item, terminal):
         if sync_frame_item.get_active():
             synced_terminal.append(terminal)