mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-05-07 08:35:11 -04:00
Initial work on micron markup language. Work on guide section.
This commit is contained in:
parent
84e616a3ec
commit
72f623293e
6 changed files with 478 additions and 34 deletions
|
@ -15,31 +15,34 @@ 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', '#ddd', 'default'),
|
||||
('error_text', 'dark red', 'default', 'default', 'dark red', 'default'),
|
||||
('warning_text', 'yellow', 'default', 'default', '#ba4', 'default'),
|
||||
('inactive_text', 'dark gray', 'default', 'default', 'dark gray', 'default'),
|
||||
('buttons', 'light green,bold', 'default', 'default', '#00a533', 'default'),
|
||||
('msg_editor', 'black', 'light cyan', 'standout', '#111', '#0bb'),
|
||||
("msg_header_ok", 'black', 'light green', 'standout', '#111', '#6b2'),
|
||||
("msg_header_caution", 'black', 'yellow', 'standout', '#111', '#fd3'),
|
||||
("msg_header_sent", 'black', 'light gray', 'standout', '#111', '#ddd'),
|
||||
("msg_header_delivered", 'black', 'light blue', 'standout', '#111', '#28b'),
|
||||
("msg_header_failed", 'black', 'dark gray', 'standout', 'black', 'dark gray'),
|
||||
("msg_warning_untrusted", 'black', 'dark red', 'standout', '#111', 'dark red'),
|
||||
("list_focus", "black", "light gray", "standout", "#111", "#bbb"),
|
||||
("list_off_focus", "black", "dark gray", "standout", "#111", "dark gray"),
|
||||
("list_trusted", "light green", "default", "default", "#6b2", "default"),
|
||||
("list_focus_trusted", "black", "light gray", "standout", "#180", "#bbb"),
|
||||
("list_unknown", "dark gray", "default", "default", "light gray", "default"),
|
||||
("list_untrusted", "dark red", "default", "default", "dark red", "default"),
|
||||
("list_focus_untrusted", "black", "light gray", "standout", "#810", "#bbb"),
|
||||
]
|
||||
THEME_DARK: {
|
||||
"urwid_theme": [
|
||||
# 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', '#ddd', 'default'),
|
||||
('error_text', 'dark red', 'default', 'default', 'dark red', 'default'),
|
||||
('warning_text', 'yellow', 'default', 'default', '#ba4', 'default'),
|
||||
('inactive_text', 'dark gray', 'default', 'default', 'dark gray', 'default'),
|
||||
('buttons', 'light green,bold', 'default', 'default', '#00a533', 'default'),
|
||||
('msg_editor', 'black', 'light cyan', 'standout', '#111', '#0bb'),
|
||||
("msg_header_ok", 'black', 'light green', 'standout', '#111', '#6b2'),
|
||||
("msg_header_caution", 'black', 'yellow', 'standout', '#111', '#fd3'),
|
||||
("msg_header_sent", 'black', 'light gray', 'standout', '#111', '#ddd'),
|
||||
("msg_header_delivered", 'black', 'light blue', 'standout', '#111', '#28b'),
|
||||
("msg_header_failed", 'black', 'dark gray', 'standout', 'black', 'dark gray'),
|
||||
("msg_warning_untrusted", 'black', 'dark red', 'standout', '#111', 'dark red'),
|
||||
("list_focus", "black", "light gray", "standout", "#111", "#bbb"),
|
||||
("list_off_focus", "black", "dark gray", "standout", "#111", "dark gray"),
|
||||
("list_trusted", "light green", "default", "default", "#6b2", "default"),
|
||||
("list_focus_trusted", "black", "light gray", "standout", "#180", "#bbb"),
|
||||
("list_unknown", "dark gray", "default", "default", "light gray", "default"),
|
||||
("list_normal", "dark gray", "default", "default", "light gray", "default"),
|
||||
("list_untrusted", "dark red", "default", "default", "dark red", "default"),
|
||||
("list_focus_untrusted", "black", "light gray", "standout", "#810", "#bbb"),
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
GLYPHSETS = {
|
||||
|
@ -81,12 +84,15 @@ class TextUI:
|
|||
|
||||
urwid.set_encoding("UTF-8")
|
||||
|
||||
intro_timeout = self.app.config["textui"]["intro_time"]
|
||||
colormode = self.app.config["textui"]["colormode"]
|
||||
theme = self.app.config["textui"]["theme"]
|
||||
mouse_enabled = self.app.config["textui"]["mouse_enabled"]
|
||||
intro_timeout = self.app.config["textui"]["intro_time"]
|
||||
colormode = self.app.config["textui"]["colormode"]
|
||||
theme = self.app.config["textui"]["theme"]
|
||||
mouse_enabled = self.app.config["textui"]["mouse_enabled"]
|
||||
|
||||
palette = THEMES[theme]
|
||||
self.palette = THEMES[theme]["urwid_theme"]
|
||||
|
||||
for entry in nomadnet.ui.textui.MarkupParser.URWID_THEME:
|
||||
self.palette.append(entry)
|
||||
|
||||
if self.app.config["textui"]["glyphs"] == "plain":
|
||||
glyphset = "plain"
|
||||
|
@ -101,9 +107,8 @@ class TextUI:
|
|||
for glyph in GLYPHS:
|
||||
self.glyphs[glyph[0]] = glyph[GLYPHSETS[glyphset]]
|
||||
|
||||
|
||||
self.screen = urwid.raw_display.Screen()
|
||||
self.screen.register_palette(palette)
|
||||
self.screen.register_palette(self.palette)
|
||||
|
||||
self.main_display = Main.MainDisplay(self, self.app)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue