Ejemplo n.º 1
0
 def _initUi(self):
     """初始UI"""
     self.setupUi(self)
     # 隐藏还原按钮
     self.buttonNormal.setVisible(False)
     # 隐藏目录树的滑动条
     self.treeViewCatalogs.verticalScrollBar().setVisible(False)
     # 加载主题
     ThemeManager.loadTheme()
     # 加载鼠标样式
     ThemeManager.loadCursor(self.widgetMain)
     ThemeManager.setPointerCursors([
         self.buttonHead,  # 主界面头像
         self.buttonSearch,  # 主界面搜索按钮
         self.buttonGithub,  # Github按钮
         self.buttonQQ,  # QQ按钮
         self.buttonGroup,  # 群按钮
         self.buttonBackToUp,  # 返回顶部按钮
         self.buttonHome  # 显示主页readme
     ])
     # 安装事件过滤器用于还原鼠标样式
     self.widgetMain.installEventFilter(self)
     # 绑定返回顶部提示框
     ToolTip.bind(self.buttonBackToUp)
     ToolTip.bind(self.buttonHome)
     # 头像提示控件
     ToolTip.bind(self.buttonHead)
Ejemplo n.º 2
0
    def _initUi(self):
        """初始UI"""
        self.setupUi(self)

        # 隐藏还原按钮
        self.buttonNormal.setVisible(False)
        # 加载鼠标样式
        ThemeManager.loadCursor(self.widgetMain)
        ThemeManager.setPointerCursors([
            self.buttonHead,  # 主界面头像
            self.buttonGithub,  # Github按钮
            self.buttonQQ,  # QQ按钮
            self.buttonGroup,  # 群按钮
            self.buttonBackToUp,  # 返回顶部按钮
            self.buttonHome  # 显示主页readme
        ])
        # 安装事件过滤器用于还原鼠标样式
        self.widgetMain.installEventFilter(self)
        # 绑定返回顶部提示框
        ToolTip.bind(self.buttonBackToUp)
        ToolTip.bind(self.buttonHome)
        # 头像提示控件
        ToolTip.bind(self.buttonHead)
        # 加载主题
        colourful = Setting.value('colourful')
        picture = Setting.value('picture', 'Resources/Images/Wallpaper/t014d05b7c3e1708b2d.jpg', str)
        AppLog.debug('colourful: %s', str(colourful))
        AppLog.debug('picture: %s', picture)
        if picture:
            ThemeManager.loadFont()
            ThemeManager.loadPictureTheme(picture)

        self._initMyMplCanvas()
Ejemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     super(Window, self).__init__(*args, **kwargs)
     self.setAttribute(Qt.WA_TranslucentBackground, True)
     self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
     self.setupUi(self)
     t = time()
     ThemeManager.loadTheme()
     print(time() - t)
     ThemeManager.loadCursor(self)
     ThemeManager.loadCursor(self.buttonHead, ThemeManager.CursorPointer)
Ejemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     super(IssuesDialog, self).__init__(*args, **kwargs)
     self.setupUi(self)
     # 关闭后自动销毁
     self.setAttribute(Qt.WA_DeleteOnClose, True)
     # 背景透明
     self.setAttribute(Qt.WA_TranslucentBackground, True)
     # 无边框
     self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
     # 加载鼠标样式
     ThemeManager.loadCursor(self)
Ejemplo n.º 5
0
 def __init__(self, message, *args, reqfile='', **kwargs):
     super(ErrorDialog, self).__init__(*args, **kwargs)
     self.reqfile = reqfile
     self.setupUi(self)
     # 关闭后自动销毁
     self.setAttribute(Qt.WA_DeleteOnClose, True)
     # 背景透明
     self.setAttribute(Qt.WA_TranslucentBackground, True)
     # 无边框
     self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
     # 加载鼠标样式
     ThemeManager.loadCursor(self)
     self.plainTextEditDetail.appendPlainText(message)
Ejemplo n.º 6
0
 def __init__(self, *args, **kwargs):
     super(Window, self).__init__(*args, **kwargs)
     self.setAttribute(Qt.WA_TranslucentBackground, True)
     self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
     self.setupUi(self)
     self.buttonClose.clicked.connect(self.close)
     self.buttonMaximum.clicked.connect(self.showMaximized)
     self.buttonMinimum.clicked.connect(self.showMinimized)
     self.buttonNormal.clicked.connect(self.showNormal)
     t = time()
     ThemeManager.loadTheme()
     print(time() - t)
     ThemeManager.loadCursor(self)
     ThemeManager.loadCursor(self.buttonHead, ThemeManager.CursorPointer)
Ejemplo n.º 7
0
 def __init__(self, *args, **kwargs):
     super(UpdateDialog, self).__init__(*args, **kwargs)
     self.setupUi(self)
     # 关闭后自动销毁
     self.setAttribute(Qt.WA_DeleteOnClose, True)
     # 背景透明
     self.setAttribute(Qt.WA_TranslucentBackground, True)
     # 无边框
     self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
     # 加载鼠标样式
     ThemeManager.loadCursor(self)
     Signals.updateTextChanged.connect(self.onUpdateTextChanged)
     Signals.updateProgressChanged.connect(self.onUpdateProgressChanged)
     Signals.updateFinished.connect(self.labelMessage.setText)
Ejemplo n.º 8
0
 def __init__(self, *args, **kwargs):
     super(SkinDialog, self).__init__(*args, **kwargs)
     self.setupUi(self)
     # 背景透明
     self.setAttribute(Qt.WA_TranslucentBackground, True)
     # 无边框
     self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
     self.widgetBottom.setVisible(False)
     # 预览界面
     self.previewWidget = PreviewWidget(self.widgetSkinBg)
     self.previewWidget.setVisible(False)
     # 初始化信号槽
     self._initSignals()
     # 加载鼠标样式
     ThemeManager.loadCursor(self)
     self.on_tabWidgetSkinMain_currentChanged(0)
Ejemplo n.º 9
0
 def onColourfulItemAddFinished(self):
     """添加完成
     """
     return
     # 添加一个+按钮
     self.buttonAdd = QPushButton('+',
                                  self,
                                  objectName='buttonAdd',
                                  clicked=self.onAddNewColor)
     # 加载鼠标样式
     ThemeManager.loadCursor(self.buttonAdd, ThemeManager.CursorPointer)
     if self.lastCol == 4:
         self.lastCol = 0
         self.lastRow += 1
     else:
         self.lastCol += 1
     self.gridLayout.addWidget(self.buttonAdd, self.lastRow, self.lastCol)
Ejemplo n.º 10
0
 def _initUi(self):
     """初始UI"""
     self.setupUi(self)
     # 隐藏还原按钮
     self.buttonNormal.setVisible(False)
     # 隐藏目录树的滑动条
     self.treeViewCatalogs.verticalScrollBar().setVisible(False)
     # 加载鼠标样式
     ThemeManager.loadCursor(self.widgetMain)
     ThemeManager.setPointerCursors([
         self.buttonHead,            # 主界面头像
         self.buttonClear,           # 主界面清空按钮
         self.buttonGithub,          # Github按钮
         self.buttonQQ,              # QQ按钮
         self.buttonGroup,           # 群按钮
         self.buttonBackToUp,        # 返回顶部按钮
         self.buttonHome             # 显示主页readme
     ])
     # 安装事件过滤器用于还原鼠标样式
     self.widgetMain.installEventFilter(self)
     # 绑定返回顶部提示框
     ToolTip.bind(self.buttonBackToUp)
     ToolTip.bind(self.buttonHome)
     # 头像提示控件
     ToolTip.bind(self.buttonHead)
     # 加载主题
     colourful = Setting.value('colourful')
     picture = Setting.value('picture', '', str)
     AppLog.debug('colourful: %s', str(colourful))
     AppLog.debug('picture: %s', picture)
     if picture:
         ThemeManager.loadFont()
         ThemeManager.loadPictureTheme(picture)
     elif colourful:
         ThemeManager.loadFont()
         if isinstance(picture, QColor):
             ThemeManager.loadColourfulTheme(colourful)
         else:
             # json数据转渐变
             ThemeManager.loadColourfulTheme(
                 GradientUtils.toGradient(colourful))
     else:
         ThemeManager.loadTheme()
Ejemplo n.º 11
0
 def __init__(self, name, colorimg, signal, *args, **kwargs):
     super(SkinBaseItemWidget, self).__init__(*args, **kwargs)
     self.setObjectName('skinBaseItemWidget')
     # 加载鼠标样式
     ThemeManager.loadCursor(self, ThemeManager.CursorPointer)
     self.name = name
     self.colorimg = colorimg
     self.hovered = False
     self.signal = signal
     self.colorHover = QColor(0, 0, 0, 40)
     self._textHoverColor = QColor(18, 183, 245)
     self.textColor = QColor(102, 102, 102)
     self.image = None
     # 图片
     if isinstance(self.colorimg, str) and os.path.isfile(self.colorimg):
         self.image = QPixmap(self.colorimg).scaled(PixmapWidth,
                                                    PixmapHeight,
                                                    Qt.IgnoreAspectRatio,
                                                    Qt.SmoothTransformation)
Ejemplo n.º 12
0
 def __init__(self, *args, **kwargs):
     super(PreviewWidget, self).__init__(*args, **kwargs)
     self.setupUi(self)
     self.setAttribute(Qt.WA_StyledBackground, True)  # 支持样式
     # 图片边缘阴影效果
     effect = QGraphicsDropShadowEffect(self.labelPreviewImage)
     effect.setBlurRadius(40)
     effect.setOffset(0, 0)
     effect.setColor(Qt.gray)
     self.labelPreviewImage.setGraphicsEffect(effect)
     # 鼠标样式
     ThemeManager.loadCursor(self, ThemeManager.CursorDefault)
     ThemeManager.loadCursor(self.buttonPreviewApply,
                             ThemeManager.CursorPointer)
     ThemeManager.loadCursor(self.buttonPreviewClose,
                             ThemeManager.CursorPointer)
     ThemeManager.loadCursor(self.buttonPreviewNext,
                             ThemeManager.CursorPointer)
     ThemeManager.loadCursor(self.buttonPreviewPrevious,
                             ThemeManager.CursorPointer)
Ejemplo n.º 13
0
 def __init__(self, *args, **kwargs):
     super(LoginDialog, self).__init__(*args, **kwargs)
     self.setupUi(self)
     # 设置闪烁的目标控件
     self.setTarget(self.widgetLogin)
     # 关闭后自动销毁
     self.setAttribute(Qt.WA_DeleteOnClose, True)
     # 背景透明
     self.setAttribute(Qt.WA_TranslucentBackground, True)
     # 无边框
     self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
     # 加载鼠标样式
     ThemeManager.loadCursor(self)
     # 加载鼠标样式
     ThemeManager.loadCursor(self.buttonHead, ThemeManager.CursorPointer)
     # 是否正在登录
     self._isLogin = False
     Signals.loginErrored.connect(self.onLoginErrored)
     Signals.loginSuccessed.connect(self.onLoginSuccessed)
     QTimer.singleShot(100, self.initAccount)
Ejemplo n.º 14
0
 def __init__(self, alipayImg, wechatImg, *args, **kwargs):
     super(DonateDialog, self).__init__(*args, **kwargs)
     self.setupUi(self)
     # 关闭后自动销毁
     self.setAttribute(Qt.WA_DeleteOnClose, True)
     # 背景透明
     self.setAttribute(Qt.WA_TranslucentBackground, True)
     # 无边框
     self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
     # 加载鼠标样式
     ThemeManager.loadCursor(self)
     # 加载鼠标样式
     ThemeManager.loadCursor(self.labelAlipayImg)
     ThemeManager.loadCursor(self.labelWechatImg, 'pointer.png')
     # 加载图片
     self.labelAlipayImg.setPixmap(
         QPixmap(alipayImg).scaled(300, 300, Qt.IgnoreAspectRatio,
                                   Qt.SmoothTransformation))
     self.labelWechatImg.setPixmap(
         QPixmap(wechatImg).scaled(300, 300, Qt.IgnoreAspectRatio,
                                   Qt.SmoothTransformation))