Esempio n. 1
0
    def _setup_ui(self):
        self.setStyleSheet(self._default)
        self._menu = self._build_menu()

        # top
        top_layout = make_layout(alignment=Qt.AlignVCenter,
                                 margin=(12, 0, 12, 0),
                                 spacing=8)
        self._name_label = ElideLabel()
        self._name_label.setStyleSheet(
            'font-size: 18px; color: palette(light)')
        self._state_label = QLabel()
        top_layout.addWidget(self._name_label)
        top_layout.addStretch()
        top_layout.addWidget(self._state_label)

        # bottom
        bottom_layout = make_layout()
        for i in range(len(self._field_info_list)):
            layout = make_layout(alignment=Qt.AlignVCenter)
            label = QLabel()
            label.setStyleSheet('font-size: 12px')
            label.setAlignment(Qt.AlignCenter)
            layout.addWidget(label)
            bottom_layout.addLayout(layout)
            if i != len(self._field_info_list) - 1:
                bottom_layout.addWidget(make_split_line(vertical=True))
            self._field_info_labels.append(label)

        self.addLayout(top_layout)
        self.addLayout(bottom_layout)
        self._apply_data()
        self._update()
Esempio n. 2
0
    def _setup_ui(self):
        self.setStyleSheet(self._default)
        self.setWindowFlags(
            Qt.Window | Qt.WindowTitleHint | Qt.CustomizeWindowHint
        )

        self.setStyleSheet(self._default)
        layout = make_layout(
            horizon=False,
            margin=24,
            spacing=24
        )

        self._progress_bar = QProgressBar()
        self._progress_bar.setRange(0, self._total_progress)
        self._progress_bar.setTextVisible(True)
        self._progress_bar.setFormat(r'%p% (%v/%m)')
        self._progress_bar.setValue(0)

        layout.addWidget(
            self._progress_bar
        )

        self.setLayout(layout)
        move_center(self)
Esempio n. 3
0
    def _setup_ui(self):
        title_layout = make_layout(alignment=Qt.AlignLeft)
        title_layout.addWidget(ProjectTitle())

        switcher_layout = make_layout(alignment=Qt.AlignCenter)
        switcher_layout.addWidget(BodySwitcher())

        status_layout = make_layout(alignment=Qt.AlignRight,
                                    margin=(0, 0, 16, 0))
        status_layout.addWidget(StatusIndicator())

        self.addLayout(title_layout)
        self.addLayout(switcher_layout)
        self.addLayout(status_layout)

        self.setFixedHeight(65)
        self.setStyleSheet(self._default)
Esempio n. 4
0
    def _setup_ui(self):
        layout = make_layout(horizon=False, margin=8)

        for child in self._children:
            if isinstance(child, ShotSubmitContainer):
                layout.addWidget(child)
            else:
                layout.addLayout(child)
        self.setLayout(layout)
Esempio n. 5
0
    def _setup_ui(self):
        layout = make_layout(horizon=False)

        layout.addWidget(ProjectList())
        layout.addWidget(ProjectListButtonGroup())

        self.setLayout(layout)

        self.setFixedSize(self._width, self._height)
        move_center(self)
Esempio n. 6
0
    def _setup_ui(self):
        self.setStyleSheet(self._default)
        self.setFixedHeight(120)

        self._layout = make_layout(stack=True)

        playback_control = PlaybackControl()
        self._layout.addWidget(LiveViewPanel())
        self._layout.addWidget(RollPanel(playback_control))
        self._layout.addWidget(ModelPanel(playback_control))

        self.addLayout(self._layout)

        self._update()
Esempio n. 7
0
    def _icon_widget(self, icon, value):
        layout = make_layout(spacing=4, alignment=Qt.AlignHCenter)

        icon_label = QLabel()
        icon_label.setPixmap(icons.get(icon))
        icon_label.setFixedSize(24, 24)
        icon_label.setAlignment(Qt.AlignCenter)

        text_label = QLabel(str(value))
        text_label.setObjectName('icon-value')

        layout.addWidget(icon_label)
        layout.addWidget(text_label)

        return layout
