mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-24 19:19:48 +02:00
require 80x24
This commit is contained in:
1 parent
dc9065dd76
commit
89ed9e7565
1 file changed
+12
-3
+12
-3
@@ -42,6 +42,15 @@ int init_window() {
|
|||||||
|
|
||||||
tui_started = true;
|
tui_started = true;
|
||||||
newtInit();
|
newtInit();
|
||||||
|
int cols, rows;
|
||||||
|
newtGetScreenSize(&cols, &rows);
|
||||||
|
if (cols < 80 || rows < 24) {
|
||||||
|
newtFinished();
|
||||||
|
tui_started = false;
|
||||||
|
LOG(LOG_FATAL, "Terminal size must be at least 80x24");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
LOG(LOG_VERBOSE3, "cols: %d, rows: %d\n", cols, rows);
|
||||||
newtCls();
|
newtCls();
|
||||||
newtSetColor(PI_LOG_COLOR, "yellow", "black");
|
newtSetColor(PI_LOG_COLOR, "yellow", "black");
|
||||||
newtSetColor(PI_STEP_CURRENT, "lightgray", "black");
|
newtSetColor(PI_STEP_CURRENT, "lightgray", "black");
|
||||||
@@ -52,8 +61,9 @@ int init_window() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int tui() {
|
int tui() {
|
||||||
init_window();
|
int ret = 0;
|
||||||
int ret = MAIN_SCREEN;
|
if ((ret = init_window())) return ret;
|
||||||
|
ret = MAIN_SCREEN;
|
||||||
while (1) {
|
while (1) {
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case ERROR_SCREEN:
|
case ERROR_SCREEN:
|
||||||
@@ -87,5 +97,4 @@ out:
|
|||||||
newtFinished();
|
newtFinished();
|
||||||
tui_started = false;
|
tui_started = false;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user