Ejemplo n.º 1
0
 def on_collapse_button_clicked(self, button):
     upper_page_num = self.view['upper_notebook'].get_current_page()
     upper_notebook_title = gui_helper_label.get_notebook_tab_title(self.view['upper_notebook'], upper_page_num)
     lower_page_num = self.view['lower_notebook'].get_current_page()
     lower_notebook_title = gui_helper_label.get_notebook_tab_title(self.view['lower_notebook'], lower_page_num)
     if any(['LIBRARIES' in title for title in [upper_notebook_title, lower_notebook_title]]):
         self.get_controller('library_controller').view.collapse_all()
     if any(["STATES TREE" in title for title in [upper_notebook_title, lower_notebook_title]]):
         self.get_controller('state_machine_tree_controller').view.collapse_all()
Ejemplo n.º 2
0
 def on_switch_page_check_collapse_button(self, notebook, page_num):
     upper_page_num = self.view['upper_notebook'].get_current_page() if notebook is not self.view['upper_notebook'] else page_num
     upper_notebook_title = gui_helper_label.get_notebook_tab_title(self.view['upper_notebook'], upper_page_num)
     lower_page_num = self.view['lower_notebook'].get_current_page() if notebook is not self.view['lower_notebook'] else page_num
     lower_notebook_title = gui_helper_label.get_notebook_tab_title(self.view['lower_notebook'], lower_page_num)
     if any([title in upper_notebook_title for title in ['LIBRARIES', "STATES TREE"]]) or \
             any([title in lower_notebook_title for title in ['LIBRARIES', "STATES TREE"]]):
         self.view["collapse_tree_button"].show()
     else:
         self.view["collapse_tree_button"].hide()
Ejemplo n.º 3
0
    def bring_tab_to_the_top(self, tab_label):
        """Find tab with label tab_label in list of notebooks and set it to the current page.

        :param tab_label: String containing the label of the tab to be focused
        """
        found = False
        for notebook in self.left_bar_notebooks:
            for i in range(notebook.get_n_pages()):
                if gui_helper_label.get_notebook_tab_title(notebook, i) == gui_helper_label.get_widget_title(tab_label):
                    found = True
                    break
            if found:
                notebook.set_current_page(i)
                break