Ejemplo n.º 1
0
    def ui(self):
        super(ToolbarExampleWidget, self).ui()

        self._stack = stack.SlidingOpacityStackedWidget(parent=self)
        self.main_layout.addWidget(self._stack)

        for widget in [self._toolbar_example()]:
            self._stack.addWidget(widget)
Ejemplo n.º 2
0
    def ui(self):
        super(ScriptEditorView, self).ui()

        self._stack = stack.SlidingOpacityStackedWidget(parent=self)
        main_splitter = QSplitter(Qt.Vertical, parent=self)
        self._output_console = console.OutputConsole(parent=self)
        # NOTE: Scripts Tab MUST pass ScriptEditor as parent because internally some ScriptEditor functions
        # NOTE: are connected to some signals. If we don't do this Maya will crash when opening new Script Editors :)
        self._scripts_tab = script.ScriptsTab(controller=self._controller,
                                              parent=self)

        main_splitter.addWidget(self._output_console)
        main_splitter.addWidget(self._scripts_tab)

        self._menu_bar = self._setup_menubar()
        self._tool_bar = self._setup_toolbar()
        self._tool_bar_divider = dividers.Divider()

        # Empty widget
        empty_widget = QWidget(self)
        empty_layout = layouts.HorizontalLayout(spacing=5,
                                                margins=(5, 5, 5, 5))
        empty_widget.setLayout(empty_layout)
        main_empty_layout = layouts.VerticalLayout(spacing=5,
                                                   margins=(5, 5, 5, 5))
        self._empty_label = label.BaseLabel('No Scripts Opened',
                                            parent=self).h4().strong()
        self._empty_label.setAlignment(Qt.AlignCenter)
        main_empty_layout.addStretch()
        main_empty_layout.addWidget(self._empty_label)
        main_empty_layout.addStretch()
        empty_layout.addStretch()
        empty_layout.addLayout(main_empty_layout)
        empty_layout.addStretch()

        self._stack.addWidget(empty_widget)
        self._stack.addWidget(main_splitter)

        self.main_layout.addWidget(self._menu_bar)
        self.main_layout.addWidget(self._tool_bar)
        self.main_layout.addWidget(self._tool_bar_divider)
        self.main_layout.addWidget(self._stack)
Ejemplo n.º 3
0
    def ui(self):
        super(ArtellaLauncher, self).ui()

        self._stack = stack.SlidingOpacityStackedWidget()
        self.main_layout.addWidget(self._stack)

        self._wait_widget = waitconnection.WaitConnectionWidget(parent=self)
        self._plugins_tab = tabs.BaseEditableTabWidget(parent=self)
        self._plugins_tab.tabBar().add_tab_btn.setVisible(False)

        self._stack.addWidget(self._wait_widget)
        self._stack.addWidget(self._plugins_tab)

        self._plugins_panel = pluginspanel.PluginsPanel(project=self._project)
        self._plugins_tab.addTab(self._plugins_panel, 'HOME')
        self._plugins_tab.setTabIcon(0, tpDcc.ResourcesMgr().icon('home'))
        tab_btn = self._plugins_tab.tabBar().tabButton(0, QTabBar.RightSide)
        if tab_btn:
            tab_btn.resize(0, 0)
        self._plugins_tab.tabBar().set_is_editable(False)
Ejemplo n.º 4
0
    def ui(self):
        super(MenuLineTabWidget, self).ui()

        self._tool_button_group = MenuLineButtonGroup()
        self._bar_layout = layouts.HorizontalLayout(margins=(0, 0, 0, 0))
        if self._alignment == Qt.AlignCenter:
            self._bar_layout.addStretch()
            self._bar_layout.addWidget(self._tool_button_group)
            self._bar_layout.addStretch()
        elif self._alignment == Qt.AlignLeft:
            self._bar_layout.addWidget(self._tool_button_group)
            self._bar_layout.addStretch()
        elif self._alignment == Qt.AlignRight:
            self._bar_layout.addStretch()
            self._bar_layout.addWidget(self._tool_button_group)
        self._stack = stack.SlidingOpacityStackedWidget()
        self._tool_button_group.checkedChanged.connect(
            self._stack.setCurrentIndex)
        self.main_layout.addLayout(self._bar_layout)
        self.main_layout.addWidget(dividers.Divider())
        self.main_layout.addSpacing(5)
        self.main_layout.addWidget(self._stack)
