def _set_action(self): menu = dy.MMenu() for action_text in self.menu_data: action = menu.addAction(action_text) action.triggered.connect(partial(self.action_clicked.emit, action_text)) return menu
def __init__(self): super(UserAvatar, self).__init__() self.menu = dy.MMenu() self.logout_menu = self.menu.addAction(u"登出") self.info_menu = self.menu.addAction(u"个人详细信息") self.menu.setStyleSheet("MMenu{\n font-size:13px '微软雅黑'}")
def __init__(self, label_name, combobox_data, exclusive=False): super(SearchGroup, self).__init__() self.MainLayout = QtWidgets.QHBoxLayout(self) self.SearchLabel = dy.MLabel(label_name) self.SearchCombobox = dy.MComboBox() self.menu = dy.MMenu(exclusive=exclusive) self.set_combobox(combobox_data) self.setup_ui() self.set_style_sheet()
def __init__(self): super(TaskTable, self).__init__(size=dy.dayu_theme.large) self.setFrameShape(QtWidgets.QFrame.NoFrame) self.select_data = None self.menu = dy.MMenu() self.executor_menu = self.menu.addMenu("修改执行人") self.status_menu = self.menu.addMenu("修改任务状态") self.verticalHeader().setDefaultSectionSize(33) self.resizeColumnsToContents() self.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch) self.set_style_sheet()
def __init__(self): super(TeamonesUI, self).__init__() self.setObjectName('Teamones_Tool') self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.FramelessWindowHint) self.setGeometry(150, 50, 1570, 800) self.MainLayout = QtWidgets.QVBoxLayout(self, spacing=6) self.MainLayout.setContentsMargins(0, 0, 0, 0) # menu 模块 self.menuWidget = ToolMenu() self.informationLayout = QtWidgets.QHBoxLayout() self.tableWidget = table_widget.TableWidget() self.mainSplitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal) self.stackedWidget = QtWidgets.QStackedWidget() # 项目面板 self.projectWidget = project_preview_widget.ProjectPreviewWidget() # 任务信息面板 self.informationWidget = task_preview_widget.TaskPreviewWidget() # 工作侧边栏 self.taskSideWidget = task_info_widget.TaskInfoWidget() self.taskSideWidget.hide() # 项目侧边栏 self.projectSideWidget = project_info_widget.ProjectInfoWidget() self.projectSideWidget.hide() self.menu = dy.MMenu() self.executor_menu = self.menu.addMenu("修改执行人") self.status_menu = self.menu.addMenu("修改任务状态") self.setup_ui() self.set_style_sheet()
def __init__(self, tex_name, checked=False, tex_type="JPEG"): super(TextureWidgetGroup, self).__init__() self.menu_data = ["JPEG", "EXR", "JPEG+EXR", "PNG"] self.mainLayout = QtWidgets.QHBoxLayout(self) self.mainLayout.setContentsMargins(0, 0, 0, 0) self.name_checkbox = dy.MCheckBox(tex_name) self.name_checkbox.setStyleSheet( "border:0px; border-radius: 0px; background-color: rgb(40, 40, 40)" ) self.name_checkbox.setFont(QtGui.QFont("华文琥珀", 20, QtGui.QFont.Bold)) self.name_checkbox.setObjectName("{}_name".format(tex_name)) self.name_checkbox.setChecked(checked) self.type_combobox = dy.MComboBox() self.type_combobox.setMinimumWidth(80) self.type_combobox.setObjectName("{}_type".format(tex_name)) self.type_combobox.setStyleSheet("background-color: rgb(50, 50, 50)") menu = dy.MMenu() menu.set_data(self.menu_data) self.type_combobox.set_menu(menu) self.type_combobox.set_value(tex_type) self.setup_ui()
def __init__(self): super(SearchLine, self).__init__() self.MainLayout = QtWidgets.QHBoxLayout(self) self.MainLayout.setContentsMargins(0, 0, 0, 0) self.SearchLine = dy.MLineEdit().search() self.SearchLine.setPlaceholderText(self.tr('Press Enter to search...')) self.SearchLine.returnPressed.connect( partial(self.emit_signal, self.SearchLine.text)) self.SearchLine.textChanged.connect(self.clean_emit_signal) self.SearchCombobox = dy.MComboBox() self.SearchCombobox.set_value('name') self.SearchCombobox.setFixedWidth(90) self.option_menu = dy.MMenu() self.option_menu.set_separator('|') # todo: 可以修改menu的元素 self.option_menu.set_data([u"name", u"code"]) self.SearchCombobox.set_menu(self.option_menu) self.SearchLine.set_prefix_widget(self.SearchCombobox) self.SearchLine.setMinimumWidth(250) self.MainLayout.addWidget(self.SearchLine)
def setup_ui(self): self.mainLayout.addLayout(self.tabletLayout) self.mainLayout.addWidget(self.resetStacked) self.tabletLayout.addStretch() self.tabletLayout.addWidget(self.AssetInfo_menu) self.tabletLayout.setContentsMargins(0, 0, 0, 0) self.tabletLayout.addStretch() self.tabletLayout.addWidget(self.DownSet_menu) self.tabletLayout.addStretch() self.assetScroll = QtWidgets.QScrollArea() self.assetScroll.setWidgetResizable(True) self.assetInfo = QtWidgets.QWidget() self.assetInfo.setObjectName("assetInfo") self.assetScroll.setWidget(self.assetInfo) self.assetLayout = QtWidgets.QVBoxLayout(self.assetInfo) self.assetLayout.setContentsMargins(0, 0, 0, 0) self.assetText = dy.MTextEdit() self.assetText.setObjectName("assetText") self.assetText.setMinimumHeight(150) self.assetText.setReadOnly(True) self.mayaLayout = QtWidgets.QHBoxLayout() self.mayaLabel = dy.MLabel("Maya File:").strong() self.mayaPath = dy.MLabel("").strong() self.mayaButton = dy.MPushButton("打开").warning() self.mayaButton.setMaximumWidth(60) self.mayaButton.setStyleSheet("") self.mayaLayout.addWidget(self.mayaLabel) self.mayaLayout.addWidget(self.mayaPath) self.mayaLayout.addWidget(self.mayaButton) self.zbLayout = QtWidgets.QHBoxLayout() self.zbLabel = dy.MLabel("Zbrush File:").strong() self.zbPath = dy.MLabel("").strong() self.zbButton = dy.MPushButton("打开").warning() self.zbButton.setMaximumWidth(60) self.zbButton.setStyleSheet("") self.zbLayout.addWidget(self.zbLabel) self.zbLayout.addWidget(self.zbPath) self.zbLayout.addWidget(self.zbButton) self.spLayout = QtWidgets.QHBoxLayout() self.spLabel = dy.MLabel("Substance File:").strong() self.spPath = dy.MLabel("").strong() self.spButton = dy.MPushButton("打开", ).warning() self.spButton.setMaximumWidth(60) self.spButton.setStyleSheet("") self.spLayout.addWidget(self.spLabel) self.spLayout.addWidget(self.spPath) self.spLayout.addWidget(self.spButton) self.assetLayout.addWidget(self.assetText) self.assetLayout.addWidget(dy.MDivider("")) self.assetLayout.addLayout(self.mayaLayout) self.assetLayout.addWidget(dy.MDivider("")) self.assetLayout.addLayout(self.zbLayout) self.assetLayout.addWidget(dy.MDivider("")) self.assetLayout.addLayout(self.spLayout) self.assetLayout.addWidget(dy.MDivider("")) self.textureScroll = QtWidgets.QScrollArea() self.textureScroll.setObjectName("textureScroll") self.textureScroll.setWidgetResizable(True) self.textureInfo = QtWidgets.QWidget() self.textureInfo.setObjectName("textureInfo") self.textureScroll.setWidget(self.textureInfo) self.textureLayout = QtWidgets.QVBoxLayout(self.textureInfo) self.textureLayout.setContentsMargins(0, 0, 0, 0) self.texture_resolutionLayout = QtWidgets.QHBoxLayout() self.texture_resolutionLabel = dy.MLabel(u"贴图分辨率").strong() self.texture_resolutionCombobox = dy.MComboBox() self.texture_resolutionCombobox.setMinimumWidth(250) menu = dy.MMenu() menu.set_data(["8K", "4K", "2K"]) self.texture_resolutionCombobox.set_menu(menu) self.texture_resolutionCombobox.set_value("8K") self.texture_resolutionLayout.addWidget(dy.MLabel()) self.texture_resolutionLayout.addWidget(self.texture_resolutionLabel) self.texture_resolutionLayout.addStretch() self.texture_resolutionLayout.addWidget( self.texture_resolutionCombobox) self.texture_resolutionLayout.addWidget(dy.MLabel()) self.texture_type_Layout = QtWidgets.QHBoxLayout() self.texture_type_leftLayout = QtWidgets.QVBoxLayout() self.texture_type_rightLayout = QtWidgets.QVBoxLayout() self.texture_type_Layout.addLayout(self.texture_type_leftLayout) self.texture_type_Layout.addLayout(self.texture_type_rightLayout) self.textureLayout.addWidget(dy.MLabel("")) self.textureLayout.addLayout(self.texture_resolutionLayout) self.textureLayout.addWidget(dy.MLabel("")) self.textureLayout.addWidget(dy.MDivider("")) self.textureLayout.addLayout(self.texture_type_Layout) self.resetStacked.addWidget(self.assetScroll) self.resetStacked.addWidget(self.textureScroll)
def __init__(self): super(PublishInformation, self).__init__() self.setObjectName("PublishInformation") self.mainLayout = QtWidgets.QVBoxLayout(self) self.mainLayout.setContentsMargins(0, 0, 0, 0) self.tabletLayout = QtWidgets.QHBoxLayout(self) self.tabletLayout.setContentsMargins(0, 0, 0, 0) self.resetStacked = dy.qt.QStackedWidget() self.PublishCheck_menu = TableMenu(u"发布检查", index=0) self.PublishSett_menu = TableMenu(u"发布信息", index=1) # assetWidget setting self.assetScrollArea = QtWidgets.QScrollArea() self.assetScrollArea.setObjectName("assetScrollArea") self.assetScrollArea.setWidgetResizable(True) self.assetWidget = QtWidgets.QWidget() self.assetWidget.setObjectName("assetWidget") self.assetLayout = QtWidgets.QVBoxLayout(self.assetWidget) self.assetScrollArea.setWidget(self.assetWidget) self.assetsNameLayout = QtWidgets.QHBoxLayout() self.assetsNameLabel = dy.MLabel("资产名称:").strong() self.assetsNameLine = dy.MLineEdit() self.assetsNameLine.setFixedWidth(250) self.assetsNameLayout.addWidget(self.assetsNameLabel) self.assetsNameLayout.addWidget(self.assetsNameLine) self.TopCategoryLayout = QtWidgets.QHBoxLayout() self.TopCategoryLabel = dy.MLabel(u"一级分类:").strong() self.TopCategoryLine = dy.MLineEdit() self.TopCategoryLine.setFixedWidth(250) self.TopCategoryLayout.addWidget(self.TopCategoryLabel) self.TopCategoryLayout.addWidget(self.TopCategoryLine) self.SecondaryCategoryLayout = QtWidgets.QHBoxLayout() self.SecondaryCategoryLabel = dy.MLabel(u"二级分类:").strong() self.SecondaryCategoryLine = dy.MLineEdit() self.SecondaryCategoryLine.setFixedWidth(250) self.SecondaryCategoryLayout.addWidget(self.SecondaryCategoryLabel) self.SecondaryCategoryLayout.addWidget(self.SecondaryCategoryLine) self.MapResolutionLayout = QtWidgets.QHBoxLayout() self.MapResolutionLabel = dy.MLabel(u"贴图分辨率:").strong() self.MapResolutionCombobox = dy.MComboBox() self.MapResolutionCombobox.setMaximumWidth(200) self.menu = dy.MMenu() self.menu.set_data(["8K", "4K", "2K"]) self.MapResolutionCombobox.set_menu(self.menu) self.MapResolutionLayout.addWidget(self.MapResolutionLabel) self.MapResolutionLayout.addWidget(self.MapResolutionCombobox) self.MapResolutionCombobox.set_value("8K") self.describeText = dy.MTextEdit() self.describeText.setMaximumHeight(400) self.describeText.setPlaceholderText(self.tr(u'请输入一些描述')) # uploadWidget self.uploadScrollArea = QtWidgets.QScrollArea() self.uploadScrollArea.setObjectName("uploadScrollArea") self.uploadScrollArea.setWidgetResizable(True) self.uploadWidget = QtWidgets.QWidget() self.uploadLayout = QtWidgets.QVBoxLayout(self.uploadWidget) self.uploadScrollArea.setWidget(self.uploadWidget) self.previewLayout = QtWidgets.QHBoxLayout() self.previewCheckBox = dy.MCheckBox() self.previewCheckBoxLabel = dy.MLabel(u"预览图片").strong() self.previewLabel = dy.MLabel().strong() self.zbLayout = QtWidgets.QHBoxLayout() self.zbCheckBox = dy.MCheckBox() self.zbCheckBoxLabel = dy.MLabel(u"Zbrush 文件").strong() self.zbLabel = dy.MLabel().strong() self.spLayout = QtWidgets.QHBoxLayout() self.spCheckBox = dy.MCheckBox() self.spCheckBoxLabel = dy.MLabel(u"Substance 文件").strong() self.spLabel = dy.MLabel().strong() self.textureLayout = QtWidgets.QHBoxLayout() self.textureCheckBox = dy.MCheckBox() self.textureCheckBoxLabel = dy.MLabel(u"贴图文件").strong() self.textureLabel = dy.MLabel().strong() self.setup_ui() self.connect_ui() self.set_theme()
def __init__(self): """ UI界面 """ super(LibraryUI, self).__init__() self.config_file = File.File(package.get("LibData/library_config.yaml")) self.config = self.config_file.read_data_from_file() self.setWindowTitle("Library Tool") self.setGeometry(150, 50, 1600, 900) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.FramelessWindowHint) self.iconPath = package.get("LibIcon") self._root_path = None self.reset_library() self.mainWidget = QtWidgets.QWidget(self) self.mainWidget.setGeometry(0, 0, 1600, 900) self.mainLayout = QtWidgets.QVBoxLayout(self.mainWidget) # menu 模块 self.menuLayout = QtWidgets.QHBoxLayout() self.avatar = dy.MAvatar() self.loginButton = LoginAvatar(self.iconPath) self.inforButton = InfoAvatar(self.iconPath) self.projectCombobox = dy.MComboBox() self.projectCombobox.setMaximumWidth(100) project_data = File.File(package.get("LibData/Project_data.yaml")).read_data_from_file() project_menu = dy.MMenu() project_menu.set_data(project_data) self.projectCombobox.set_menu(project_menu) self.hideButton = dy.MPushButton("", dy.qt.MIcon('minus_line.svg', '#ddd')).small() self.hideButton.setFlat(True) self.closeButton = dy.MPushButton("", dy.qt.MIcon('close_line.svg', '#ddd')).small() self.closeButton.setFlat(True) self.uploadButotn = dy.MPushButton("", dy.qt.MIcon('cloud_line.svg', '#ddd')).small().primary() self.uploadButotn.setFlat(True) self.SpliterLayout = QtWidgets.QHBoxLayout() self.toolbar = toolBar.ToolBar() self.mainSplitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal) self.mainSplitter.setStyleSheet("width:0px") self.listFrame = QtWidgets.QFrame() self.listLayout = QtWidgets.QVBoxLayout(self.listFrame) self.searchLayout = QtWidgets.QHBoxLayout() self.listSearchLine = dy.MLineEdit().search() self.tagButton = dy.MPushButton("", QtGui.QPixmap(package.get("LibIcon/tag.png"))).warning() self.tagButton.setMinimumWidth(60) self.ListScrollArea = QtWidgets.QScrollArea() self.ListScrollArea.setWidgetResizable(True) self.CardWidget = QtWidgets.QWidget() self.CardLayout = dy.MFlowLayout(self.CardWidget) self.ListScrollArea.setWidget(self.CardWidget) # export view 导出模块 self.exportFrame = QtWidgets.QFrame() self.exportFrame.hide() self.exportFrame.setMinimumWidth(500) self.exportFrame.setMaximumWidth(500) self.exportLayout = QtWidgets.QVBoxLayout(self.exportFrame) self.exportLayout.setContentsMargins(0, 0, 0, 0) self.screenShot = ScreenShot("请拖拽一个\n预览文件") self.screenShot.setMaximumHeight(350) self.dragLayout = QtWidgets.QHBoxLayout() self.zbDragButton = dy.MDragFileButton() self.zbDragButton.setFixedSize(120, 120) self.zbDragButton.set_dayu_svg(package.get("LibIcon/Zbrush.png")) self.zbDragButton.setText("") self.zbDragButton.setIconSize(QtCore.QSize(1080, 1080)) self.zbDragButton.set_dayu_filters([".ZBR", ".ZTL", ".ZPR"]) self.spDragButton = dy.MDragFileButton("") self.spDragButton.setFixedSize(120, 120) self.spDragButton.set_dayu_filters([".spp"]) self.spDragButton.set_dayu_svg(package.get("LibIcon/substance_Icon.png")) self.textureDragButton = dy.MDragFolderButton() self.textureDragButton.setText("") self.textureDragButton.setFixedSize(120, 120) self.informationWidget = export_assets_widget.PublishInformation() self.updateLayout = QtWidgets.QHBoxLayout() self.updateButton = dy.MPushButton('Upload To Library', dy.qt.MIcon('cloud_line.svg', '#ddd')).warning().large() self.introdiction = assets_introduction.Introduction(self.root_path) self.introdiction.setMinimumWidth(500) self.introdiction.setMaximumWidth(500) self.introdiction.hide() self.tagFrame = tag_widget.TagWidget() self.tagFrame.setMinimumWidth(500) self.tagFrame.setMaximumWidth(500) self.tagFrame.hide() self.info_window = info_widget.InfoUI() self.set_theme() self.setup_ui() self.connect_ui()
def set_combobox(combobox, category): menu = dy.MMenu() menu.set_data([cate["name"] for cate in category]) combobox.set_menu(menu)