mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use themes for modified.png
This commit is contained in:
parent
b94ddad134
commit
7fa564da07
@ -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
|
||||
|
144
imgsrc/modified-for-dark-theme.svg
Normal file
144
imgsrc/modified-for-dark-theme.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 111 KiB |
BIN
resources/icon-themes/calibre-default-dark/base/modified.png
Normal file
BIN
resources/icon-themes/calibre-default-dark/base/modified.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user