Exemple #1
0
    def ui(self):
        super(NewProjectWidget, self).ui()

        self._search_widget = search.SearchFindWidget()
        self._search_widget.set_placeholder_text('Filter Templates ...')

        self._templates_list = self.TEMPLATES_VIEWER_CLASS(project_class=self._project_class)
        self._templates_list.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)

        project_layout = layouts.HorizontalLayout(spacing=1, margins=(0, 0, 0, 0))

        project_line_layout = layouts.HorizontalLayout(spacing=0, margins=(0, 0, 0, 0))
        project_layout.addLayout(project_line_layout)
        self._project_line = lineedit.BaseLineEdit(parent=self)
        self._project_line.setPlaceholderText('Project Path')
        self._project_line.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self._project_btn = directory.SelectFolderButton(text='', use_app_browser=True)
        project_line_layout.addWidget(self._project_line)
        project_line_layout.addWidget(self._project_btn)
        self._name_line = lineedit.BaseLineEdit(parent=self)
        self._name_line.setPlaceholderText('Project Name')
        project_line_layout.addWidget(dividers.get_horizontal_separator_widget())
        project_line_layout.addWidget(self._name_line)
        self._create_btn = buttons.BaseButton('Create', parent=self)
        self._create_btn.setIcon(resources.icon('create'))
        project_line_layout.addSpacing(10)
        project_line_layout.addWidget(self._create_btn)

        self.main_layout.addWidget(self._search_widget)
        self.main_layout.addWidget(self._templates_list)
        self.main_layout.addLayout(project_layout)
    def ui(self):
        super(SidebarWidget, self).ui()

        self._title_widget = QFrame(self)
        title_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0))
        self._title_widget.setLayout(title_layout)

        buttons_layout = layouts.HorizontalLayout(spacing=0, margins=(0, 0, 0, 0))
        self._title_button = buttons.BaseButton(parent=self)
        self._title_button.setIcon(resources.icon('reset'))
        self._menu_button = buttons.BaseButton(parent=self)
        self._menu_button.setIcon(resources.icon('menu_dots'))
        buttons_layout.addWidget(self._title_button)
        buttons_layout.addStretch()
        buttons_layout.addWidget(self._menu_button)

        self._filter_search = search.SearchFindWidget(parent=self)
        self._filter_search.setVisible(False)

        title_layout.addLayout(buttons_layout)
        title_layout.addWidget(self._filter_search)

        self._tree_widget = SidebarTree(self)
        self._tree_widget.installEventFilter(self)
        self._tree_widget.itemDropped = self.itemDropped
        self._tree_widget.itemRenamed = self.itemRenamed
        self.itemSelectionChanged = self._tree_widget.itemSelectionChanged

        self._filter_search.set_text(self._tree_widget.filter_text())

        self.main_layout.addWidget(self._title_widget)
        self.main_layout.addWidget(self._tree_widget)
Exemple #3
0
    def ui(self):
        super(OpenProjectWidget, self).ui()

        self._search_widget = search.SearchFindWidget()
        self._search_widget.set_placeholder_text('Filter Projects ...')

        self._projects_list = ProjectViewer(project_class=self._project_class)
        self._projects_list.setSizePolicy(QSizePolicy.Expanding,
                                          QSizePolicy.Expanding)

        buttons_layout = layouts.HorizontalLayout(spacing=0,
                                                  margins=(0, 0, 0, 0))
        buttons_layout.setAlignment(Qt.AlignCenter)

        buttons_layout1 = layouts.HorizontalLayout(spacing=0,
                                                   margins=(0, 0, 0, 0))
        buttons_layout1.setAlignment(Qt.AlignLeft)
        self._browse_widget = directory.SelectFolder(
            label_text='Projects Path', use_app_browser=True, use_icon=True)
        buttons_layout1.addWidget(self._browse_widget)

        buttons_layout.addLayout(buttons_layout1)

        self.main_layout.addWidget(self._search_widget)
        self.main_layout.addWidget(
            dividers.Divider('PROJECTS', alignment=Qt.AlignCenter))
        self.main_layout.addWidget(self._projects_list)
        self.main_layout.addLayout(buttons_layout)
    def ui(self):
        super(ArtellaAssetsLibraryWidget, self).ui()

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

        no_assets_widget = QWidget()
        no_assets_layout = QVBoxLayout()
        no_assets_layout.setContentsMargins(2, 2, 2, 2)
        no_assets_layout.setSpacing(2)
        no_assets_widget.setLayout(no_assets_layout)
        no_assets_frame = QFrame()
        no_assets_frame.setFrameShape(QFrame.StyledPanel)
        no_assets_frame.setFrameShadow(QFrame.Sunken)
        no_assets_frame_layout = QHBoxLayout()
        no_assets_frame_layout.setContentsMargins(2, 2, 2, 2)
        no_assets_frame_layout.setSpacing(2)
        no_assets_frame.setLayout(no_assets_frame_layout)
        no_assets_layout.addWidget(no_assets_frame)
        no_assets_found_label = QLabel()
        no_assets_found_pixmap = tp.ResourcesMgr().pixmap('no_assets_found')
        no_assets_found_label.setPixmap(no_assets_found_pixmap)
        no_assets_frame_layout.addItem(
            QSpacerItem(10, 0, QSizePolicy.Expanding, QSizePolicy.Preferred))
        no_assets_frame_layout.addWidget(no_assets_found_label)
        no_assets_frame_layout.addItem(
            QSpacerItem(10, 0, QSizePolicy.Expanding, QSizePolicy.Preferred))

        loading_waiter = waiter.ArtellaWaiter()

        viewer_widget = QWidget()
        viewer_layout = QVBoxLayout()
        viewer_layout.setContentsMargins(2, 2, 2, 2)
        viewer_layout.setSpacing(2)
        viewer_widget.setLayout(viewer_layout)

        self._stack.addWidget(no_assets_widget)
        self._stack.addWidget(viewer_widget)
        self._stack.addWidget(loading_waiter)

        self._search = search.SearchFindWidget()
        self._assets_viewer = assetsviewer.AssetsViewer(project=self._project,
                                                        column_count=2,
                                                        parent=self)
        self._assets_viewer.setSizePolicy(QSizePolicy.Expanding,
                                          QSizePolicy.Expanding)

        self._top_layout = QHBoxLayout()
        self._top_layout.setContentsMargins(0, 0, 0, 0)
        self._top_layout.setSpacing(2)
        self._top_layout.setAlignment(Qt.AlignCenter)
        viewer_layout.addLayout(self._top_layout)

        self._categories_menu_layout = QHBoxLayout()
        self._categories_menu_layout.setContentsMargins(0, 0, 0, 0)
        self._categories_menu_layout.setSpacing(5)
        self._categories_menu_layout.setAlignment(Qt.AlignTop)
        self._top_layout.addLayout(self._categories_menu_layout)

        self._categories_btn_grp = QButtonGroup(self)
        self._categories_btn_grp.setExclusive(True)

        viewer_layout.addWidget(self._search)
        viewer_layout.addWidget(dividers.Divider())
        viewer_layout.addWidget(self._assets_viewer)

        self._supported_types_layout = QHBoxLayout()
        self._supported_types_layout.setContentsMargins(2, 2, 2, 2)
        self._supported_types_layout.setSpacing(2)
        self._supported_types_layout.setAlignment(Qt.AlignTop)
        viewer_layout.addLayout(self._supported_types_layout)

        self._supported_types_btn_grp = QButtonGroup(self)
        self._supported_types_btn_grp.setExclusive(True)

        self._sync_to_latest = QCheckBox('Sync to Latest Version')
        self._sync_to_latest.setChecked(True)
        self._fit_camera_cbx = QCheckBox('Fit Camera')
        self._fit_camera_cbx.setChecked(False)
        viewer_layout.addLayout(dividers.DividerLayout())
        checkboxes_layout = QHBoxLayout()
        checkboxes_layout.setContentsMargins(5, 5, 5, 5)
        checkboxes_layout.setSpacing(2)
        viewer_layout.addLayout(checkboxes_layout)
        checkboxes_layout.addWidget(self._sync_to_latest)
        checkboxes_layout.addWidget(self._fit_camera_cbx)
        checkboxes_layout.addItem(
            QSpacerItem(10, 0, QSizePolicy.Expanding, QSizePolicy.Preferred))
        viewer_layout.addLayout(dividers.DividerLayout())
