Added new message indicator
This commit is contained in:
parent
51a90e0b79
commit
1b94864422
@ -30,6 +30,7 @@
|
|||||||
<file alias="icons/scalable/status/image-missing-symbolic.svg">icons/image-missing-symbolic.svg</file>
|
<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/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/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">window.ui</file>
|
||||||
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
|
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
|
||||||
</gresource>
|
</gresource>
|
||||||
|
@ -215,12 +215,16 @@ class chat_tab(Gtk.ListBoxRow):
|
|||||||
wrap_mode=2,
|
wrap_mode=2,
|
||||||
xalign=0
|
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(
|
container = Gtk.Box(
|
||||||
orientation=0,
|
orientation=0,
|
||||||
spacing=10
|
spacing=5
|
||||||
)
|
)
|
||||||
container.append(self.spinner)
|
|
||||||
container.append(self.label)
|
container.append(self.label)
|
||||||
|
container.append(self.spinner)
|
||||||
|
container.append(self.indicator)
|
||||||
super().__init__(
|
super().__init__(
|
||||||
css_classes = ["chat_row"],
|
css_classes = ["chat_row"],
|
||||||
height_request = 45,
|
height_request = 45,
|
||||||
@ -429,3 +433,5 @@ class chat_list(Gtk.ListBox):
|
|||||||
if len(row.chat_window.messages) > 0:
|
if len(row.chat_window.messages) > 0:
|
||||||
last_model_used = row.chat_window.messages[list(row.chat_window.messages)[-1]].model
|
last_model_used = row.chat_window.messages[list(row.chat_window.messages)[-1]].model
|
||||||
window.model_manager.change_model(last_model_used)
|
window.model_manager.change_model(last_model_used)
|
||||||
|
if row.indicator.get_visible():
|
||||||
|
row.indicator.set_visible(False)
|
||||||
|
@ -431,8 +431,6 @@ class message(Gtk.Overlay):
|
|||||||
if chat.busy:
|
if chat.busy:
|
||||||
vadjustment = chat.get_vadjustment()
|
vadjustment = chat.get_vadjustment()
|
||||||
if self.spinner:
|
if self.spinner:
|
||||||
if not window.chat_list_box.get_sensitive():
|
|
||||||
window.chat_list_box.set_sensitive(True)
|
|
||||||
self.container.remove(self.spinner)
|
self.container.remove(self.spinner)
|
||||||
self.spinner = None
|
self.spinner = None
|
||||||
self.content_children[-1].set_visible(True)
|
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)
|
self.content_children[-1].insert_at_end(data['message']['content'], False)
|
||||||
if 'done' in data and data['done']:
|
if 'done' in data and data['done']:
|
||||||
window.chat_list_box.get_tab_by_name(chat.get_name()).spinner.set_visible(False)
|
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:
|
if chat.welcome_screen:
|
||||||
chat.container.remove(chat.welcome_screen)
|
chat.container.remove(chat.welcome_screen)
|
||||||
chat.welcome_screen = None
|
chat.welcome_screen = None
|
||||||
|
2
src/icons/chat-bubble-text-symbolic.svg
Normal file
2
src/icons/chat-bubble-text-symbolic.svg
Normal 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 |
@ -523,7 +523,6 @@ Generate a title following these rules:
|
|||||||
if len(data['messages']) == 1 and chat.get_name().startswith(_("New Chat")):
|
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()
|
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:
|
if chat.welcome_screen:
|
||||||
chat.welcome_screen.set_visible(False)
|
chat.welcome_screen.set_visible(False)
|
||||||
if chat.regenerate_button:
|
if chat.regenerate_button:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user