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 __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): 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 __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()