Commits

Anonymous committed 81126fd

(mac) added Esc shortcut to get out of fullscreen mode

Comments (0)

Files changed (2)

notalonlib/window.py

             viewfullscreen = FM.FlatMenuItem(viewmenu, wx.NewId(), _("&Fullscreen \tCtrl+Shift+J"), _(" View fullscreen"), wx.ITEM_NORMAL, None, self.resin.getImage("viewfullscreen"))
             viewmenu.AppendItem(viewfullscreen)
 
+            if MAC:
+                viewwindowed = FM.FlatMenuItem(viewmenu, wx.NewId(), _("&Normal \tEscape"), _(" View windowed"), wx.ITEM_NORMAL, None, self.resin.getImage("viewwindowed"))
+                viewmenu.AppendItem(viewwindowed)
+
             inserttab = FM.FlatMenuItem(insertmenu, wx.NewId(), _("&Tab\tTab"), _("Insert tab"), wx.ITEM_NORMAL, None, self.resin.getImage("indent"))
             insertmenu.AppendItem(inserttab)
 
             self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateItalicize, formatitalicize)
 
             self.Bind(FM.EVT_FLAT_MENU_SELECTED, self.OnFullscreen, viewfullscreen)
+            if MAC:
+                self.Bind(FM.EVT_FLAT_MENU_SELECTED, self.OnWindowed, viewwindowed)
 
             self.Bind(FM.EVT_FLAT_MENU_SELECTED, self.tree.OnAddNode, editaddnode)
             self.Bind(FM.EVT_FLAT_MENU_SELECTED, self.tree.OnDeleteNode, editdeletenode)
             viewfullscreen = viewmenu.Append(wx.NewId(), _("&Fullscreen \tCtrl+Shift+J"), _(" View fullscreen"))
             viewfullscreen.SetBitmap(self.resin.getImage("viewfullscreen"))
 
+            if MAC:
+                viewwindowed = viewmenu.Append(wx.NewId(), _("&Normal \tEscape"), _(" View windowed"))
+                viewwindowed.SetBitmap(self.resin.getImage("viewwindowed"))
+
             inserttab = insertmenu.Append(wx.NewId(), _("&Tab\tTab"), _("Insert tab"))
             inserttab.SetBitmap(self.resin.getImage("indent"))
 
             self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateItalicize, formatitalicize)
 
             self.Bind(wx.EVT_MENU, self.OnFullscreen, viewfullscreen)
+            if MAC:
+                self.Bind(wx.EVT_MENU, self.OnWindowed, viewwindowed)
 
             self.Bind(wx.EVT_MENU, self.tree.OnAddNode, editaddnode)
             self.Bind(wx.EVT_MENU, self.tree.OnDeleteNode, editdeletenode)
         log.debug('Cleared file history')
 
     def OnFullscreen(self, e):
+        """Toggle fullscreen."""
         log.debug('Fullscreen mode: %s' % str(self.fullscreen))
         self.fullscreen = not self.fullscreen
         self.ShowFullScreen(self.fullscreen)
 
+    def OnWindowed(self, e):
+        """Like :meth:`OnFullscreen`, but only switches out of fullscreen,
+        doesn't toggle back into it.
+        
+        """
+        print 'lol'
+
+        if self.fullscreen:
+            self.OnFullscreen(e)
+
     def ShowTips(self):
         """Shows the tips window on startup; returns False if the option to
         turn off tips is checked.

res/default.neme

Binary file modified.