Beispiel #1
0
    def __init__(self, project, parent=None):
        super(PanelsWidget, self).__init__(parent=parent)
        self._project = project
        self._tree = qtgui.QTreeWidget()

        layout = qtgui.QVBoxLayout()
        layout.addWidget(self._tree)
        self.setLayout(layout)
Beispiel #2
0
    def __init__(self, project=None, parent=None):
        super(ProjectWidget, self).__init__(parent=parent)
        self._editor_widget = EditorWidget(project)
        self._editor_widget._panels_widget._tree.model().layoutChanged.connect(
            self._refresh_content)
        self._project = None
        self._live_edit = False
        self._live_thread = ReloadProjectThread()

        self._live_thread.project_changed.connect(self._do_update)
        self._live_edit_action = self._create_live_edit_action()
        self._about_action = self._create_about_action()
        self._open_project_action = self._create_open_project_action()
        self._edit_project_action = self._create_edit_project()
        self._close_project_action = self._create_close_project_action()
        self._about_toolbox_action = self._create_about_toolbox_action()
        self._new_panel_action = self._create_new_panel_action()
        self._new_project_action = self._create_new_project_action()
        self._reload_action = self._create_reload_action()
        self._close_action = self._create_close_action()
        self._actions_action = self._create_editor_action()

        menu = qtgui.QMenuBar()
        self._menu_bar = menu
        file_menu = menu.addMenu('File')
        file_menu.addAction(self._new_project_action)
        file_menu.addAction(self._open_project_action)
        file_menu.addAction(self._close_project_action)
        file_menu.addSeparator()
        file_menu.addAction(self._reload_action)
        file_menu.addAction(self._edit_project_action)
        file_menu.addSeparator()
        file_menu.addAction(self._new_panel_action)
        file_menu.addSeparator()
        file_menu.addAction(self._close_action)

        tools_menu = menu.addMenu('Tools')
        tools_menu.addAction(self._live_edit_action)
        tools_menu.addSeparator()
        tools_menu.addAction(self._actions_action)
        help_menu = menu.addMenu('Help')
        help_menu.addAction(self._about_action)
        help_menu.addSeparator()
        help_menu.addAction(self._about_toolbox_action)

        layout = qtgui.QVBoxLayout()
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)

        self._scroll_area = self._make_scroll_area()

        self.setLayout(layout)
        layout.addWidget(menu)
        layout.addWidget(self._scroll_area)

        # set the project which will trigger the refresh
        self.project = project
Beispiel #3
0
    def __init__(self, project=None, parent=None):
        """construct the browser
        """
        super(PanelsWidget, self).__init__(parent=parent)
        self.setWindowTitle('Panels Browser')
        self._project = project
        self._tree_model = PanelsModel(project)
        self._tree = self._create_panels_tree_widget(self._tree_model)

        layout = qtgui.QVBoxLayout()
        layout.addWidget(self._tree)

        self.setLayout(layout)
Beispiel #4
0
    def __init__(self, project=None, parent=None):
        """construct the browser
        """
        super(ActionsWidget, self).__init__(parent=parent)
        self.setWindowTitle('Actions Browser')
        self._project = project
        self._tree_widget = self._create_actions_tree_widget()

        layout = qtgui.QVBoxLayout()
        layout.addWidget(self._tree_widget)

        self.setLayout(layout)
        layout.addWidget(self._tree_widget)
        self._refresh_content()
Beispiel #5
0
    def __init__(self, panel=None, parent=None):
        super(PanelWidget, self).__init__(parent=parent)
        self.panel = panel
        self.setAcceptDrops(True)

        self.style = create_style(panel.style, panel)

        layout = qtgui.QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)

        layout.addWidget(self.style)

        self.setLayout(layout)
        self._refresh_content()
Beispiel #6
0
    def __init__(self, project=None, parent=None):
        """settings and context are given for the init
        """
        super(MayaProjectWidget, self).__init__()
        layout = qtgui.QVBoxLayout()
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)
        self._toolbox_widget = ProjectWidget(project)
        layout.addWidget(self._toolbox_widget)
        self.setWindowTitle(self._toolbox_widget.windowTitle())

        # wrap the set window title so we keep it in sync
        self._toolbox_widget.setWindowTitle = self._wrapped_set_window_title(
            self._toolbox_widget.setWindowTitle)
Beispiel #7
0
    def __init__(self, panel, settings, parent=None):
        super(DropdownStyle, self).__init__(panel, settings, parent=parent)
        self._content = []
        self._menu = qtgui.QMenu()
        self._menu.aboutToShow.connect(self._handle_about_to_show)

        self._button = qtgui.QPushButton(self.panel.human_label)

        self._button.setMenu(self._menu)
        self._button.setIcon(qtgui.QIcon(self.panel.absolute_icon_filepath))
        self._button.setIconSize(utils.get_icon_size(self.panel.icon_size))

        layout = qtgui.QVBoxLayout()
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)
        layout.addWidget(self._button)
Beispiel #8
0
    def __init__(self,
                 content=None,
                 show_icons=True,
                 show_text=True,
                 icon_size=None,
                 parent=None):
        """construct the button
        """
        super(ContentWidget, self).__init__(parent=parent)
        self.content = content
        self.show_text = show_text
        self.show_icons = show_icons
        self.icon_size = icon_size

        layout = qtgui.QVBoxLayout()
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)
        self._refresh_content()
Beispiel #9
0
    def __init__(self,
                 action=None,
                 show_text=True,
                 show_icons=True,
                 icon_size=None,
                 parent=None):
        super(ActionWidget, self).__init__(parent=parent)
        self.action = action
        self._button = qtgui.QPushButton()
        self.show_text = show_text
        self.show_icons = show_icons
        self.icon_size = icon_size

        layout = qtgui.QVBoxLayout()
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)

        self.setLayout(layout)
        layout.addWidget(self._button)
        self._refresh_content()
Beispiel #10
0
    def _refresh_content(self):
        """refresh the content of the panel that we are viewing
        """

        if self.project:
            self._menu_bar.setVisible(self.project.menu_bar_visible)
            self.setStyleSheet(self.project.style_sheet)
            window_title = self.project.human_name
            if self.project.version:
                window_title += " " + str(self.project.version)
            self.setWindowTitle(window_title)
            icon_filepath = self.project.absolute_icon_filepath
            if icon_filepath and os.path.exists(icon_filepath):
                icon = qtgui.QIcon(icon_filepath)
                self.setWindowIcon(icon)
            else:
                # clear the icon
                self.setWindowIcon(qtgui.QIcon())

            if self.project.active_panel:
                widget = MainPanelWidget(self.project.active_panel)
                main_widget = qtgui.QWidget()
                main_layout = qtgui.QVBoxLayout()
                main_widget.setLayout(main_layout)
                main_layout.addWidget(widget)
                self._scroll_area.setWidget(main_widget)

                # self._scroll_area.setWidget(widget)
            else:
                self._scroll_area.setWidget(qtgui.QWidget())
        else:
            self._menu_bar.setVisible(True)
            self.setStyleSheet('')
            self.setWindowTitle('SF ToolBox')
            self.setWindowIcon(qtgui.QIcon())
            self._scroll_area.setWidget(qtgui.QWidget())
Beispiel #11
0
 def __init__(self, panel, settings, parent=None):
     super(VerticalStyle, self).__init__(panel, settings, parent=parent)
     layout = qtgui.QVBoxLayout()
     layout.setSpacing(0)
     layout.setContentsMargins(0, 0, 0, 0)
     self.setLayout(layout)