Ejemplo n.º 5
0
    def ui(self):
        super(ToolsetWidget, self).ui()

        self.setContentsMargins(0, 0, 0, 0)
        self._contents_layout.setContentsMargins(0, 0, 0, 0)
        self._contents_layout.setSpacing(0)

        self._stacked_widget = stack.SlidingOpacityStackedWidget(self)
        # NOTE: tpDcc style uses this objectName to apply specific style to this widget
        self._stacked_widget.setObjectName('toolsetStackedWidget')
        self._stacked_widget.setContentsMargins(0, 0, 0, 0)
        self._stacked_widget.setLineWidth(0)
        self.main_layout.addWidget(self._stacked_widget)

        self.show_expand_indicator(False)
        self.set_title_text_mouse_transparent(True)

        self._display_mode_button = DisplayModeButton(color=self._icon_color,
                                                      size=16,
                                                      parent=self)
        self._display_mode_button.setFixedSize(QSize(22, 22))
        self._connect_button = buttons.BaseToolButton(
            parent=self).image('connect').icon_only()
        self._connect_button.setFixedSize(QSize(22, 22))
        self._connect_button.setEnabled(False)
        self._connect_button.setToolTip('No connected to any DCC')
        self._manual_button = buttons.BaseMenuButton(parent=self)
        self._manual_button.set_icon(resources.icon('manual'))
        self._manual_button.setFixedSize(QSize(22, 22))
        self._help_button = buttons.BaseMenuButton(parent=self)
        self._help_button.set_icon(resources.icon('help'))
        self._help_button.setFixedSize(QSize(22, 22))
        self._help_switch = switch.SwitchWidget(parent=self)
        self._settings_button = buttons.BaseMenuButton(parent=self)
        self._settings_button.set_icon(resources.icon('settings'))
        self._settings_button.setFixedSize(QSize(22, 22))
        self._help_widget = ToolsetHelpWidget()

        empty_widget = QWidget()
        empty_layout = layouts.HorizontalLayout(spacing=0,
                                                margins=(0, 0, 0, 0))
        empty_widget.setLayout(empty_layout)
        empty_layout.addStretch()
        empty_label = label.BaseLabel('Tool has no UI')
        empty_label.theme_level = label.BaseLabel.Levels.H1
        empty_layout.addWidget(empty_label)
        empty_layout.addStretch()

        self._preferences_widget = preferences.PreferencesWidget(parent=self)

        # We call if after setting all buttons
        self.set_icon_color(self._icon_color)

        self.visual_update(collapse=True)

        self._dccs_menu = QMenu(self)

        display_button_pos = 7
        self._title_frame.horizontal_layout.insertWidget(
            display_button_pos - 1, self._manual_button)
        self._title_frame.horizontal_layout.insertWidget(
            display_button_pos - 1, self._help_switch)
        self._title_frame.horizontal_layout.insertWidget(
            display_button_pos - 1, self._help_button)
        self._title_frame.horizontal_layout.insertWidget(
            display_button_pos - 1, self._settings_button)
        self._title_frame.horizontal_layout.insertWidget(
            0, self._connect_button)
        self._title_frame.horizontal_layout.insertWidget(
            display_button_pos, self._display_mode_button)
        self._title_frame.horizontal_layout.setSpacing(0)
        self._title_frame.horizontal_layout.setContentsMargins(0, 0, 0, 0)
        self._title_frame.delete_button.setIconSize(QSize(12, 12))
        self._title_frame.item_icon_button.setIconSize(QSize(20, 20))

        font = QFont()
        font.setBold(True)
        self.setFont(font)

        if not dcc.is_standalone():
            self._connect_button.setVisible(False)

        self._stacked_widget.addWidget(empty_widget)
        self._stacked_widget.addWidget(self._widget_hider)
        self._stacked_widget.addWidget(self._preferences_widget)

        self._widget_hider.setVisible(False)
        self._preferences_widget.setVisible(False)