Beispiel #1
0
    def __init__(self, parent=None):
        super().__init__(parent)

        # 按钮图标位置
        clear_iconPath_dict = {
            'normal':
            r'resource\images\searchLineEdit\搜索框清空按钮_normal_45_45.png',
            'hover': r'resource\images\searchLineEdit\搜索框清空按钮_hover_45_45.png',
            'pressed':
            r'resource\images\searchLineEdit\搜索框清空按钮_pressed_45_45.png'
        }
        self.__search_iconPath_dict = {
            'normal':
            r'resource\images\searchLineEdit\搜索框透明搜索按钮_normal_46_45.png',
            'hover':
            r'resource\images\searchLineEdit\搜索框透明搜索按钮_hover_46_45.png',
            'pressed':
            r'resource\images\searchLineEdit\搜索框搜索按钮_pressed_46_45.png'
        }
        # 实例化按钮
        self.clearButton = ThreeStateButton(clear_iconPath_dict, self,
                                            (46, 45))
        self.searchButton = ThreeStateButton(self.__search_iconPath_dict, self,
                                             (46, 45))
        # 实例化右击菜单
        self.menu = LineEditMenu(self)
        # 初始化界面
        self.__initWidget()
Beispiel #2
0
 def __init__(self, playlist: list = None, parent=None):
     super().__init__(parent)
     self.playlist = playlist.copy()
     self.currentIndex = 0
     self.isPlaylistVisible = False
     # 创建小部件
     self.blurPixmap = None
     self.blurBackgroundPic = QLabel(self)
     self.blurCoverThread = BlurCoverThread(self)
     self.songInfoCardChute = SongInfoCardChute(self, self.playlist)
     self.parallelAniGroup = QParallelAnimationGroup(self)
     self.songInfoCardChuteAni = QPropertyAnimation(self.songInfoCardChute,
                                                    b'geometry')
     self.playBar = PlayBar(self)
     self.songListWidget = SongListWidget(self.playlist, self)
     self.smallestModeInterface = SmallestPlayModeInterface(playlist, self)
     self.playBarAni = QPropertyAnimation(self.playBar, b'geometry')
     self.songListWidgetAni = QPropertyAnimation(self.songListWidget,
                                                 b'geometry')
     self.guideLabel = QLabel('在这里,你将看到正在播放的歌曲以及即将播放的歌曲。', self)
     self.randomPlayAllButton = ThreeStateButton(
         {
             'normal':
             r'resource\images\playing_interface\全部随机播放_normal_256_39.png',
             'hover':
             r'resource\images\playing_interface\全部随机播放_hover_256_39.png',
             'pressed':
             r'resource\images\playing_interface\全部随机播放_pressed_256_39.png'
         }, self, (256, 39))
     # 创建定时器
     self.showPlaylistTimer = QTimer(self)
     self.hidePlaylistTimer = QTimer(self)
     # 初始化
     self.__initWidget()
Beispiel #3
0
 def __init__(self, parent=None, songInfo: dict = None):
     super().__init__(parent)
     self.songInfo = {}
     if songInfo:
         self.songInfo = songInfo
     self.__lastSongIconPath = {
         'normal':
         r'resource\images\sub_play_window\lastSong_50_50_normal.png',
         'hover':
         r'resource\images\sub_play_window\lastSong_50_50_hover.png',
         'pressed':
         r'resource\images\sub_play_window\lastSong_50_50_pressed.png'
     }
     self.__nextSongIconPath = {
         'normal':
         r'resource\images\sub_play_window\nextSong_50_50_normal.png',
         'hover':
         r'resource\images\sub_play_window\nextSong_50_50_hover.png',
         'pressed':
         r'resource\images\sub_play_window\nextSong_50_50_pressed.png'
     }
     # 创建小部件
     self.volumeSlider = Slider(Qt.Vertical, self)
     self.volumeLabel = QLabel(self)
     self.lastSongButton = ThreeStateButton(self.__lastSongIconPath, self,
                                            (50, 50))
     self.playButton = PlayButton(self)
     self.nextSongButton = ThreeStateButton(self.__nextSongIconPath, self,
                                            (50, 50))
     self.albumPic = QLabel(self)
     self.songNameLabel = QLabel(self)
     self.songerNameLabel = QLabel(self)
     self.ani = QPropertyAnimation(self, b'windowOpacity')
     self.timer = QTimer(self)
     # 系统音量控制类
     self.systemVolume = SystemVolume()
     # 初始化
     self.__initWidget()
