diff --git a/imgsrc/generate.py b/imgsrc/generate.py index f76894b1aa..8ed7d15e42 100755 --- a/imgsrc/generate.py +++ b/imgsrc/generate.py @@ -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 diff --git a/imgsrc/modified-for-dark-theme.svg b/imgsrc/modified-for-dark-theme.svg new file mode 100644 index 0000000000..6dcb9e73cd --- /dev/null +++ b/imgsrc/modified-for-dark-theme.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Kovid Goyal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/imgsrc/modified.svg b/imgsrc/modified-for-light-theme.svg similarity index 100% rename from imgsrc/modified.svg rename to imgsrc/modified-for-light-theme.svg diff --git a/resources/icon-themes/calibre-default-dark/base/modified.png b/resources/icon-themes/calibre-default-dark/base/modified.png new file mode 100644 index 0000000000..29f1678834 Binary files /dev/null and b/resources/icon-themes/calibre-default-dark/base/modified.png differ diff --git a/resources/images/modified.png b/resources/icon-themes/calibre-default-light/base/modified.png similarity index 100% rename from resources/images/modified.png rename to resources/icon-themes/calibre-default-light/base/modified.png diff --git a/src/calibre/gui2/tweak_book/ui.py b/src/calibre/gui2/tweak_book/ui.py index 006775d861..dd228f92ce 100644 --- a/src/calibre/gui2/tweak_book/ui.py +++ b/src/calibre/gui2/tweak_book/ui.py @@ -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,13 +85,7 @@ 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.modified_icon = QIcon.ic('modified.png') self.editor_tabs.currentChanged.connect(self.current_editor_changed) self.editor_tabs.tabCloseRequested.connect(self._close_requested) self.search_panel = SearchPanel(self)