Files
leonpan-pc/app/view/widgets/custom_background_messageBox.py

24 lines
802 B
Python
Raw Normal View History

2025-10-29 22:20:21 +08:00
# coding: utf-8
from pathlib import Path
from qfluentwidgets import HorizontalFlipView, MessageBoxBase, SubtitleLabel
class CustomBgMessageBox(MessageBoxBase):
def __init__(self, parent=None):
super().__init__(parent=parent)
self.titleLabel = SubtitleLabel(parent=self)
self.titleLabel.setText("内设壁纸")
self.viewLayout.addWidget(self.titleLabel)
self.imageChoice = HorizontalFlipView(parent=self)
self.imageChoice.setBorderRadius(8)
for i in range(0, 6):
self.imageChoice.addImage(f"app\\resource\\images\\bg{i}.png")
self.viewLayout.addWidget(self.imageChoice)
self.yesButton.setText("确定")
self.cancelButton.hide()
def returnImage(self):
return self.imageChoice.currentIndex()