Use themes for modified.png

This commit is contained in:
Kovid Goyal 2022-01-09 10:19:14 +05:30
parent b94ddad134
commit 7fa564da07
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
6 changed files with 150 additions and 10 deletions

View File

@ -48,8 +48,10 @@ def iterfiles(only=()):
obase = output_base
if name.endswith('-for-dark-theme'):
obase = dark_output_base
output_names = [x.replace('-for-dark-theme', '') for x in output_names]
elif name.endswith('-for-light-theme'):
obase = light_output_base
output_names = [x.replace('-for-light-theme', '') for x in output_names]
output_files = [j(obase, n) + '.png' for n in output_names]
if output_files:
yield src, output_files

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 111 KiB

View File

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -9,9 +9,9 @@ from functools import partial
from gettext import pgettext
from itertools import product
from qt.core import (
QAction, QApplication, QColor, QDockWidget, QEvent, QHBoxLayout, QIcon, QImage,
QLabel, QMenu, QPalette, QPixmap, QSize, QStackedWidget, Qt, QTabWidget, QTimer,
QUrl, QVBoxLayout, QWidget, pyqtSignal, QMenuBar
QAction, QApplication, QColor, QDockWidget, QEvent, QHBoxLayout, QIcon, QLabel,
QMenu, QMenuBar, QPalette, QSize, QStackedWidget, Qt, QTabWidget, QTimer, QUrl,
QVBoxLayout, QWidget, pyqtSignal
)
from calibre import prepare_string_for_xml, prints
@ -85,12 +85,6 @@ class Central(QStackedWidget): # {{{
t.setDocumentMode(True)
t.setTabsClosable(True)
t.setMovable(True)
pal = self.palette()
if pal.color(QPalette.ColorRole.WindowText).lightness() > 128:
i = QImage(I('modified.png'))
i.invertPixels()
self.modified_icon = QIcon(QPixmap.fromImage(i))
else:
self.modified_icon = QIcon.ic('modified.png')
self.editor_tabs.currentChanged.connect(self.current_editor_changed)
self.editor_tabs.tabCloseRequested.connect(self._close_requested)