def setup_ui(self): """Build the UI""" # Assets (left) asset_outliner = widgets.AssetOutliner() # Looks (right) looks_widget = QtWidgets.QWidget() looks_layout = QtWidgets.QVBoxLayout(looks_widget) look_outliner = widgets.LookOutliner() # Database look overview assign_selected = QtWidgets.QCheckBox("Assign to selected only") assign_selected.setToolTip("Whether to assign only to selected nodes " "or to the full asset") remove_unused_btn = QtWidgets.QPushButton("Remove Unused Looks") looks_layout.addWidget(look_outliner) looks_layout.addWidget(assign_selected) looks_layout.addWidget(remove_unused_btn) # Footer status = QtWidgets.QStatusBar() status.setSizeGripEnabled(False) status.setFixedHeight(25) warn_layer = QtWidgets.QLabel("Current Layer is not " "defaultRenderLayer") warn_layer.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) warn_layer.setStyleSheet("color: #DD5555; font-weight: bold;") warn_layer.setFixedHeight(25) footer = QtWidgets.QHBoxLayout() footer.setContentsMargins(0, 0, 0, 0) footer.addWidget(status) footer.addWidget(warn_layer) # Build up widgets main_layout = QtWidgets.QVBoxLayout(self) main_layout.setSpacing(0) main_splitter = QtWidgets.QSplitter() main_splitter.setStyleSheet("QSplitter{ border: 0px; }") main_splitter.addWidget(asset_outliner) main_splitter.addWidget(looks_widget) main_splitter.setSizes([350, 200]) main_layout.addWidget(main_splitter) main_layout.addLayout(footer) # Set column width asset_outliner.view.setColumnWidth(0, 200) look_outliner.view.setColumnWidth(0, 150) # Open widgets self.asset_outliner = asset_outliner self.look_outliner = look_outliner self.status = status self.warn_layer = warn_layer # Buttons self.remove_unused = remove_unused_btn self.assign_selected = assign_selected
def setup_ui(self): """Build the UI""" # Assets (left) asset_outliner = widgets.AssetOutliner() # Looks (right) looks_widget = QtWidgets.QWidget() looks_layout = QtWidgets.QVBoxLayout(looks_widget) # Sub widgets and layouts db_looks_widget = QtWidgets.QWidget() db_looks_layout = QtWidgets.QVBoxLayout(db_looks_widget) loaded_looks_widget = QtWidgets.QWidget() loaded_looks_layout = QtWidgets.QVBoxLayout(loaded_looks_widget) # Database look overview look_outliner = widgets.LookOutliner() # Scene look overview loaded_look_outliner = widgets.LoadedLookOutliner() # Button and checkBox overload_chk = QtWidgets.QCheckBox("Overload Looks") remove_unused_btn = QtWidgets.QPushButton("Remove Unused Looks") db_looks_layout.addWidget(look_outliner) db_looks_layout.addWidget(overload_chk) loaded_looks_layout.addWidget(loaded_look_outliner) # Look Splitter look_splitter = QtWidgets.QSplitter() look_splitter.setOrientation(QtCore.Qt.Vertical) look_splitter.setStyleSheet("QSplitter{ border: 0px; }") look_splitter.addWidget(db_looks_widget) look_splitter.addWidget(loaded_looks_widget) look_splitter.setSizes([200, 120]) looks_layout.addWidget(look_splitter) looks_layout.addWidget(remove_unused_btn) # Footer status = QtWidgets.QStatusBar() status.setSizeGripEnabled(False) status.setFixedHeight(25) warn_layer = QtWidgets.QLabel("Current Layer is not " "defaultRenderLayer") warn_layer.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) warn_layer.setStyleSheet("color: #DD5555; font-weight: bold;") warn_layer.setFixedHeight(25) footer = QtWidgets.QHBoxLayout() footer.setContentsMargins(0, 0, 0, 0) footer.addWidget(status) footer.addWidget(warn_layer) # Build up widgets main_layout = QtWidgets.QVBoxLayout(self) main_layout.setSpacing(0) main_splitter = QtWidgets.QSplitter() main_splitter.setStyleSheet("QSplitter{ border: 0px; }") main_splitter.addWidget(asset_outliner) main_splitter.addWidget(looks_widget) main_splitter.setSizes([350, 280]) main_layout.addWidget(main_splitter) main_layout.addLayout(footer) # Set column width asset_outliner.view.setColumnWidth(0, 200) look_outliner.view.setColumnWidth(0, 140) # "label" column look_outliner.view.setColumnWidth(2, 50) # "match" column loaded_look_outliner.view.setColumnWidth(0, 140) # "label" column loaded_look_outliner.view.setColumnWidth(1, 60) # "ident" column # Open widgets self.asset_outliner = asset_outliner self.look_outliner = look_outliner self.loaded_look_outliner = loaded_look_outliner self.status = status self.warn_layer = warn_layer # Buttons and CheckBoxes self.remove_unused = remove_unused_btn self.overload = overload_chk