mirror of
https://github.com/rozniak/xfce-winxp-tc.git
synced 2026-05-03 04:31:36 +00:00
Prelim: Draw progress bar
This commit is contained in:
@@ -11,6 +11,7 @@ COLOR_PAIR_NORMAL_TEXT = 1
|
|||||||
COLOR_PAIR_BRIGHT_TEXT = 2
|
COLOR_PAIR_BRIGHT_TEXT = 2
|
||||||
COLOR_PAIR_HIGHLIGHT_OPTION = 3
|
COLOR_PAIR_HIGHLIGHT_OPTION = 3
|
||||||
COLOR_PAIR_INSTRUCTIONS = 4
|
COLOR_PAIR_INSTRUCTIONS = 4
|
||||||
|
COLOR_PAIR_PROGRESS = 5
|
||||||
|
|
||||||
# Coords for the working area
|
# Coords for the working area
|
||||||
#
|
#
|
||||||
@@ -43,6 +44,11 @@ def wsetup_screen_init(stdscr):
|
|||||||
curses.COLOR_BLACK,
|
curses.COLOR_BLACK,
|
||||||
curses.COLOR_WHITE
|
curses.COLOR_WHITE
|
||||||
)
|
)
|
||||||
|
curses.init_pair(
|
||||||
|
COLOR_PAIR_PROGRESS,
|
||||||
|
curses.COLOR_YELLOW,
|
||||||
|
curses.COLOR_BLUE
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
curses.init_pair(
|
curses.init_pair(
|
||||||
@@ -134,6 +140,14 @@ def wsetup_screen_write_direct(stdscr, y, x, text, attr):
|
|||||||
def wsetup_screen_write_simple(stdscr, y, x, text, attr):
|
def wsetup_screen_write_simple(stdscr, y, x, text, attr):
|
||||||
wsetup_screen_write_direct(stdscr, WSETUP_MAIN_Y + y, WSETUP_MAIN_X + x, text, attr)
|
wsetup_screen_write_direct(stdscr, WSETUP_MAIN_Y + y, WSETUP_MAIN_X + x, text, attr)
|
||||||
|
|
||||||
|
def wsetup_screen_draw_bar(stdscr, y, x, width):
|
||||||
|
for i in range(width):
|
||||||
|
stdscr.addch(
|
||||||
|
y, x + i,
|
||||||
|
curses.ACS_BLOCK,
|
||||||
|
curses.color_pair(COLOR_PAIR_PROGRESS)
|
||||||
|
)
|
||||||
|
|
||||||
def wsetup_screen_draw_box(stdscr, y, x, height, width):
|
def wsetup_screen_draw_box(stdscr, y, x, height, width):
|
||||||
# Top left corner
|
# Top left corner
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -309,11 +309,17 @@ def wsetup_step_install_base(stdscr):
|
|||||||
|
|
||||||
wsetup_screen_write_simple(
|
wsetup_screen_write_simple(
|
||||||
stdscr,
|
stdscr,
|
||||||
box_y + 1,
|
box_y + 2,
|
||||||
wsetup_screen_get_scaled_x(stdscr, 40) - 2,
|
wsetup_screen_get_scaled_x(stdscr, 40) - 3,
|
||||||
progress,
|
progress,
|
||||||
curses.color_pair(COLOR_PAIR_NORMAL_TEXT)
|
curses.color_pair(COLOR_PAIR_NORMAL_TEXT)
|
||||||
)
|
)
|
||||||
|
wsetup_screen_draw_bar(
|
||||||
|
stdscr,
|
||||||
|
progbox_y + 1,
|
||||||
|
progbox_x + 1,
|
||||||
|
progbox_w - 2
|
||||||
|
)
|
||||||
|
|
||||||
stdscr.refresh()
|
stdscr.refresh()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user