Make widths configurable (#189)

This commit is contained in:
pdxlocations
2025-06-06 22:37:10 -07:00
committed by GitHub
parent 00226c5b4d
commit c7edd602ec
2 changed files with 7 additions and 2 deletions

View File

@@ -23,8 +23,8 @@ def handle_resize(stdscr: curses.window, firstrun: bool) -> None:
height, width = stdscr.getmaxyx()
# Define window dimensions and positions
channel_width = 3 * (width // 16)
nodes_width = 5 * (width // 16)
channel_width = int(config.channel_list_16ths) * (width // 16)
nodes_width = int(config.node_list_16ths) * (width // 16)
messages_width = width - channel_width - nodes_width
if firstrun:

View File

@@ -127,6 +127,8 @@ def initialize_config() -> Dict[str, object]:
"node_ignored": ["red", "black"],
}
default_config_variables = {
"node_list_16ths": "5",
"channel_list_16ths": "3",
"db_file_path": db_file_path,
"log_file_path": log_file_path,
"message_prefix": ">>",
@@ -170,9 +172,12 @@ def assign_config_variables(loaded_config: Dict[str, object]) -> None:
global db_file_path, log_file_path, message_prefix, sent_message_prefix
global notification_symbol, ack_implicit_str, ack_str, nak_str, ack_unknown_str
global node_list_16ths, channel_list_16ths
global theme, COLOR_CONFIG
global node_sort
node_list_16ths = loaded_config["node_list_16ths"]
channel_list_16ths = loaded_config["channel_list_16ths"]
db_file_path = loaded_config["db_file_path"]
log_file_path = loaded_config["log_file_path"]
message_prefix = loaded_config["message_prefix"]