def get_screen_resolution(self): """ """ widget = QDesktopWidget() geometry = widget.availableGeometry(widget.primaryScreen()) value = "{0}x{1}".format(geometry.width(), geometry.height()) return value
def get_screen_size(): """Get **available** screen size/resolution.""" if mpl.get_backend().startswith('Qt'): # Inspired by spyder/widgets/shortcutssummary.py from qtpy.QtWidgets import QDesktopWidget # noqa widget = QDesktopWidget() sg = widget.availableGeometry(widget.primaryScreen()) x0 = sg.x() y0 = sg.y() w0 = sg.width() h0 = sg.height() elif mpl.get_backend() == "TkAgg": # https://stackoverflow.com/a/42951711/38281 window = plt.get_current_fig_manager().window x0, y0 = 0, 0 w0, h0 = window.wm_maxsize() # h = window.winfo_screenheight() # w = window.winfo_screenwidth() else: # Mac Retina Early 2013 x0 = 0 y0 = 23 w0 = 1280 h0 = 773 return x0, y0, w0, h0
def get_screen_resolution(): """Return the screen resolution of the primary screen.""" try: widget = QDesktopWidget() geometry = widget.availableGeometry(widget.primaryScreen()) value = "{0}x{1}".format(geometry.width(), geometry.height()) except Exception: value = None return value
def get_screen_size(): """Get **available** screen size/resolution.""" if mpl.get_backend().startswith('Qt'): # Inspired by spyder/widgets/shortcutssummary.py from qtpy.QtWidgets import QDesktopWidget widget = QDesktopWidget() sg = widget.availableGeometry(widget.primaryScreen()) x0 = sg.x() y0 = sg.y() w0 = sg.width() h0 = sg.height() else: # Mac Retina Early 2013 x0 = 0 y0 = 23 w0 = 1280 h0 = 773 return x0, y0, w0, h0
def get_screen_resolution(self): """Return the screen resolution of the primary screen.""" widget = QDesktopWidget() geometry = widget.availableGeometry(widget.primaryScreen()) return geometry.width(), geometry.height()
def get_screen_resolution(self): """Return the screen resolution of the primary screen.""" widget = QDesktopWidget() geometry = widget.availableGeometry(widget.primaryScreen()) return geometry.width(), geometry.height()