def __init__(self): super(ToolMenu, self).__init__() self.setObjectName("Menu") self.menuLayout = QtWidgets.QHBoxLayout(self) self.userAvatar = UserAvatar().huge() user_pix = self.__set_pix_map( QtGui.QPixmap(package.get("icon/user.jpg"))) self.userAvatar.set_dayu_image(user_pix) self.userLabel = dy.MLabel("").h4() self.userLabel.setAlignment(QtCore.Qt.AlignTop) self.projectLabel = QtWidgets.QLabel() self.projectLabel.setStyleSheet( "color: #cccccc; font-weight:Bold;\n font-size:30px '微软雅黑'") 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().warning() self.closeButton.setFlat(True) self.setup_ui() self.set_style_sheet()
def __init__(self, parent): super(MyMenu, self).__init__() self.parent = parent self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.FramelessWindowHint) self.mainLayout = QtWidgets.QVBoxLayout(self) self.setMaximumWidth(110) self.mainLayout.setContentsMargins(0, 0, 0, 0) self.loginButton = dy.MPushButton("Login", icon=dy.qt.MIcon(package.get("LibIcon/login.svg"))).tiny() self.loginButton.setMaximumWidth(100) self.logoutButton = dy.MPushButton("Logout", icon=dy.qt.MIcon(package.get("LibIcon/logout.png"))).tiny() self.logoutButton.setMaximumWidth(100) self.setRootPath = dy.MPushButton("Set Root Path", icon=dy.qt.MIcon(package.get("LibIcon/tree_view.svg"))).tiny() self.setRootPath.setMaximumWidth(100) self.importButton = dy.MPushButton("导入资产", icon=dy.qt.MIcon(package.get("LibIcon/import.jpg"))).tiny() self.importButton.setMaximumWidth(100) self.set_theme() self.setup_ui() self.connect_ui()
def __init__(self): super(TaskInfoWidget, self).__init__() self.task_id = None self.setObjectName("TaskInfoWidget") self.setStyleSheet("background-color:#333333") self.MainLayout = QtWidgets.QHBoxLayout(self) self.MainLayout.setContentsMargins(0, 0, 0, 0) self.LeftWidget = HideWidget() self.RightLayout = QtWidgets.QVBoxLayout() self.RightLayout.setContentsMargins(0, 10, 0, 10) self.EntityLabel = QtWidgets.QLabel() self.EntityLabel.setStyleSheet("color: #cccccc; font-weight:Bold;\n font-size:32px '微软雅黑'") self.TaskLabel = QtWidgets.QLabel() self.TaskLabel.setStyleSheet("color: #cccccc; font-size:20px '微软雅黑'") self.setFixedWidth(400) self.menu = Menu() self.menuStack = StackedWidget() self.menuStack.setStyleSheet("width:0px") self.infoWidget = TaskInfo() self.feedbackWidget = QtWidgets.QWidget() self.existingVersionWidget = WorkWidget() self.publishVersionWidget = PublishWidget() self.buttonLayout = QtWidgets.QHBoxLayout(self) self.start_task_button = dy.MPushButton(u"开始任务").primary() self.start_task_button.setMinimumWidth(160) self.publish_task_button = dy.MPushButton(u"发布版本").success() self.publish_task_button.setMinimumWidth(160) self.publish_task_button.hide() self.setup_ui() self.connect_ui() self.set_theme()
def __init__(self): """ 初始化窗口 """ super(LoginUI, self).__init__() self.setWindowTitle(u"登录Library") self.setGeometry(750, 300, 350, 350) self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint) self.mainLayout = QtWidgets.QVBoxLayout(self) self.closeLayout = QtWidgets.QHBoxLayout(self) self.closeButton = dy.MPushButton("", icon=dy.qt.MIcon( 'close_line.svg', '#ddd')).small().danger() self.closeButton.clicked.connect(self.close) self.userAvatarLayout = QtWidgets.QHBoxLayout() self.userAvatar = dy.MAvatar() self.userAvatar.set_dayu_size(150) self.userAvatar.set_dayu_image( QPixmap("D:/ToolBox_Project/library/LibIcon/male.svg")) self.userNameLayout = QtWidgets.QHBoxLayout() self.userNameLabel = dy.MAvatar() self.userAvatar.set_dayu_image( QPixmap("D:/ToolBox_Project/library/LibIcon/male.svg")) self.userNameLine = dy.MLineEdit() self.userNameLine.setMinimumWidth(250) self.userNameLine.setPlaceholderText('Enter user name...') self.passwordLayout = QtWidgets.QHBoxLayout() self.passwordLabel = dy.MAvatar() self.passwordLabel.set_dayu_image( QPixmap("D:/ToolBox_Project/library/LibIcon/edit_fill.svg")) self.passwordLine = dy.MLineEdit().password() self.passwordLine.setMinimumWidth(250) self.passwordLine.setPlaceholderText('Enter the password...') self.loginButton = dy.MPushButton("Login").warning() self.setup_ui() self.set_theme()
def add_menu(self, menu_data): """ 添加menu 菜单 :param menu_data: (dict) {name_a: icon_a, name_b: icon_b} :return: """ for menu_name, menu_icon in menu_data.items(): menu_item = dy.MPushButton(menu_name, icon=dy.qt.MIcon(menu_icon)).tiny() menu_item.clicked.connect(partial(self.clicked_signal, menu_name)) self.MainLayout.addWidget(menu_item)
def __init__(self): super(InfoUI, self).__init__() self.setWindowTitle("About") self.setGeometry(800, 300, 500, 400) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.mainLayout = QtWidgets.QVBoxLayout(self) self.checkLayout = QtWidgets.QHBoxLayout() self.checkButton = dy.MPushButton("ok").primary() self.checkButton.setMinimumWidth(60) self.setup_ui() self.set_theme() self.connect_ui()
def __init__(self, root_path): super(Introduction, self).__init__() self.root_path = root_path self.mainLayout = QtWidgets.QVBoxLayout(self) self.mainLayout.setContentsMargins(0, 0, 0, 0) self.ScrollAreaWidget = QtWidgets.QScrollArea() self.ScrollAreaWidget.setWidgetResizable(True) self.mainWidget = QtWidgets.QWidget() self.ScrollAreaWidget.setWidget(self.mainWidget) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.Label = QtWidgets.QLabel() self.Label.setMinimumHeight(80) self.ScrollLayout = QtWidgets.QVBoxLayout(self.mainWidget) self.ScrollLayout.setContentsMargins(0, 0, 0, 0) self.data = None self.previewLayout = QtWidgets.QHBoxLayout() self.previewLabel = PreviewLabel() self.previewLabel.setMaximumHeight(300) # self.max_preview = image_preview.Preview() self.previewNameLayout = QtWidgets.QHBoxLayout() self.previewNameLabel = dy.MLabel().strong().h2() self.assetsInformation = AssetsInformation() self.modifyLayout = QtWidgets.QHBoxLayout() self.modifyButton = dy.MPushButton(u"修改").primary() self.modifyButton.setMinimumWidth(180) self.modifyButton.setMinimumHeight(150) self.setup_ui() self.connect_ui() self.set_theme()
def __init__(self): super(SetLibraryUI, self).__init__() self.setWindowTitle("配置Library") self.MainLayout = QtWidgets.QVBoxLayout(self) # Root Path 设置 self.RootPathLayout = QtWidgets.QHBoxLayout() self.RootPathLabel = dy.MLabel("Root Path:").strong() self.RootPathLine = dy.MLineEdit() self.RootPathButton = dy.MPushButton("打开") # 设置type self.CategoryLayout = QtWidgets.QVBoxLayout() self.CHLayout = QtWidgets.QVBoxLayout() self.CHLabel = dy.MLabel("角色").strong().h2() self.PropLayout = QtWidgets.QVBoxLayout() self.PropLabel = dy.MLabel("道具").strong().h2() self.SCLayout = QtWidgets.QVBoxLayout() self.SCLabel = dy.MLabel("场景").strong().h2() self.setup_ui()
def __init__(self, parent): super(CardMenu, self).__init__() self.parent = parent self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.FramelessWindowHint) self.mainLayout = QtWidgets.QVBoxLayout(self) self.importMayaButton = dy.MPushButton( u"导入Maya文件", icon=dy.qt.MIcon(package.get("LibIcon/app-maya.png"))).tiny() self.importZbButton = dy.MPushButton( u"打开Zbrush文件", icon=dy.qt.MIcon(package.get("LibIcon/Zbrush.png"))).tiny() self.importSpButton = dy.MPushButton( u"打开Sp文件", icon=dy.qt.MIcon(package.get("LibIcon/SP_Icon.png"))).tiny() self.openDirButton = dy.MPushButton( u"打开资产文件夹", icon=dy.qt.MIcon(package.get("LibIcon/folder_fill.svg"))).tiny() self.removeCardButton = dy.MPushButton( u"从资产库删除资产", icon=dy.qt.MIcon( package.get("LibIcon/trash_line.svg"))).tiny().warning() self.setProjectButton = dy.MPushButton( u"设置项目", icon=dy.qt.MIcon(package.get("LibIcon/gongju_an.svg"))).tiny() self.setProjectButton.hide() self.set_theme() self.setup_ui() self.connect_ui()
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): """ 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()