提交 fcb5124f 编写于 作者: 之一Yo's avatar 之一Yo

将亚克力标签设置为可选项

上级 fde0bef0
......@@ -26,14 +26,13 @@
## Install
To install use pip:
To install lite version (`AcrylicLabel` is not available):
```shell
pip install PyQt-Fluent-Widgets
```
Or clone the repo:
Or install full-featured version:
```shell
git clone https://github.com/zhiyiYo/PyQt-Fluent-Widgets.git
python setup.py install
pip install 'PyQt-Fluent-Widgets[full]'
```
## Run Example
......
## Quick start
### Install
To install use pip:
To install lite version (`AcrylicLabel` is not available) use pip:
```shell
pip install PyQt-Fluent-Widgets
```
Or clone the repo:
Or install full-featured version use pip:
```shell
git clone https://github.com/zhiyiYo/PyQt-Fluent-Widgets.git
python setup.py install
pip install 'PyQt-Fluent-Widgets[full]'
```
### Run example
......
......@@ -4,7 +4,7 @@ import sys
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QApplication
from qfluentwidgets import AcrylicLabel
from qfluentwidgets.components.widgets.label import AcrylicLabel
app = QApplication(sys.argv)
......
......@@ -10,7 +10,7 @@ online at https://pyqt-fluent-widgets.readthedocs.io.
:license: MIT, see LICENSE for more details.
"""
__version__ = "0.2.0"
__version__ = "0.2.1"
from .components import *
from .common import *
......
from .config import *
from .auto_wrap import TextWrap
from .icon import Icon, getIconColor
from .image_utils import DominantColor, gaussianBlur
from .style_sheet import setStyleSheet, getStyleSheet
\ No newline at end of file
from .label import AcrylicLabel, PixmapLabel
from .menu import DWMMenu, LineEditMenu
from .slider import Slider, HollowHandleStyle
from .stacked_widget import PopUpAniStackedWidget, OpacityAniStackedWidget
......
# coding:utf-8
import warnings
from PyQt5.QtCore import Qt, QThread, pyqtSignal
from PyQt5.QtGui import QBrush, QColor, QImage, QPainter, QPixmap
from PyQt5.QtWidgets import QLabel
from ...common.image_utils import gaussianBlur
try:
from ...common.image_utils import gaussianBlur
except ImportError as e:
warnings.warn('`AcrylicLabel` is not supported in current qfluentwidgets, use `pip install PyQt-Fluent-Widgets[full]` to enable it.')
class BlurCoverThread(QThread):
......@@ -138,29 +144,3 @@ class AcrylicLabel(QLabel):
if not self.blurPixmap.isNull():
self.setPixmap(self.blurPixmap.scaled(
self.size(), Qt.KeepAspectRatioByExpanding, Qt.SmoothTransformation))
class PixmapLabel(QLabel):
""" Label for high dpi screen """
def __init__(self, parent=None):
super().__init__(parent)
self.__pixmap = QPixmap()
def setPixmap(self, pixmap: QPixmap):
self.__pixmap = pixmap
self.setFixedSize(pixmap.size())
self.update()
def pixmap(self):
return self.__pixmap
def paintEvent(self, e):
if self.__pixmap.isNull():
return
painter = QPainter(self)
painter.setRenderHints(QPainter.Antialiasing |
QPainter.SmoothPixmapTransform)
painter.setPen(Qt.NoPen)
painter.drawPixmap(self.rect(), self.__pixmap)
\ No newline at end of file
# coding:utf-8
from PyQt5.QtCore import QEasingCurve, QPropertyAnimation, Qt, QTimer, pyqtSignal, QSize, QPoint, QRectF
from PyQt5.QtGui import QPainter, QPixmap
from PyQt5.QtGui import QPainter
from PyQt5.QtWidgets import QLabel, QWidget, QToolButton, QGraphicsOpacityEffect
from PyQt5.QtSvg import QSvgRenderer, QSvgWidget
from .label import PixmapLabel
from ...common import setStyleSheet
......
......@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
setuptools.setup(
name="PyQt-Fluent-Widgets",
version="0.2.0",
version="0.2.1",
keywords="pyqt fluent widgets",
author="zhiyiYo",
author_email="shokokawaii@outlook.com",
......@@ -19,10 +19,10 @@ setuptools.setup(
install_requires=[
"PyQt5-Frameless-Window",
"darkdetect",
"scipy",
"pillow",
"colorthief",
],
extras_require = {
'full': ['scipy', 'pillow', 'colorthief']
},
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册