mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More stupid PyQt enums
This commit is contained in:
parent
15407e24ab
commit
7709deb8d5
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
from PyQt5.Qt import (
|
from PyQt5.Qt import (
|
||||||
QApplication, QBrush, QColor, QFont, QFontMetrics, QPen, QPixmap, QSplashScreen,
|
QApplication, QBrush, QColor, QFont, QFontMetrics, QPen, QPixmap, QSplashScreen,
|
||||||
Qt
|
Qt, QPainter
|
||||||
)
|
)
|
||||||
|
|
||||||
from calibre.constants import __appname__, numeric_version
|
from calibre.constants import __appname__, numeric_version
|
||||||
@ -55,8 +55,8 @@ class SplashScreen(QSplashScreen):
|
|||||||
def drawContents(self, painter):
|
def drawContents(self, painter):
|
||||||
self.drawn_once = True
|
self.drawn_once = True
|
||||||
painter.save()
|
painter.save()
|
||||||
painter.setRenderHint(painter.TextAntialiasing, True)
|
painter.setRenderHint(QPainter.RenderHint.TextAntialiasing, True)
|
||||||
painter.setRenderHint(painter.Antialiasing, True)
|
painter.setRenderHint(QPainter.RenderHint.Antialiasing, True)
|
||||||
pw = self.LOGO_SIZE
|
pw = self.LOGO_SIZE
|
||||||
height = max(pw, self.total_height)
|
height = max(pw, self.total_height)
|
||||||
width = self.width()
|
width = self.width()
|
||||||
|
@ -199,7 +199,7 @@ class Replace(Command):
|
|||||||
img = self.after_image = QImage(canvas.current_image)
|
img = self.after_image = QImage(canvas.current_image)
|
||||||
rect = QRectF(*get_selection_rect(img, canvas.selection_state.rect, canvas.target))
|
rect = QRectF(*get_selection_rect(img, canvas.selection_state.rect, canvas.target))
|
||||||
p = QPainter(img)
|
p = QPainter(img)
|
||||||
p.setRenderHint(p.SmoothPixmapTransform, True)
|
p.setRenderHint(QPainter.RenderHint.SmoothPixmapTransform, True)
|
||||||
p.drawImage(rect, pimg, QRectF(pimg.rect()))
|
p.drawImage(rect, pimg, QRectF(pimg.rect()))
|
||||||
p.end()
|
p.end()
|
||||||
return self.after_image
|
return self.after_image
|
||||||
|
@ -40,7 +40,7 @@ def create_icon(text, palette=None, sz=None, divider=2, fill='white'):
|
|||||||
img = QImage(sz, sz, QImage.Format.Format_ARGB32)
|
img = QImage(sz, sz, QImage.Format.Format_ARGB32)
|
||||||
img.fill(Qt.GlobalColor.transparent)
|
img.fill(Qt.GlobalColor.transparent)
|
||||||
p = QPainter(img)
|
p = QPainter(img)
|
||||||
p.setRenderHints(p.TextAntialiasing | p.Antialiasing)
|
p.setRenderHints(QPainter.RenderHint.TextAntialiasing | QPainter.RenderHint.Antialiasing)
|
||||||
if fill is not None:
|
if fill is not None:
|
||||||
qDrawShadeRect(p, img.rect(), palette, fill=fill, lineWidth=1, midLineWidth=1)
|
qDrawShadeRect(p, img.rect(), palette, fill=fill, lineWidth=1, midLineWidth=1)
|
||||||
f = p.font()
|
f = p.font()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user