custom colors

This commit is contained in:
Nick Chan committed 2023-02-05 14:37:01 +08:00
1 parent d3edd09550
commit 597280c3c6
4 files changed
+18 -8

No files matched your search

+3 -2
View File
@@ -15,8 +15,9 @@
#define WIDTH 76
#define HEIGHT 19
#define MSG_COLOR 1
#define ICON_COLOR 2
#define PI_LOG_COLOR NEWT_COLORSET_CUSTOM(0)
#define PI_STEP_CURRENT NEWT_COLORSET_CUSTOM(1)
#define PI_STEP_OTHER NEWT_COLORSET_CUSTOM(2)
#define CHECKBOX_STATE(flags, opt) checkrain_option_enabled(flags, opt) ? '*' : ' '
+3
View File
@@ -42,6 +42,9 @@ int init_window() {
newtInit();
newtCls();
newtSetColor(PI_LOG_COLOR, "yellow", "black");
newtSetColor(PI_STEP_CURRENT, "lightgray", "black");
newtSetColor(PI_STEP_OTHER, "gray", "black");
newtDrawRootText(0, 0, "palera1n version 2.0.0");
newtPushHelpLine(NULL);
return 0;
+8 -4
View File
@@ -16,12 +16,16 @@ tui_screen_t tui_screen_main() {
int ret = MAIN_SCREEN;
bool can_start = false;
newtCenteredWindow(WIDTH, HEIGHT, NULL);
newtComponent optionsButton = newtCompactButton(46, 17, "Options");
newtComponent startButton = newtCompactButton(57, 17, "Start");
newtComponent exitButton = newtCompactButton(66, 17, "Exit");
newtComponent optionsButton = newtCompactButton(46, 18, "Options");
newtComponent startButton = newtCompactButton(57, 18, "Start");
newtComponent exitButton = newtCompactButton(66, 18, "Exit");
newtComponent welcome = newtLabel(1, 0, "Welcome to palera1n!");
newtComponent deviceMsg = newtTextbox(1, 2, 40, 3, NEWT_FLAG_WRAP);
newtTextboxSetText(deviceMsg, "Connect your iPhone, iPad or iPod Touch to begin.");
newtTextboxSetColors(deviceMsg, PI_LOG_COLOR, PI_LOG_COLOR);
newtComponent form = newtForm(NULL, NULL, 0);
newtFormAddComponents(form, optionsButton, startButton, exitButton, welcome, NULL);
newtFormAddComponents(form, optionsButton, startButton, exitButton, welcome,
deviceMsg, NULL);
newtRunForm(form);
newtRefresh();
newtComponent buttonPressed = newtFormGetCurrent(form);
+4 -2
View File
@@ -35,10 +35,11 @@ tui_screen_t tui_screen_options() {
int ret = MAIN_SCREEN;
newtCenteredWindow(WIDTH, HEIGHT, NULL);
newtComponent backButton = newtCompactButton(66, 17, "Back");
newtComponent backButton = newtCompactButton(66, 18, "Back");
newtComponent optionsNotice = newtTextbox(1, 0, WIDTH - 2, 3, NEWT_FLAG_WRAP);
newtTextboxSetText(optionsNotice, "You may set the following options. If you don't know what they mean you'll probably have no reason to set them.");
// newtTextboxSetColors(optionsNotice, NEWT_COLORSET_LABEL, NEWT_COLORSET_LABEL);
newtComponent verboseBootBox = newtCheckbox(1, 3, "Verbose boot", CHECKBOX_STATE(kpf_flags, checkrain_option_verbose_boot), NULL, NULL);
newtComponent rootfulBox = newtCheckbox(1, 4, "Rootful", CHECKBOX_STATE(palerain_flags, palerain_option_rootful), NULL, NULL);
@@ -62,7 +63,8 @@ tui_screen_t tui_screen_options() {
newtComponent form = newtForm(NULL, NULL, 0);
newtFormAddComponents(form, backButton, verboseBootBox, rootfulBox,
rootfulSetupBox, forceRevertBox, safeModeBox, bootCmdlineLabel,
bootCmdlineEntry, flowerChainBox, optionsNotice, NULL);
bootCmdlineEntry, flowerChainBox, optionsNotice,
NULL);
newtRunForm(form);
newtRefresh();
snprintf(xargs_cmd, 0x270, "xargs %s", bootargs_entered);