Fixed codeblocks spacing

This commit is contained in:
jeffser 2024-08-10 21:10:23 -06:00
parent 4bc0832865
commit 8b7f41afa7
2 changed files with 5 additions and 4 deletions

View File

@ -21,6 +21,6 @@
padding: 12px;
border-radius: 10px;
}
.user_message:focus, .response_message:focus, .editing_message_textview:focus {
.user_message:focus, .response_message:focus, .editing_message_textview:focus, .code_block:focus {
box-shadow: 0 0 1px 2px mix(@accent_color, @window_bg_color, 0.5);
}

View File

@ -726,7 +726,8 @@ Generate a title following these rules:
message_box = Gtk.Box(
orientation=1,
halign='fill',
css_classes=[None if bot else "card"]
css_classes=[None if bot else "card"],
spacing=5
)
message_text.set_valign(Gtk.Align.CENTER)
@ -1000,11 +1001,11 @@ Generate a title following these rules:
buffer.set_style_scheme(source_style)
source_view = GtkSource.View(
auto_indent=True, indent_width=4, buffer=buffer, show_line_numbers=True,
top_margin=6, bottom_margin=6, left_margin=12, right_margin=12, css_classes=["response_message"]
top_margin=6, bottom_margin=6, left_margin=12, right_margin=12, css_classes=["code_block"]
)
source_view.update_property([4], [_("{}Code Block").format('{} '.format(language.get_name()) if language else "")])
source_view.set_editable(False)
code_block_box = Gtk.Box(css_classes=["card", "response_message"], orientation=1, overflow=1)
code_block_box = Gtk.Box(css_classes=["card", "code_block"], orientation=1, overflow=1)
title_box = Gtk.Box(margin_start=12, margin_top=3, margin_bottom=3, margin_end=3)
title_box.append(Gtk.Label(label=language.get_name() if language else _("Code Block"), hexpand=True, xalign=0))
copy_button = Gtk.Button(icon_name="edit-copy-symbolic", css_classes=["flat", "circular"], tooltip_text=_("Copy Message"))