mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1529501 [Some theme icons aren't substituted](https://bugs.launchpad.net/calibre/+bug/1529501)
This commit is contained in:
parent
e19221a28d
commit
752a0aec90
@ -127,15 +127,15 @@ class EditorWidget(QWebView): # {{{
|
|||||||
ac.triggered.connect(self.remove_format_cleanup,
|
ac.triggered.connect(self.remove_format_cleanup,
|
||||||
type=Qt.QueuedConnection)
|
type=Qt.QueuedConnection)
|
||||||
|
|
||||||
self.action_color = QAction(QIcon(I('format-text-color')), _('Foreground color'),
|
self.action_color = QAction(QIcon(I('format-text-color.png')), _('Foreground color'),
|
||||||
self)
|
self)
|
||||||
self.action_color.triggered.connect(self.foreground_color)
|
self.action_color.triggered.connect(self.foreground_color)
|
||||||
|
|
||||||
self.action_background = QAction(QIcon(I('format-fill-color')),
|
self.action_background = QAction(QIcon(I('format-fill-color.png')),
|
||||||
_('Background color'), self)
|
_('Background color'), self)
|
||||||
self.action_background.triggered.connect(self.background_color)
|
self.action_background.triggered.connect(self.background_color)
|
||||||
|
|
||||||
self.action_block_style = QAction(QIcon(I('format-text-heading')),
|
self.action_block_style = QAction(QIcon(I('format-text-heading.png')),
|
||||||
_('Style text block'), self)
|
_('Style text block'), self)
|
||||||
self.action_block_style.setToolTip(
|
self.action_block_style.setToolTip(
|
||||||
_('Style the selected text block'))
|
_('Style the selected text block'))
|
||||||
@ -163,7 +163,7 @@ class EditorWidget(QWebView): # {{{
|
|||||||
self.action_insert_link.triggered.connect(self.insert_link)
|
self.action_insert_link.triggered.connect(self.insert_link)
|
||||||
self.pageAction(QWebPage.ToggleBold).changed.connect(self.update_link_action)
|
self.pageAction(QWebPage.ToggleBold).changed.connect(self.update_link_action)
|
||||||
self.action_insert_link.setEnabled(False)
|
self.action_insert_link.setEnabled(False)
|
||||||
self.action_clear = QAction(QIcon(I('edit-clear')), _('Clear'), self)
|
self.action_clear = QAction(QIcon(I('edit-clear.png')), _('Clear'), self)
|
||||||
self.action_clear.triggered.connect(self.clear_text)
|
self.action_clear.triggered.connect(self.clear_text)
|
||||||
|
|
||||||
self.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
|
self.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
|
||||||
|
@ -51,39 +51,40 @@ def register_text_editor_actions(_reg, palette):
|
|||||||
editor_toolbar_actions[s][args[3]] = ac
|
editor_toolbar_actions[s][args[3]] = ac
|
||||||
return ac
|
return ac
|
||||||
|
|
||||||
ac = reg('format-text-bold', _('&Bold'), ('format_text', 'bold'), 'format-text-bold', 'Ctrl+B', _('Make the selected text bold'))
|
ac = reg('format-text-bold.png', _('&Bold'), ('format_text', 'bold'), 'format-text-bold', 'Ctrl+B', _('Make the selected text bold'))
|
||||||
ac.setToolTip(_('<h3>Bold</h3>Make the selected text bold'))
|
ac.setToolTip(_('<h3>Bold</h3>Make the selected text bold'))
|
||||||
ac = reg('format-text-italic', _('&Italic'), ('format_text', 'italic'), 'format-text-italic', 'Ctrl+I', _('Make the selected text italic'))
|
ac = reg('format-text-italic.png', _('&Italic'), ('format_text', 'italic'), 'format-text-italic', 'Ctrl+I', _('Make the selected text italic'))
|
||||||
ac.setToolTip(_('<h3>Italic</h3>Make the selected text italic'))
|
ac.setToolTip(_('<h3>Italic</h3>Make the selected text italic'))
|
||||||
ac = reg('format-text-underline', _('&Underline'), ('format_text', 'underline'), 'format-text-underline', (), _('Underline the selected text'))
|
ac = reg('format-text-underline.png', _('&Underline'), ('format_text', 'underline'), 'format-text-underline', (), _('Underline the selected text'))
|
||||||
ac.setToolTip(_('<h3>Underline</h3>Underline the selected text'))
|
ac.setToolTip(_('<h3>Underline</h3>Underline the selected text'))
|
||||||
ac = reg('format-text-strikethrough', _('&Strikethrough'), ('format_text', 'strikethrough'),
|
ac = reg('format-text-strikethrough.png', _('&Strikethrough'), ('format_text', 'strikethrough'),
|
||||||
'format-text-strikethrough', (), _('Draw a line through the selected text'))
|
'format-text-strikethrough', (), _('Draw a line through the selected text'))
|
||||||
ac.setToolTip(_('<h3>Strikethrough</h3>Draw a line through the selected text'))
|
ac.setToolTip(_('<h3>Strikethrough</h3>Draw a line through the selected text'))
|
||||||
ac = reg('format-text-superscript', _('&Superscript'), ('format_text', 'superscript'),
|
ac = reg('format-text-superscript.png', _('&Superscript'), ('format_text', 'superscript'),
|
||||||
'format-text-superscript', (), _('Make the selected text a superscript'))
|
'format-text-superscript', (), _('Make the selected text a superscript'))
|
||||||
ac.setToolTip(_('<h3>Superscript</h3>Set the selected text slightly smaller and above the normal line'))
|
ac.setToolTip(_('<h3>Superscript</h3>Set the selected text slightly smaller and above the normal line'))
|
||||||
ac = reg('format-text-subscript', _('&Subscript'), ('format_text', 'subscript'),
|
ac = reg('format-text-subscript.png', _('&Subscript'), ('format_text', 'subscript'),
|
||||||
'format-text-subscript', (), _('Make the selected text a subscript'))
|
'format-text-subscript', (), _('Make the selected text a subscript'))
|
||||||
ac.setToolTip(_('<h3>Subscript</h3>Set the selected text slightly smaller and below the normal line'))
|
ac.setToolTip(_('<h3>Subscript</h3>Set the selected text slightly smaller and below the normal line'))
|
||||||
ac = reg('format-text-color', _('&Color'), ('format_text', 'color'), 'format-text-color', (), _('Change text color'))
|
ac = reg('format-text-color.png', _('&Color'), ('format_text', 'color'), 'format-text-color', (), _('Change text color'))
|
||||||
ac.setToolTip(_('<h3>Color</h3>Change the color of the selected text'))
|
ac.setToolTip(_('<h3>Color</h3>Change the color of the selected text'))
|
||||||
ac = reg('format-fill-color', _('&Background Color'), ('format_text', 'background-color'),
|
ac = reg('format-fill-color.png', _('&Background Color'), ('format_text', 'background-color'),
|
||||||
'format-text-background-color', (), _('Change background color of text'))
|
'format-text-background-color', (), _('Change background color of text'))
|
||||||
ac.setToolTip(_('<h3>Background Color</h3>Change the background color of the selected text'))
|
ac.setToolTip(_('<h3>Background Color</h3>Change the background color of the selected text'))
|
||||||
ac = reg('format-justify-left', _('Align &left'), ('format_text', 'justify_left'), 'format-text-justify-left', (), _('Align left'))
|
ac = reg('format-justify-left.png', _('Align &left'), ('format_text', 'justify_left'), 'format-text-justify-left', (), _('Align left'))
|
||||||
ac.setToolTip(_('<h3>Align left</h3>Align the paragraph to the left'))
|
ac.setToolTip(_('<h3>Align left</h3>Align the paragraph to the left'))
|
||||||
ac = reg('format-justify-center', _('&Center'), ('format_text', 'justify_center'), 'format-text-justify-center', (), _('Center'))
|
ac = reg('format-justify-center.png', _('&Center'), ('format_text', 'justify_center'), 'format-text-justify-center', (), _('Center'))
|
||||||
ac.setToolTip(_('<h3>Center</h3>Center the paragraph'))
|
ac.setToolTip(_('<h3>Center</h3>Center the paragraph'))
|
||||||
ac = reg('format-justify-right', _('Align &right'), ('format_text', 'justify_right'), 'format-text-justify-right', (), _('Align right'))
|
ac = reg('format-justify-right.png', _('Align &right'), ('format_text', 'justify_right'), 'format-text-justify-right', (), _('Align right'))
|
||||||
ac.setToolTip(_('<h3>Align right</h3>Align the paragraph to the right'))
|
ac.setToolTip(_('<h3>Align right</h3>Align the paragraph to the right'))
|
||||||
ac = reg('format-justify-fill', _('&Justify'), ('format_text', 'justify_justify'), 'format-text-justify-fill', (), _('Justify'))
|
ac = reg('format-justify-fill.png', _('&Justify'), ('format_text', 'justify_justify'), 'format-text-justify-fill', (), _('Justify'))
|
||||||
ac.setToolTip(_('<h3>Justify</h3>Align the paragraph to both the left and right margins'))
|
ac.setToolTip(_('<h3>Justify</h3>Align the paragraph to both the left and right margins'))
|
||||||
|
|
||||||
ac = reg('view-image', _('&Insert image'), ('insert_resource', 'image'), 'insert-image', (), _('Insert an image into the text'), syntaxes=('html', 'css'))
|
ac = reg('view-image.png', _('&Insert image'), ('insert_resource', 'image'), 'insert-image', (),
|
||||||
|
_('Insert an image into the text'), syntaxes=('html', 'css'))
|
||||||
ac.setToolTip(_('<h3>Insert image</h3>Insert an image into the text'))
|
ac.setToolTip(_('<h3>Insert image</h3>Insert an image into the text'))
|
||||||
|
|
||||||
ac = reg('insert-link', _('Insert &hyperlink'), ('insert_hyperlink',), 'insert-hyperlink', (), _('Insert hyperlink'), syntaxes=('html',))
|
ac = reg('insert-link.png', _('Insert &hyperlink'), ('insert_hyperlink',), 'insert-hyperlink', (), _('Insert hyperlink'), syntaxes=('html',))
|
||||||
ac.setToolTip(_('<h3>Insert hyperlink</h3>Insert a hyperlink into the text'))
|
ac.setToolTip(_('<h3>Insert hyperlink</h3>Insert a hyperlink into the text'))
|
||||||
|
|
||||||
ac = reg(create_icon('/*', divider=1, fill=None), _('Smart &comment'), ('smart_comment',), 'editor-smart-comment', ('Ctrl+`',), _(
|
ac = reg(create_icon('/*', divider=1, fill=None), _('Smart &comment'), ('smart_comment',), 'editor-smart-comment', ('Ctrl+`',), _(
|
||||||
@ -104,7 +105,7 @@ def register_text_editor_actions(_reg, palette):
|
|||||||
ac = reg(None, text, ('change_case', transform), 'transform-case-' + transform, (), desc, syntaxes=())
|
ac = reg(None, text, ('change_case', transform), 'transform-case-' + transform, (), desc, syntaxes=())
|
||||||
ac.setToolTip(desc)
|
ac.setToolTip(desc)
|
||||||
|
|
||||||
ac = reg('code', _('Insert &tag'), ('insert_tag',), 'insert-tag', ('Ctrl+<'), _('Insert tag'), syntaxes=('html', 'xml'))
|
ac = reg('code.png', _('Insert &tag'), ('insert_tag',), 'insert-tag', ('Ctrl+<'), _('Insert tag'), syntaxes=('html', 'xml'))
|
||||||
ac.setToolTip(_('<h3>Insert tag</h3>Insert a tag, if some text is selected the tag will be inserted around the selected text'))
|
ac.setToolTip(_('<h3>Insert tag</h3>Insert a tag, if some text is selected the tag will be inserted around the selected text'))
|
||||||
|
|
||||||
editor_toolbar_actions['html']['fix-html-current'] = actions['fix-html-current']
|
editor_toolbar_actions['html']['fix-html-current'] = actions['fix-html-current']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user