![]() isVisible (): continue yield ( w ) except Exception : continue def show_menu_under_widget ( gui, menu, action, name ): # First try the tool bar for w in toolbar_widgets_for_action ( gui, action ): try : # The w.height() assures that the menu opens below the button. x () = 0 : continue # The button might be hidden if not w. widgetForAction ( action ) # It seems that multiple copies of the action can exist, such as # when the device-connected menu is changed while the device is # connected. ![]() #!/usr/bin/env python _license_ = 'GPL v3' _copyright_ = '2010, Kovid Goyal ' _docformat_ = 'restructuredtext en' from functools import partial from zipfile import ZipFile from qt.core import ( QToolButton, QAction, QIcon, QObject, QMenu, QPoint, QKeySequence ) from calibre import prints from nstants import ismacos from calibre.gui2 import Dispatcher from import NameConflict from polyglot.builtins import string_or_bytes def toolbar_widgets_for_action ( gui, action ): # Search the the toolbars for the widget associated with an action, passing # them to the caller for further processing for x in gui. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |