limited menu columns to 4

This commit is contained in:
Vishal
2022-11-14 12:31:20 +05:30
parent c8d1312284
commit 9b52db93f1
2 changed files with 5 additions and 12 deletions

View File

@ -323,15 +323,9 @@ void printProfile(Store node, String profilePubkey) {
}
void printMenu(List<String> menuOptions) {
/*
for(int i = 0; i < menuOptions.length;i++) {
print(" ${i+1}. ${menuOptions[i]}");
}
*/
int longestMenuOption = 0;
for(int i = 0; i < menuOptions.length;i++) {
//print(" ${i+1}. ${menuOptions[i]}");
if( longestMenuOption < menuOptions[i].length) {
longestMenuOption = menuOptions[i].length;
}
@ -346,6 +340,10 @@ void printMenu(List<String> menuOptions) {
if( longestMenuOption + 5> gMenuWidth )
gMenuWidth = longestMenuOption + 8;
if( terminalColumns~/gMenuWidth > 4) {
terminalColumns = gMenuWidth * 4;
}
//print("gMenuWidth = $gMenuWidth");
int rowLen = 0;
for(int i = 0; i < menuOptions.length;i++) {

View File

@ -5,12 +5,7 @@ homepage: https://github.com/vishalxl/nostr_console
# Release 0.1.3-beta
# horizontal menu
# fixed tests
# clear screen for public channels +
# improved howto messages
# removed red error for default invokation related to invalid old encrypted group keys
# more clear screen
# limited menu columns to 4
environment:
sdk: '>=2.17.3 <3.0.0'