Beispiel #4
0
    def __init__(self, text='', parent=None):
        super().__init__(text, parent)
        iconPath_dict = {
            'normal':
            r'resource\images\createPlaylistPanel\清空按钮_normal_50_50.png',
            'hover':
            r'resource\images\createPlaylistPanel\清空按钮_hover_50_50.png',
            'pressed':
            r'resource\images\createPlaylistPanel\清空按钮_pressed_50_50.png'
        }

        # 创建小部件
        self.clearButton = ThreeStateButton(iconPath_dict, self, (50, 50))
        self.pencilPic = QLabel(self)
        self.menu = LineEditMenu(self)
        # 初始化
        self.initWidget()
        self.setQss()
Beispiel #5
0
    def __init__(self, string=None, parent=None, isNeedClearBt: bool = True):
        super().__init__(string, parent)
        self.isNeedClearBt = isNeedClearBt
        # 设置提示条和鼠标点击次数
        self.customToolTip = None
        self.clickedTime = 0
        iconPath_dict = {
            'normal': r'resource\images\lineEdit\clearInfo_cross_normal.png',
            'hover': r'resource\images\lineEdit\clearInfo_cross_hover.png',
            'pressed': r'resource\images\lineEdit\clearInfo_cross_pressed.png'
        }

        # 实例化一个用于清空内容的按钮
        self.clearButton = ThreeStateButton(iconPath_dict, self)
        # 实例化右击菜单
        self.menu = LineEditMenu(self)
        # 实例化布局
        self.h_layout = QHBoxLayout()
        self.initWidget()
 def __createWidgets(self):
     """ 创建小部件 """
     # 创建磨砂背景
     self.scrollArea = ScrollArea(self)
     self.scrollWidget = QWidget(self)
     self.gridLayout = GridLayout()
     self.blurBackground = BlurBackground(self.scrollWidget)
     # 创建播放列表卡
     self.__createPlaylistCards()
     # 创建白色遮罩
     self.whiteMask = QWidget(self)
     self.sortModeLabel = QLabel('排序依据:', self)
     self.playlistLabel = QLabel('播放列表', self)
     self.sortModeButton = QPushButton('修改日期', self)
     self.createPlaylistButton = ThreeStateButton(
         {
             'normal':
             r'resource\images\playlist_card_interface\newPlaylist_normal.png',
             'hover':
             r'resource\images\playlist_card_interface\newPlaylist_hover.png',
             'pressed':
             r'resource\images\playlist_card_interface\newPlaylist_pressed.png'
         }, self, (129, 19))
     # 创建导航标签
     self.guideLabel = QLabel('这里没有可显示的内容。请尝试其他筛选器。', self)
     self.guideLabel.setStyleSheet(
         "color: black; font: 25px 'Microsoft YaHei'")
     self.guideLabel.resize(500, 26)
     self.guideLabel.move(44, 196)
     # 创建排序菜单
     self.sortModeMenu = AeroMenu(parent=self)
     self.sortByModifiedTimeAct = QAction(
         '修改时间',
         self,
         triggered=lambda: self.__sortPlaylist('modifiedTime'))
     self.sortByAToZAct = QAction(
         'A到Z', self, triggered=lambda: self.__sortPlaylist('AToZ'))
     self.sortAct_list = [self.sortByModifiedTimeAct, self.sortByAToZAct]
     # 创建选择状态栏
     self.selectionModeBar = SelectionModeBar(self)
     # 记录当前的排序方式
     self.currentSortAct = self.sortByModifiedTimeAct
Beispiel #7
0
    def createWidgets(self):
        """ 创建小部件 """
        icon_path = {
            'normal':
            r'resource\images\createPlaylistPanel\stateToolTip_closeBt_normal_14_14.png',
            'hover':
            r'resource\images\createPlaylistPanel\stateToolTip_closeBt_hover_14_14.png',
            'pressed':
            r'resource\images\createPlaylistPanel\stateToolTip_closeBt_hover_14_14.png'
        }

        self.closeButton = ThreeStateButton(icon_path, self, (14, 14))
        self.titleLabel = QLabel(self.title, self)
        self.contentLabel = QLabel(self.content, self)
        self.rotateTimer = QTimer(self)
        self.closeTimer = QTimer(self)
        self.animation = QPropertyAnimation(self, b'windowOpacity')
        self.busyImage = QPixmap(
            r'resource\images\createPlaylistPanel\running_22_22.png')
        self.doneImage = QPixmap(
            r'resource\images\createPlaylistPanel\complete_20_20.png')