Skip to content

Commit

Permalink
Use a darker green for "Update found" label in dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Jun 4, 2024
1 parent f76440f commit 7f53e64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/calibre/gui2/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import ssl
from threading import Event, Thread

from qt.core import QCheckBox, QDialog, QDialogButtonBox, QGridLayout, QIcon, QLabel, QObject, Qt, QUrl, pyqtSignal
from qt.core import QApplication, QCheckBox, QDialog, QDialogButtonBox, QGridLayout, QIcon, QLabel, QObject, Qt, QUrl, pyqtSignal

from calibre import as_unicode, prints
from calibre.constants import __appname__, __version__, ismacos, isportable, iswindows, numeric_version
Expand Down Expand Up @@ -206,17 +206,17 @@ def update_found(self, calibre_version, number_of_plugin_updates, force=False, n
self.plugin_update_found(number_of_plugin_updates)
version_url = as_hex_unicode(msgpack_dumps((calibre_version, number_of_plugin_updates)))
calibre_version = '.'.join(map(str, calibre_version))

if not has_calibre_update and not has_plugin_updates:
self.status_bar.update_label.setVisible(False)
return
if has_calibre_update:
plt = ''
if has_plugin_updates:
plt = ngettext(' and one plugin update', ' and {} plugin updates', number_of_plugin_updates).format(number_of_plugin_updates)
msg = ('<span style="color:green; font-weight: bold">%s: '
green = 'darkgreen' if QApplication.instance().is_dark_theme else 'green'
msg = ('<span style="color:%s; font-weight: bold">%s: '
'<a href="update:%s">%s%s</a></span>') % (
_('Update found'), version_url, calibre_version, plt)
green, _('Update found'), version_url, calibre_version, plt)
else:
plt = ngettext('plugin update available', 'plugin updates available', number_of_plugin_updates)
msg = ('<a href="update:%s">%d %s</a>')%(version_url, number_of_plugin_updates, plt)
Expand Down

0 comments on commit 7f53e64

Please sign in to comment.