Esempio n. 8
0
    def _setup_ui(self):
        self.setAlignment(Qt.AlignCenter)
        self.setSpacing(0)
        self.setContentsMargins(0, 0, 0, 0)

        self._playback_bar = PlaybackBar()
        self.addWidget(self._playback_bar)

        layout = make_layout(alignment=Qt.AlignCenter, spacing=60)
        for source in ('clipleft', 'previous', 'play', 'next', 'clipright'):
            button = PlaybackButton(source)
            button.clicked.connect(partial(self._on_click, source))

            layout.addWidget(button)

        self.addLayout(layout)
Esempio n. 9
0
    def _setup_ui(self):
        self.setStyleSheet(self._default)
        self.setFixedWidth(290)

        layout = make_layout(alignment=Qt.AlignHCenter,
                             margin=(0, 24, 0, 8),
                             spacing=16)
        shot_button = AddButton(' Shot')
        shot_button.clicked.connect(lambda: self._new_dialog())
        cali_button = AddButton(' Cali')
        cali_button.clicked.connect(lambda: self._new_dialog(True))
        layout.addWidget(shot_button)
        layout.addWidget(cali_button)
        self.addLayout(layout)

        self._update()
Esempio n. 10
0
def convert_submit_parm_widgets(key, value, layer):
    widgets = []
    parm_layout = make_layout(
        spacing=30,
        margin=(layer * 24, 24 if layer == 0 else 0, 0, 0)
    )

    if key is None:
        return convert_submit_parm_widgets(value[0], value[1], layer)
    if isinstance(value, dict):
        parm_layout.addWidget(
            QLabel(f'{key}:')
        )
        widgets.append(parm_layout)
        for k, v in value.items():
            widgets += convert_submit_parm_widgets(k, v, layer + 1)
        return widgets
    elif isinstance(value, list):
        parm_layout.addWidget(
            QLabel(f'{key}:')
        )
        widgets.append(parm_layout)
        for l in value:
            widgets += convert_submit_parm_widgets(None, l, layer + 1)
        return widgets

    name_label = QLabel(f'{key}:')
    if isinstance(value, float):
        value = f'{value}'
    else:
        value = str(value)
    value_label = QLabel(value)

    parm_layout.addWidget(name_label)
    parm_layout.addStretch(0)
    parm_layout.addWidget(value_label)

    return [parm_layout]
Esempio n. 11
0
    def _setup_ui(self):
        self.setStyleSheet(self._default)
        self._menu = self._build_menu()

        detail_layout = make_layout(horizon=False, margin=(0, 8, 0, 8))

        self._title_label = QLabel()
        self._title_label.setObjectName('title')
        self._title_label.setAlignment(Qt.AlignCenter)

        time_label = QLabel(self._project.create_at_str)
        time_label.setObjectName('date')
        time_label.setAlignment(Qt.AlignCenter)

        icon_layout = LayoutWidget(margin=(8, 0, 8, 0),
                                   alignment=Qt.AlignCenter,
                                   spacing=24)

        for key, value in self._project.get_overview().items():
            icon_layout.layout().addLayout(self._icon_widget(key, value))

        detail_layout.addWidget(self._title_label)
        detail_layout.addWidget(time_label)
        detail_layout.addWidget(icon_layout)

        wrapper = LayoutWidget()
        wrapper.setObjectName('wrapper')
        wrapper.setStyleSheet(self._wrapper_default)

        wrapper.addLayout(detail_layout)
        wrapper.layout().setStretch(1, 1)
        self._wrapper = wrapper

        self.layout().addWidget(wrapper)

        self._update()
Esempio n. 12
0
    def _setup_ui(self):
        self.setStyleSheet(self._default)
        shot = state.get('current_shot')
        self.setWindowTitle(f'Submit [{shot.name}]')

        layout = make_layout(horizon=False, margin=24, spacing=24)

        name_layout = make_layout(spacing=24)
        label = HeaderLabel('Job Name')
        label.setAlignment(Qt.AlignCenter)
        name_layout.addWidget(label)

        name = f'resolve {len(shot.jobs) + 1}'
        self._text_name = HeaderLineEdit()
        self._text_name.setAlignment(Qt.AlignRight)
        self._text_name.setText(name)
        self._text_name.setPlaceholderText('Submit Job Name')
        name_layout.addWidget(self._text_name)

        layout.addLayout(name_layout)

        # --------------
        layout.addWidget(make_split_line())

        label = HeaderLabel('Frame Range (seperate by comma, space or dash)')
        layout.addWidget(label)

        min_slider_value, max_slider_value = get_slider_range()
        self._text_frames = HeaderLineEdit()
        self._text_frames.setAlignment(Qt.AlignCenter)
        self._text_frames.setText(f'{min_slider_value}-{max_slider_value}')
        self._text_frames.setPlaceholderText(
            '1-101 or 1 2 3 or 1,2,3 or 1 3,4,6-9')
        layout.addWidget(self._text_frames)

        hlayout = make_layout(horizon=True, margin=0, spacing=24)
        label = HeaderLabel('Calibration')
        hlayout.addWidget(label)

        self._comboBox = CalibrationComboBox()
        hlayout.addWidget(self._comboBox)

        layout.addLayout(hlayout)

        # submit parameter
        submit_widget = QWidget()
        submit_control = QVBoxLayout()
        submit_meta = {
            'reference': 1,
            'clip_range': 1,
            'mesh_reduce_ratio': 0,
            'flows': 2
        }
        for parm_name, layer in submit_meta.items():
            parm_value = setting.resolve[parm_name]
            parm_widget = create_submit_parameter_widget(
                parm_name, parm_value, layer)
            if isinstance(parm_widget, ShotSubmitContainer):
                submit_control.addWidget(parm_widget)
            else:
                submit_control.addLayout(parm_widget)
            self._parms.append(parm_widget)
        scroll = QScrollArea()
        scroll.setWidgetResizable(True)
        scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        submit_widget.setLayout(submit_control)
        scroll.setWidget(submit_widget)
        layout.addWidget(scroll)

        buttons = QDialogButtonBox.Ok | QDialogButtonBox.Cancel
        self._buttons = QDialogButtonBox(buttons)
        self._buttons.accepted.connect(self.accept)
        self._buttons.rejected.connect(self.reject)
        layout.addWidget(self._buttons)

        self.setLayout(layout)

        self.setMinimumSize(580, 710)
        move_center(self)
Esempio n. 13
0
    def _setup_ui(self):
        self.setStyleSheet(self._default)
        shot = state.get('current_shot')
        job = state.get('current_job')

        layout = make_layout(
            horizon=False,
            margin=24,
            spacing=24
        )

        # shot parms
        if job is None:
            self.setWindowTitle(f'[{shot.name}] Camera Parameters')
            if isinstance(shot.camera_parameters, dict):
                for key, value in shot.camera_parameters.items():
                    parm_layout = make_layout(spacing=48)
                    name_label = QLabel(f'{key}:')
                    if isinstance(value, float):
                        value = f'{value:.2f}'
                    else:
                        value = str(value)
                    value_label = QLabel(value)

                    parm_layout.addWidget(name_label)
                    parm_layout.addStretch(0)
                    parm_layout.addWidget(value_label)

                    layout.addLayout(parm_layout)
        # job parms
        else:
            self.setWindowTitle(f'[{job.name}] Submit Parameters')

            submit_widget = QWidget()
            submit_control = make_layout(
                horizon=False, spacing=8, margin=24
            )

            for key, value in job.parameters.items():
                widgets = convert_submit_parm_widgets(key, value, 0)
                for widget in widgets:
                    if isinstance(widget, QLayout):
                        submit_control.addLayout(widget)
                    else:
                        submit_control.addWidget(widget)

            scroll = QScrollArea()
            scroll.setWidgetResizable(False)
            scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
            submit_widget.setLayout(submit_control)
            scroll.setWidget(submit_widget)
            layout.addWidget(scroll)

        buttons = QDialogButtonBox.Ok
        self._buttons = QDialogButtonBox(buttons)
        self._buttons.accepted.connect(self.accept)
        self._buttons.rejected.connect(self.reject)
        layout.addWidget(self._buttons)

        self.setLayout(layout)
        move_center(self)