Fix #2085825 [Mark and select books buttton - FTS dialogue - lighter green in dark mode](https://bugs.launchpad.net/calibre/+bug/2085825)

This commit is contained in:
Kovid Goyal 2024-10-29 20:25:17 +05:30
parent adc64d7378
commit bad1a15d0e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -44,10 +44,13 @@ ALIGNMENT_MAP = {'left': Qt.AlignmentFlag.AlignLeft, 'right': Qt.AlignmentFlag.A
Qt.AlignmentFlag.AlignHCenter} Qt.AlignmentFlag.AlignHCenter}
def render_pin(color='green', save_to=None): def render_pin(color=None, save_to=None):
app = QApplication.instance()
if color is None:
color = '#00b000' if app.is_dark_theme else 'green'
svg = P('pin-template.svg', data=True).replace(b'fill:#f39509', ('fill:' + color).encode('utf-8')) svg = P('pin-template.svg', data=True).replace(b'fill:#f39509', ('fill:' + color).encode('utf-8'))
pm = QPixmap() pm = QPixmap()
dpr = QApplication.instance().devicePixelRatio() dpr = app.devicePixelRatio()
pm.setDevicePixelRatio(dpr) pm.setDevicePixelRatio(dpr)
pm.loadFromData(svg, 'svg') pm.loadFromData(svg, 'svg')
if save_to: if save_to: