Delete statusbar.py

This commit is contained in:
Madeleine 2022-03-19 15:15:15 +00:00 committed by GitHub
parent a1e71026c4
commit 3db4393a08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,45 +0,0 @@
import curses
def themes(data):
if data["statusbar_theme"] == "bare":
# The theme colors
colors = (7, data["mode_color"] - 1, 13, 1)
# Add spaces before each part
icon = f" {data['icon']}"
mode = f" {data['mode'].upper()}"
file = f" {data['buffer_name']}"
else:
# The theme colors
colors = (8, data["mode_color"], 14, 2)
# Add spaces on either end
icon = f" {data['icon']} "
mode = f" {data['mode'].upper()} "
file = f" {data['buffer_name']} "
return colors, icon, mode, file
def refresh(screen, data):
# Calculate the theme
colors, icon, mode, file = themes(data)
# Render icon
screen.addstr(data["height"] - 2, 0, icon,
curses.color_pair(colors[0]) | curses.A_BOLD)
# Render mode
screen.addstr(data["height"] - 2, len(icon), mode,
curses.color_pair(colors[1]) | curses.A_BOLD)
# Render file name
screen.addstr(data["height"] - 2, len(icon) + len(mode), file,
curses.color_pair(colors[2]) | curses.A_BOLD)
# Rest of the bar
screen.addstr(data["height"] - 2, len(icon) + len(mode) + len(file),
" " * (data["width"] - (len(icon) + len(mode) + len(file))),
curses.color_pair(colors[3]))