def __init__(self, duration: str = "0:00", parent=None): super().__init__(parent) # 创建两个标签和一个进度条 self.progressSlider = Slider(Qt.Horizontal, self) self.currentTimeLabel = QLabel("0:00", self) self.totalTimeLabel = QLabel(duration, self) # 初始化界面 self.__initWidget() self.__setQss()
def __init__(self, duration: str, parent=None): super().__init__(parent) # 创建两个标签和一个进度条 self.progressSlider = Slider(Qt.Horizontal, self) self.currentTimeLabel = QLabel("0:00", self) self.totalTimeLabel = QLabel(duration, self) # 创建布局 self.h_layout = QHBoxLayout() # 初始化界面 self.__initUI()
def __init__(self, parent=None): super().__init__(parent) # 创建小部件 self.volumeButton = VolumeButton(self) self.volumeSlider = Slider(Qt.Horizontal, self) self.smallPlayModeButton = BasicButton( r"app\resource\images\playBar\最小播放模式_45_45.png", self ) self.moreActionsButton = BasicButton( r"app\resource\images\playBar\更多操作_45_45.png", self ) self.widget_list = [ self.volumeButton, self.volumeSlider, self.smallPlayModeButton, self.moreActionsButton, ] # 创建布局 self.h_layout = QHBoxLayout() # 初始化界面 self.__initWidget() self.__initLayout()
def __init__(self, parent=None, songInfo: dict = None): super().__init__(parent) self.songInfo = {} if songInfo: self.songInfo = songInfo self.__lastSongIconPath = { "normal": r"app\resource\images\sub_play_window\lastSong_50_50_normal.png", "hover": r"app\resource\images\sub_play_window\lastSong_50_50_hover.png", "pressed": r"app\resource\images\sub_play_window\lastSong_50_50_pressed.png", } self.__nextSongIconPath = { "normal": r"app\resource\images\sub_play_window\nextSong_50_50_normal.png", "hover": r"app\resource\images\sub_play_window\nextSong_50_50_hover.png", "pressed": r"app\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()
def __init__(self, parent=None): super().__init__(parent) self.volumeButton = VolumeButton(self) self.volumeSlider = Slider(Qt.Horizontal, self) # 初始化 self.__initWidget()