| {title}\xa0 |
@@ -152,6 +155,7 @@ class ChatWidget(QWidget):
self.response_color = pal.color(QPalette.ColorRole.Window).name()
self.base_color = pal.color(QPalette.ColorRole.Base).name()
self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
+ self.line_spacing = self.browser.fontMetrics().lineSpacing()
def wrap_content_in_padding_table(self, html: str, background_color: str = '') -> str:
style = f'style="background-color: {background_color}"' if background_color else ''
@@ -162,7 +166,7 @@ class ChatWidget(QWidget):
self.current_message = ''
html = ''
if header.title or header.buttons:
- html += f'{header.as_html}
'
+ html += f'{header.as_html(self.line_spacing)}
'
html += f'{body_html}
'
bg = self.response_color if is_response else self.base_color
self.blocks.append(self.wrap_content_in_padding_table(html, bg))
diff --git a/src/calibre/gui2/viewer/llm.py b/src/calibre/gui2/viewer/llm.py
index ce438dfcc2..d282c8bd16 100644
--- a/src/calibre/gui2/viewer/llm.py
+++ b/src/calibre/gui2/viewer/llm.py
@@ -369,9 +369,9 @@ class LLMPanel(QWidget):
if message.from_assistant:
is_response = True
header = Header(assistant, (
- Button(_('💾'), f'http://{self.save_note_hostname}/{i}', _(
+ Button('save.png', f'http://{self.save_note_hostname}/{i}', _(
'Save this specific response as the note')),
- Button('📋', f'http://{self.copy_hostname}/{i}', _(
+ Button('edit-copy.png', f'http://{self.copy_hostname}/{i}', _(
'Copy this specific response to the clipboard')),
))
self.result_display.add_block(content_for_display, header, is_response)