Added new message indicator

This commit is contained in:
jeffser 2024-09-01 16:56:18 -06:00
parent 51a90e0b79
commit 1b94864422
5 changed files with 13 additions and 5 deletions

View File

@ -30,6 +30,7 @@
<file alias="icons/scalable/status/image-missing-symbolic.svg">icons/image-missing-symbolic.svg</file>
<file alias="icons/scalable/status/update-symbolic.svg">icons/update-symbolic.svg</file>
<file alias="icons/scalable/status/down-symbolic.svg">icons/down-symbolic.svg</file>
<file alias="icons/scalable/status/chat-bubble-text-symbolic.svg">icons/chat-bubble-text-symbolic.svg</file>
<file preprocess="xml-stripblanks">window.ui</file>
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
</gresource>

View File

@ -215,12 +215,16 @@ class chat_tab(Gtk.ListBoxRow):
wrap_mode=2,
xalign=0
)
self.indicator = Gtk.Image.new_from_icon_name("chat-bubble-text-symbolic")
self.indicator.set_visible(False)
self.indicator.set_css_classes(['accent'])
container = Gtk.Box(
orientation=0,
spacing=10
spacing=5
)
container.append(self.spinner)
container.append(self.label)
container.append(self.spinner)
container.append(self.indicator)
super().__init__(
css_classes = ["chat_row"],
height_request = 45,
@ -429,3 +433,5 @@ class chat_list(Gtk.ListBox):
if len(row.chat_window.messages) > 0:
last_model_used = row.chat_window.messages[list(row.chat_window.messages)[-1]].model
window.model_manager.change_model(last_model_used)
if row.indicator.get_visible():
row.indicator.set_visible(False)

View File

@ -431,8 +431,6 @@ class message(Gtk.Overlay):
if chat.busy:
vadjustment = chat.get_vadjustment()
if self.spinner:
if not window.chat_list_box.get_sensitive():
window.chat_list_box.set_sensitive(True)
self.container.remove(self.spinner)
self.spinner = None
self.content_children[-1].set_visible(True)
@ -442,6 +440,8 @@ class message(Gtk.Overlay):
self.content_children[-1].insert_at_end(data['message']['content'], False)
if 'done' in data and data['done']:
window.chat_list_box.get_tab_by_name(chat.get_name()).spinner.set_visible(False)
if window.chat_list_box.get_current_chat().get_name() != chat.get_name():
window.chat_list_box.get_tab_by_name(chat.get_name()).indicator.set_visible(True)
if chat.welcome_screen:
chat.container.remove(chat.welcome_screen)
chat.welcome_screen = None

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><g fill="#222222"><path d="m 3 0 c -1.644531 0 -3 1.355469 -3 3 v 6 c 0 1.644531 1.355469 3 3 3 h 1 v 4 l 4 -4 h 5 c 1.644531 0 3 -1.355469 3 -3 v -6 c 0 -1.644531 -1.355469 -3 -3 -3 z m 0 2 h 10 c 0.570312 0 1 0.429688 1 1 v 6 c 0 0.570312 -0.429688 1 -1 1 h -10 c -0.570312 0 -1 -0.429688 -1 -1 v -6 c 0 -0.570312 0.429688 -1 1 -1 z m 0 0"/><path d="m 3 3 h 9 v 2 h -9 z m 0 0"/><path d="m 3 6 h 6 v 2 h -6 z m 0 0"/></g></svg>

After

Width:  |  Height:  |  Size: 556 B

View File

@ -523,7 +523,6 @@ Generate a title following these rules:
if len(data['messages']) == 1 and chat.get_name().startswith(_("New Chat")):
threading.Thread(target=self.generate_chat_title, args=(data['messages'][0].copy(), chat.get_name())).start()
self.chat_list_box.set_sensitive(False)
if chat.welcome_screen:
chat.welcome_screen.set_visible(False)
if chat.regenerate_button: