Add logo screen when conversation is not selected
This commit is contained in:
parent
c76f53daab
commit
16e4bd41c3
|
@ -73,7 +73,6 @@ class ConversationModel:
|
||||||
self.conversations = []
|
self.conversations = []
|
||||||
for key in self.data:
|
for key in self.data:
|
||||||
self.conversations.append(key)
|
self.conversations.append(key)
|
||||||
self.current_conversation=self.conversations[0]
|
|
||||||
|
|
||||||
def get_conversations(self):
|
def get_conversations(self):
|
||||||
return self.conversations
|
return self.conversations
|
||||||
|
@ -120,6 +119,8 @@ class ConversationView(urwid.WidgetWrap):
|
||||||
|
|
||||||
palette = [
|
palette = [
|
||||||
("body", "black", "light gray", "standout"),
|
("body", "black", "light gray", "standout"),
|
||||||
|
("logo_red", "dark red", "light gray", "standout"),
|
||||||
|
("logo_black", "black", "light gray", "standout"),
|
||||||
("header", "white", "dark red", "bold"),
|
("header", "white", "dark red", "bold"),
|
||||||
("footer", "black", "dark cyan"),
|
("footer", "black", "dark cyan"),
|
||||||
("sidebar", "dark gray", "black"),
|
("sidebar", "dark gray", "black"),
|
||||||
|
@ -132,8 +133,30 @@ class ConversationView(urwid.WidgetWrap):
|
||||||
self.started = True
|
self.started = True
|
||||||
self.offset = 0
|
self.offset = 0
|
||||||
self.last_offset = None
|
self.last_offset = None
|
||||||
|
self.current_conversation=None
|
||||||
super().__init__(self.main_window())
|
super().__init__(self.main_window())
|
||||||
|
|
||||||
|
def logo(self):
|
||||||
|
return [
|
||||||
|
urwid.Divider(" ", top=10),
|
||||||
|
urwid.Padding(
|
||||||
|
urwid.Pile([
|
||||||
|
urwid.Text([("logo_red","┌─┐ ┌─┐┌──────┐┌─┐┌─────┐"),("logo_black","┌───────┐┌──────┐")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_red","│ │ │ ││ ┌──┐ │└─┘└───┐ │"),("logo_black","│ ┌───┐ ││ ┌────┘")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_red","│ └┐┌┘ ││ │ │ │┌─┐┌───┘ │"),("logo_black","│ │┌─┐│ ││ └┐┌──┐")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_red","└┐ └┘ ┌┘│ │ │ ││ ││ ┌───┘"),("logo_black","│ ││ ││ │└──┘└┐ │")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_red"," └┐ ┌┘ │ └──┘ ││ ││ │"),("logo_black"," ┌─┐│ ││ ││ │┌────┘ │")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_red"," └──┘ └──────┘└─┘└─┘"),("logo_black"," └─┘└─┘└─┘└─┘└──────┘")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_black","┌─────┐┌───────┐┌─────┐"),("logo_red"," ┌─────┐┌─┐ ┌─┐┌───┐")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_black","│ ┌───┘│ ┌┐ ┌┐ ││ ┌───┘"),("logo_red"," └─┐ ┌─┘│ │ │ │└┐ ┌┘")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_black","│ └───┐│ ││ ││ ││ └───┐┌─┐"),("logo_red","│ │ │ │ │ │ │ │ ")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_black","└───┐ ││ ││ ││ │└───┐ │└─┘"),("logo_red","│ │ │ │ │ │ │ │ ")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_black","┌───┘ ││ ││ ││ │┌───┘ │"),("logo_red"," │ │ │ └─┘ │┌┘ └┐")],align=urwid.CENTER),
|
||||||
|
urwid.Text([("logo_black","└─────┘└─┘└─┘└─┘└─────┘"),("logo_red"," └─┘ └─────┘└───┘")],align=urwid.CENTER),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
def update_conversation(self, force_update=False):
|
def update_conversation(self, force_update=False):
|
||||||
return self.model.get_messages()
|
return self.model.get_messages()
|
||||||
|
|
||||||
|
@ -164,7 +187,10 @@ class ConversationView(urwid.WidgetWrap):
|
||||||
conversation = self.model.get_conversations()[0]
|
conversation = self.model.get_conversations()[0]
|
||||||
|
|
||||||
def conversation(self):
|
def conversation(self):
|
||||||
return self.update_conversation()
|
if self.current_conversation == None:
|
||||||
|
return self.logo()
|
||||||
|
else:
|
||||||
|
return self.model.get_messages()
|
||||||
|
|
||||||
def button(self, t, fn):
|
def button(self, t, fn):
|
||||||
w = urwid.Button(t, fn)
|
w = urwid.Button(t, fn)
|
||||||
|
|
Loading…
Reference in New Issue