Work on Conversations UI

This commit is contained in:
Mark Qvist 2021-05-04 20:53:03 +02:00
parent 0c1108f00e
commit 1969b49819
6 changed files with 202 additions and 59 deletions

View file

@ -2,9 +2,32 @@ import RNS
import importlib
import time
from nomadnet import NomadNetworkApp
from nomadnet.ui import *
import nomadnet
from nomadnet.ui.textui import *
from nomadnet import NomadNetworkApp
COLORMODE_MONO = 1
COLORMODE_16 = 16
COLORMODE_88 = 88
COLORMODE_256 = 256
COLORMODE_TRUE = 2**24
THEME_DARK = 0x01
THEME_LIGHT = 0x02
THEMES = {
THEME_DARK: [
# Style name # 16-color style # Monochrome style # 88, 256 and true-color style
('heading', 'light gray,underline', 'default', 'underline', 'g93,underline', 'default'),
('menubar', 'black', 'light gray', 'standout', '#111', '#bbb'),
('shortcutbar', 'black', 'light gray', 'standout', '#111', '#bbb'),
('body_text', 'white', 'default', 'default', '#0a0', 'default'),
('buttons', 'light green,bold', 'default', 'default', '#00a533', 'default'),
('msg_editor', 'black', 'light cyan', 'standout', '#111', '#0bb'),
("msg_header_ok", 'black', 'light green', 'standout', 'black', '#6b2',),
("msg_header_caution", 'black', 'yellow', 'standout', 'black', '#fd3',),
("list_focus", "black", "light cyan", "standout", "#111", "#0bb"),
]
}
class TextUI:
@ -25,16 +48,15 @@ class TextUI:
colormode = self.app.config["textui"]["colormode"]
theme = self.app.config["textui"]["theme"]
palette = nomadnet.ui.THEMES[theme]
palette = THEMES[theme]
self.screen = urwid.raw_display.Screen()
self.screen.register_palette(palette)
#self.main_display = nomadnet.ui.textui.Extras.DemoDisplay(self, self.app)
self.main_display = nomadnet.ui.textui.Main.MainDisplay(self, self.app)
self.main_display = Main.MainDisplay(self, self.app)
if intro_timeout > 0:
self.intro_display = nomadnet.ui.textui.Extras.IntroDisplay(self.app)
self.intro_display = Extras.IntroDisplay(self.app)
initial_widget = self.intro_display.widget
else:
initial_widget = self.main_display.widget