Workaround for Win10's broken scaling of taskbar icons
Also set the app user model id explicitly for all three main calibre GUI programs.
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 46 KiB |
@ -19,12 +19,15 @@ for name, src in sources.iteritems():
|
||||
os.mkdir('ico_temp')
|
||||
try:
|
||||
names = []
|
||||
for sz in (16, 32, 48, 256):
|
||||
for sz in (16, 24, 32, 48, 64, 256):
|
||||
iname = os.path.join('ico_temp', '{0}x{0}.png'.format(sz))
|
||||
subprocess.check_call(['rsvg-convert', src, '-w', str(sz), '-h', str(sz), '-o', iname])
|
||||
subprocess.check_call(['optipng', '-o7', '-strip', 'all', iname])
|
||||
if sz >= 128:
|
||||
names.append('-r') # store as raw PNG to reduce size
|
||||
else:
|
||||
names.extend(['-t', '0']) # see https://bugzilla.gnome.org/show_bug.cgi?id=755200
|
||||
names.append(iname)
|
||||
names[-1:-1] = ['-r']
|
||||
subprocess.check_call(['icotool', '-c', '--output=' + name+'.ico'] + names)
|
||||
finally:
|
||||
shutil.rmtree('ico_temp')
|
||||
|
BIN
icons/viewer.ico
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 70 KiB |
@ -100,7 +100,7 @@ def init_qt(args):
|
||||
override = 'calibre-gui' if islinux else None
|
||||
app = Application(args, override_program_name=override)
|
||||
app.file_event_hook = EventAccumulator()
|
||||
app.setWindowIcon(QIcon(I('lt.png', allow_user_override=False)))
|
||||
app.setWindowIcon(QIcon(I('library.png', allow_user_override=False)))
|
||||
return app, opts, args
|
||||
|
||||
|
||||
@ -462,6 +462,16 @@ def main(args=sys.argv):
|
||||
gui_debug = args[1]
|
||||
args = ['calibre']
|
||||
|
||||
if iswindows:
|
||||
# Ensure that all ebook editor instances are grouped together in the task
|
||||
# bar. This prevents them from being grouped with viewer process when
|
||||
# launched from within calibre, as both use calibre-parallel.exe
|
||||
import ctypes
|
||||
try:
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('com.calibre-ebook.main-gui')
|
||||
except Exception:
|
||||
pass # Only available on windows 7 and newer
|
||||
|
||||
try:
|
||||
app, opts, args = init_qt(args)
|
||||
except AbortInit:
|
||||
|
@ -48,7 +48,7 @@ def _run(args, notify=None):
|
||||
import ctypes
|
||||
try:
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('com.calibre-ebook.edit-book')
|
||||
except:
|
||||
except Exception:
|
||||
pass # Only available on windows 7 and newer
|
||||
|
||||
# The following two lines are needed to prevent circular imports causing
|
||||
|
@ -134,6 +134,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
def __init__(self, opts, parent=None, gui_debug=None):
|
||||
global _gui
|
||||
MainWindow.__init__(self, opts, parent=parent, disable_automatic_gc=True)
|
||||
self.setWindowIcon(QIcon(I('library.png', allow_user_override=False)))
|
||||
self.jobs_pointer = Pointer(self)
|
||||
self.proceed_requested.connect(self.do_proceed,
|
||||
type=Qt.QueuedConnection)
|
||||
|
@ -16,7 +16,7 @@ from calibre.gui2 import (
|
||||
Application, ORG_NAME, APP_UID, choose_files, info_dialog, error_dialog,
|
||||
open_url, setup_gui_option_parser)
|
||||
from calibre.ebooks.oeb.iterator.book import EbookIterator
|
||||
from calibre.constants import islinux, filesystem_encoding, DEBUG
|
||||
from calibre.constants import islinux, filesystem_encoding, DEBUG, iswindows
|
||||
from calibre.utils.config import Config, StringConfig, JSONConfig
|
||||
from calibre.customize.ui import available_input_formats
|
||||
from calibre import as_unicode, force_unicode, isbytestring, prints
|
||||
@ -1207,6 +1207,15 @@ def main(args=sys.argv):
|
||||
# Ensure viewer can continue to function if GUI is closed
|
||||
os.environ.pop('CALIBRE_WORKER_TEMP_DIR', None)
|
||||
reset_base_dir()
|
||||
if iswindows:
|
||||
# Ensure that all ebook editor instances are grouped together in the task
|
||||
# bar. This prevents them from being grouped with viewer process when
|
||||
# launched from within calibre, as both use calibre-parallel.exe
|
||||
import ctypes
|
||||
try:
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('com.calibre-ebook.viewer')
|
||||
except Exception:
|
||||
pass # Only available on windows 7 and newer
|
||||
|
||||
parser = option_parser()
|
||||
opts, args = parser.parse_args(args)
|
||||
|