Added new message indicator
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user