def figbrowser(qtbot): """An empty figure browser widget fixture.""" figbrowser = FigureBrowser() figbrowser.set_shellwidget(Mock()) figbrowser.setup(mute_inline_plotting=True, show_plot_outline=False) qtbot.addWidget(figbrowser) figbrowser.show() figbrowser.setMinimumSize(700, 500) return figbrowser
def figbrowser(qtbot): """An empty figure browser widget fixture.""" figbrowser = FigureBrowser() figbrowser.set_shellwidget(Mock()) figbrowser.setup(mute_inline_plotting=True, show_plot_outline=False) qtbot.addWidget(figbrowser) figbrowser.show() figbrowser.setMinimumSize(700, 500) return figbrowser
def figbrowser(qtbot): """An empty figure browser widget fixture.""" figbrowser = FigureBrowser() figbrowser.set_shellwidget(Mock()) options = { 'mute_inline_plotting': True, 'show_plot_outline': False, 'auto_fit_plotting': False, } figbrowser.setup(options) qtbot.addWidget(figbrowser) figbrowser.show() figbrowser.setMinimumSize(700, 500) return figbrowser
def add_shellwidget(self, shellwidget): """ Register shell with figure explorer. This function opens a new FigureBrowser for browsing the figures in the shell. """ shellwidget_id = id(shellwidget) if shellwidget_id not in self.shellwidgets: self.options_button.setVisible(True) fig_browser = FigureBrowser(self, options_button=self.options_button) fig_browser.set_shellwidget(shellwidget) fig_browser.setup(**self.get_settings()) fig_browser.sig_option_changed.connect( self.sig_option_changed.emit) fig_browser.thumbnails_sb.redirect_stdio.connect( self.main.redirect_internalshell_stdio) self.add_widget(fig_browser) self.shellwidgets[shellwidget_id] = fig_browser self.set_shellwidget_from_id(shellwidget_id) return fig_browser
def add_shellwidget(self, shellwidget): """ Register shell with figure explorer. This function opens a new FigureBrowser for browsing the figures in the shell. """ shellwidget_id = id(shellwidget) if shellwidget_id not in self.shellwidgets: self.options_button.setVisible(True) fig_browser = FigureBrowser( self, options_button=self.options_button, background_color=MAIN_BG_COLOR) fig_browser.set_shellwidget(shellwidget) fig_browser.setup(**self.get_settings()) fig_browser.sig_option_changed.connect( self.sig_option_changed.emit) fig_browser.thumbnails_sb.redirect_stdio.connect( self.main.redirect_internalshell_stdio) self.add_widget(fig_browser) self.shellwidgets[shellwidget_id] = fig_browser self.set_shellwidget_from_id(shellwidget_id) return fig_browser