Exemple #5
0
    def ui(self):
        super(CategoryWidget, self).ui()

        filter_layout = layouts.HorizontalLayout(spacing=2,
                                                 margins=(10, 0, 10, 0))
        self.main_layout.addLayout(filter_layout)
        refresh_icon = resources.icon('refresh')
        self._refresh_list_btn = buttons.IconButton(
            icon=refresh_icon,
            icon_padding=2,
            button_style=buttons.ButtonStyles.FlatStyle)
        self._names_filter = search.SearchFindWidget()
        self._search_lbl = QLabel('0 found')
        filter_layout.addWidget(self._refresh_list_btn)
        filter_layout.addWidget(self._names_filter)
        filter_layout.addWidget(self._search_lbl)

        self._types_layout = layouts.HorizontalLayout(spacing=2,
                                                      margins=(0, 0, 0, 0))
        self.main_layout.addLayout(self._types_layout)

        self._names_list = QTreeWidget(self)
        self._names_list.setHeaderHidden(True)
        self._names_list.setSortingEnabled(False)
        self._names_list.setRootIsDecorated(False)
        self._names_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self._names_list.sortByColumn(0, Qt.AscendingOrder)
        self._names_list.setUniformRowHeights(True)
        self._names_list.setAlternatingRowColors(True)

        self.main_layout.addWidget(self._names_list)

        bottom_buttons_layout = layouts.HorizontalLayout(spacing=2,
                                                         margins=(2, 2, 2, 2))
        bottom_buttons_layout.setAlignment(Qt.AlignLeft)
        self.main_layout.addLayout(bottom_buttons_layout)

        preview_icon = resources.icon('preview')
        self._sort_btn = buttons.BaseButton('Sort', parent=self)
        self._sort_btn.setMinimumWidth(40)
        self._all_btn = buttons.BaseButton('All', parent=self)
        self._all_btn.setMinimumWidth(40)
        self._none_btn = buttons.BaseButton('None', parent=self)
        self._none_btn.setMinimumWidth(40)
        bottom_buttons_layout.addWidget(self._sort_btn)
        bottom_buttons_layout.addWidget(self._all_btn)
        bottom_buttons_layout.addWidget(self._none_btn)

        bottom_buttons_layout.addWidget(
            dividers.get_horizontal_separator_widget())
        self._hide_default_scene_nodes_cbx = checkbox.BaseCheckBox(
            'Hide Default Scene Objects', parent=self)
        self._hide_default_scene_nodes_cbx.setChecked(True)
        bottom_buttons_layout.addWidget(self._hide_default_scene_nodes_cbx)

        self.main_layout.addLayout(dividers.DividerLayout())

        preview_layout = layouts.HorizontalLayout(spacing=2,
                                                  margins=(0, 0, 0, 0))
        self.main_layout.addLayout(preview_layout)

        self._preview_btn = buttons.BaseButton('Preview', parent=self)
        self._preview_btn.setIcon(preview_icon)
        self._preview_btn.setCheckable(True)
        self._preview_btn.setChecked(True)
        self._preview_btn.setMinimumWidth(100)
        self._preview_btn.setMaximumWidth(100)
        self._rename_btn = buttons.BaseButton(
            'Select objects in the list to rename ...', parent=self)
        self._rename_btn.setEnabled(False)
        preview_layout.addWidget(self._preview_btn)
        preview_layout.addWidget(self._rename_btn)

        self._setup_types()
        self.refresh()