mirror of
https://github.com/markqvist/NomadNet.git
synced 2024-10-01 01:26:07 -04:00
Added light theme
This commit is contained in:
parent
48a5001009
commit
959cc13167
@ -429,6 +429,10 @@ announce_at_start = yes
|
||||
# Amount of time to show intro screen
|
||||
intro_time = 1
|
||||
|
||||
# You can specify the display theme.
|
||||
# theme = dark
|
||||
theme = light
|
||||
|
||||
# Specify the number of colors to use
|
||||
# valid colormodes are:
|
||||
# monochrome, 16, 88, 256 and 24bit
|
||||
|
@ -48,6 +48,39 @@ THEMES = {
|
||||
("progress_full", "black", "light gray", "standout", "#111", "#bbb"),
|
||||
("progress_empty", "light gray", "default", "default", "#ddd", "default"),
|
||||
],
|
||||
},
|
||||
THEME_LIGHT: {
|
||||
"urwid_theme": [
|
||||
# Style name # 16-color style # Monochrome style # 88, 256 and true-color style
|
||||
("heading", "dark gray,underline", "default", "underline", "g93,underline", "default"),
|
||||
("menubar", "black", "dark gray", "standout", "#111", "#bbb"),
|
||||
("scrollbar", "dark gray", "default", "standout", "#444", "default"),
|
||||
("shortcutbar", "black", "dark gray", "standout", "#111", "#bbb"),
|
||||
("body_text", "black", "default", "default", "#222", "default"),
|
||||
("error_text", "dark red", "default", "default", "dark red", "default"),
|
||||
("warning_text", "yellow", "default", "default", "#ba4", "default"),
|
||||
("inactive_text", "light gray", "default", "default", "dark gray", "default"),
|
||||
("buttons", "light green,bold", "default", "default", "#00a533", "default"),
|
||||
("msg_editor", "black", "dark cyan", "standout", "#111", "#0bb"),
|
||||
("msg_header_ok", "black", "dark green", "standout", "#111", "#6b2"),
|
||||
("msg_header_caution", "black", "yellow", "standout", "#111", "#fd3"),
|
||||
("msg_header_sent", "black", "dark gray", "standout", "#111", "#ddd"),
|
||||
("msg_header_delivered", "black", "light blue", "standout", "#111", "#28b"),
|
||||
("msg_header_failed", "black", "dark gray", "standout", "#000", "#777"),
|
||||
("msg_warning_untrusted", "black", "dark red", "standout", "#111", "dark red"),
|
||||
("list_focus", "black", "dark gray", "standout", "#111", "#aaa"),
|
||||
("list_off_focus", "black", "dark gray", "standout", "#111", "#777"),
|
||||
("list_trusted", "dark green", "default", "default", "#4a0", "default"),
|
||||
("list_focus_trusted", "black", "dark gray", "standout", "#150", "#aaa"),
|
||||
("list_unknown", "dark gray", "default", "default", "#444", "default"),
|
||||
("list_normal", "dark gray", "default", "default", "#444", "default"),
|
||||
("list_untrusted", "dark red", "default", "default", "#a22", "default"),
|
||||
("list_focus_untrusted", "black", "dark gray", "standout", "#810", "#aaa"),
|
||||
("topic_list_normal", "black", "default", "default", "#222", "default"),
|
||||
("browser_controls", "dark gray", "default", "default", "#444", "default"),
|
||||
("progress_full", "black", "dark gray", "standout", "#111", "#bbb"),
|
||||
("progress_empty", "dark gray", "default", "default", "#ddd", "default"),
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ TOPIC_INTRODUCTION = '''>Nomad Network
|
||||
|
||||
The intention with this program is to provide a tool to that allows you to build private and resilient communications platforms that are in complete control and ownership of the people that use them.
|
||||
|
||||
Nomad Network is build on LXMF and Reticulum, which together provides the cryptographic mesh functionality and peer-to-peer message routing that Nomad Network relies on. This foundation also makes it possible to use the program over a very wide variety of communication mediums, from packet radio to gigabit fiber.
|
||||
Nomad Network is build on LXMF and Reticulum, which together provides the cryptographic mesh functionality and peer-to-peer message routing that Nomad Network relies on. This foundation also makes it possible to use the program over a very wide variety of communication mediums, from packet radio to fiber.
|
||||
|
||||
Nomad Network does not need any connections to the public internet to work. In fact, it doesn't even need an IP or Ethernet network. You can use it entirely over packet radio, LoRa or even serial lines. But if you wish, you can bridge islanded Reticulum networks over the Internet or private ethernet networks, or you can build networks running completely over the Internet. The choice is yours.
|
||||
|
||||
|
@ -5,16 +5,26 @@ from urwid.util import is_mouse_press
|
||||
from urwid.text_layout import calc_coords
|
||||
import re
|
||||
|
||||
DEFAULT_FG = "ddd"
|
||||
DEFAULT_FG_DARK = "ddd"
|
||||
DEFAULT_FG_LIGHT = "222"
|
||||
DEFAULT_BG = "default"
|
||||
|
||||
STYLES = {
|
||||
"plain": { "fg": DEFAULT_FG, "bg": DEFAULT_BG, "bold": False, "underline": False, "italic": False },
|
||||
SELECTED_STYLES = None
|
||||
|
||||
STYLES_DARK = {
|
||||
"plain": { "fg": DEFAULT_FG_DARK, "bg": DEFAULT_BG, "bold": False, "underline": False, "italic": False },
|
||||
"heading1": { "fg": "222", "bg": "bbb", "bold": False, "underline": False, "italic": False },
|
||||
"heading2": { "fg": "111", "bg": "999", "bold": False, "underline": False, "italic": False },
|
||||
"heading3": { "fg": "000", "bg": "777", "bold": False, "underline": False, "italic": False },
|
||||
}
|
||||
|
||||
STYLES_LIGHT = {
|
||||
"plain": { "fg": DEFAULT_FG_LIGHT, "bg": DEFAULT_BG, "bold": False, "underline": False, "italic": False },
|
||||
"heading1": { "fg": "000", "bg": "777", "bold": False, "underline": False, "italic": False },
|
||||
"heading2": { "fg": "111", "bg": "aaa", "bold": False, "underline": False, "italic": False },
|
||||
"heading3": { "fg": "222", "bg": "ccc", "bold": False, "underline": False, "italic": False },
|
||||
}
|
||||
|
||||
SYNTH_STYLES = []
|
||||
SYNTH_SPECS = {}
|
||||
|
||||
@ -22,12 +32,18 @@ SECTION_INDENT = 2
|
||||
INDENT_RIGHT = 1
|
||||
|
||||
def markup_to_attrmaps(markup, url_delegate = None):
|
||||
global SELECTED_STYLES
|
||||
if nomadnet.NomadNetworkApp.get_shared_instance().config["textui"]["theme"] == nomadnet.ui.TextUI.THEME_DARK:
|
||||
SELECTED_STYLES = STYLES_DARK
|
||||
else:
|
||||
SELECTED_STYLES = STYLES_LIGHT
|
||||
|
||||
attrmaps = []
|
||||
|
||||
state = {
|
||||
"literal": False,
|
||||
"depth": 0,
|
||||
"fg_color": DEFAULT_FG,
|
||||
"fg_color": SELECTED_STYLES["plain"]["fg"],
|
||||
"bg_color": DEFAULT_BG,
|
||||
"formatting": {
|
||||
"bold": False,
|
||||
@ -90,8 +106,8 @@ def parse_line(line, state, url_delegate):
|
||||
|
||||
for j in range(1, i+1):
|
||||
wanted_style = "heading"+str(i)
|
||||
if wanted_style in STYLES:
|
||||
style = STYLES[wanted_style]
|
||||
if wanted_style in SELECTED_STYLES:
|
||||
style = SELECTED_STYLES[wanted_style]
|
||||
|
||||
line = line[state["depth"]:]
|
||||
if len(line) > 0:
|
||||
@ -233,7 +249,7 @@ def make_output(state, line, url_delegate):
|
||||
state["fg_color"] = color
|
||||
skip = 3
|
||||
elif c == "f":
|
||||
state["fg_color"] = DEFAULT_FG
|
||||
state["fg_color"] = SELECTED_STYLES["plain"]["fg"]
|
||||
elif c == "B":
|
||||
if len(line) >= i+4:
|
||||
color = line[i+1:i+4]
|
||||
@ -245,7 +261,7 @@ def make_output(state, line, url_delegate):
|
||||
state["formatting"]["bold"] = False
|
||||
state["formatting"]["underline"] = False
|
||||
state["formatting"]["italic"] = False
|
||||
state["fg_color"] = DEFAULT_FG
|
||||
state["fg_color"] = SELECTED_STYLES["plain"]["fg"]
|
||||
state["bg_color"] = DEFAULT_BG
|
||||
state["align"] = state["default_align"]
|
||||
elif c == "c":
|
||||
|
3
nomadnet/vendor/quotes.py
vendored
3
nomadnet/vendor/quotes.py
vendored
@ -1,4 +1,5 @@
|
||||
quotes = [
|
||||
("I want the wisdom that wise men revere. I want more.", "Faithless"),
|
||||
("That's enough entropy for you my friend", "Unknown")
|
||||
("That's enough entropy for you my friend", "Unknown"),
|
||||
("Any time two people connect online, it's financed by a third person who believes they can manipulate the first two", "Jaron Lanier")
|
||||
]
|
Loading…
Reference in New Issue
Block a user