diff cagou/core/cagou_main.py @ 373:5d994be1161b

core: removed root menus (i.e. global menu on top of window): root menus were not really useful as most actions doable there are doable through others widgets in Cagou. For actions without equivalent in widgets (like about screen), a new menu, more discreet, will be added soon. Kivy Garden's ContextMenu is not used anymore, so it has been removed from dependencies
author Goffi <goffi@goffi.org>
date Mon, 27 Jan 2020 21:17:09 +0100
parents 1a12bbd80943
children ae9059b791fe
line wrap: on
line diff
--- a/cagou/core/cagou_main.py	Mon Jan 27 21:17:08 2020 +0100
+++ b/cagou/core/cagou_main.py	Mon Jan 27 21:17:09 2020 +0100
@@ -66,7 +66,6 @@
 from .share_widget import ShareWidget
 from . import widgets_handler
 from .common import IconButton
-from . import menu
 from . import dialog
 from importlib import import_module
 import sat
@@ -220,16 +219,11 @@
         self.manager.switch_to(screen)
 
 
-class RootMenus(menu.MenusWidget):
-    HEIGHT = dp(30)
-
-
 class RootBody(BoxLayout):
     pass
 
 
 class CagouRootWidget(FloatLayout):
-    root_menus = properties.ObjectProperty()
     root_body = properties.ObjectProperty
 
     def __init__(self, main_widget):
@@ -365,14 +359,6 @@
             else:
                 Window.fullscreen = False
             return True
-        elif key == 109 and modifier == ['alt']:
-            # M-m we hide/show menu
-            menu = self.root.root_menus
-            if menu.height:
-                Animation(height=0, duration=0.3).start(menu)
-            else:
-                Animation(height=menu.HEIGHT, duration=0.3).start(menu)
-            return True
         elif key == 110 and modifier == ['alt']:
             # M-n we hide/show notifications
             head = self.root.head_widget
@@ -908,16 +894,6 @@
             self.switchWidget(None,
                 factory(plg_infos, target=target, profiles=profiles))
 
-    ## menus ##
-
-    def _menusGetCb(self, backend_menus):
-        main_menu = self.app.root.root_menus
-        self.menus.addMenus(backend_menus)
-        self.menus.addMenu(C.MENU_GLOBAL,
-                           (_("Help"), _("About")),
-                           callback=main_menu.onAbout)
-        main_menu.update(C.MENU_GLOBAL)
-
     ## bridge handlers ##
 
     def otrStateHandler(self, state, dest_jid, profile):
@@ -953,7 +929,6 @@
     def plugging_profiles(self):
         self.widgets_handler = widgets_handler.WidgetsHandler()
         self.app.root.changeWidget(self.widgets_handler)
-        self.bridge.menusGet("", C.NO_SECURITY_LIMIT, callback=self._menusGetCb)
 
     def setPresenceStatus(self, show='', status=None, profile=C.PROF_KEY_NONE):
         log.info("Profile presence status set to {show}/{status}".format(show=show,