initial fluent-widgets ui

This commit is contained in:
2025-08-14 18:45:16 +08:00
parent 746e83ab23
commit 4c66886257
1198 changed files with 805339 additions and 0 deletions

View File

@ -0,0 +1,45 @@
# coding:utf-8
import sys
from PySide6.QtCore import Qt
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QApplication, QWidget, QHBoxLayout
from qfluentwidgets import PipsScrollButtonDisplayMode, HorizontalPipsPager, VerticalPipsPager, setTheme, Theme
class Demo(QWidget):
def __init__(self):
super().__init__()
# setTheme(Theme.DARK)
# self.setStyleSheet('Demo{background:rgb(32,32,32)}')
self.vPager = VerticalPipsPager(self)
self.hPager = HorizontalPipsPager(self)
# set the number of page
self.hPager.setPageNumber(15)
self.vPager.setPageNumber(15)
# set the number of displayed pips
self.hPager.setVisibleNumber(8)
self.hPager.setNextButtonDisplayMode(PipsScrollButtonDisplayMode.ALWAYS)
self.hPager.setPreviousButtonDisplayMode(PipsScrollButtonDisplayMode.ALWAYS)
# set the display mode of scroll button
self.vPager.setNextButtonDisplayMode(PipsScrollButtonDisplayMode.ALWAYS)
self.vPager.setPreviousButtonDisplayMode(PipsScrollButtonDisplayMode.ON_HOVER)
self.setLayout(QHBoxLayout())
self.layout().addWidget(self.hPager)
self.layout().addWidget(self.vPager)
self.resize(500, 500)
if __name__ == '__main__':
app = QApplication(sys.argv)
w = Demo()
w.show()
app.exec()

View File

@ -0,0 +1,35 @@
# coding:utf-8
import sys
from PySide6.QtCore import QEasingCurve, Qt
from PySide6.QtGui import QPixmap
from PySide6.QtWidgets import QApplication
from qfluentwidgets import SmoothScrollArea, PixmapLabel, ScrollBarHandleDisplayMode
class Demo(SmoothScrollArea):
def __init__(self):
super().__init__()
self.label = PixmapLabel(self)
self.label.setPixmap(QPixmap("resource/shoko.jpg"))
# display the handle only when mouse hover the scroll bar region
# self.delegate.vScrollBar.setHandleDisplayMode(ScrollBarHandleDisplayMode.ON_HOVER)
# customize scroll animation
self.setScrollAnimation(Qt.Vertical, 500, QEasingCurve.OutQuint)
self.setScrollAnimation(Qt.Horizontal, 500, QEasingCurve.OutQuint)
self.horizontalScrollBar().setValue(1900)
self.setWidget(self.label)
self.resize(960, 640)
with open('resource/demo.qss', encoding='utf-8') as f:
self.setStyleSheet(f.read())
if __name__ == '__main__':
app = QApplication(sys.argv)
w = Demo()
w.show()
app.exec()

View File

@ -0,0 +1,3 @@
QScrollArea {
border: none;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 KiB