mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-07-16 15:22:19 +02:00
limited menu columns to 4
This commit is contained in:
@ -323,15 +323,9 @@ void printProfile(Store node, String profilePubkey) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void printMenu(List<String> menuOptions) {
|
void printMenu(List<String> menuOptions) {
|
||||||
/*
|
|
||||||
for(int i = 0; i < menuOptions.length;i++) {
|
|
||||||
print(" ${i+1}. ${menuOptions[i]}");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
int longestMenuOption = 0;
|
int longestMenuOption = 0;
|
||||||
for(int i = 0; i < menuOptions.length;i++) {
|
for(int i = 0; i < menuOptions.length;i++) {
|
||||||
//print(" ${i+1}. ${menuOptions[i]}");
|
|
||||||
if( longestMenuOption < menuOptions[i].length) {
|
if( longestMenuOption < menuOptions[i].length) {
|
||||||
longestMenuOption = menuOptions[i].length;
|
longestMenuOption = menuOptions[i].length;
|
||||||
}
|
}
|
||||||
@ -346,6 +340,10 @@ void printMenu(List<String> menuOptions) {
|
|||||||
if( longestMenuOption + 5> gMenuWidth )
|
if( longestMenuOption + 5> gMenuWidth )
|
||||||
gMenuWidth = longestMenuOption + 8;
|
gMenuWidth = longestMenuOption + 8;
|
||||||
|
|
||||||
|
if( terminalColumns~/gMenuWidth > 4) {
|
||||||
|
terminalColumns = gMenuWidth * 4;
|
||||||
|
}
|
||||||
|
|
||||||
//print("gMenuWidth = $gMenuWidth");
|
//print("gMenuWidth = $gMenuWidth");
|
||||||
int rowLen = 0;
|
int rowLen = 0;
|
||||||
for(int i = 0; i < menuOptions.length;i++) {
|
for(int i = 0; i < menuOptions.length;i++) {
|
||||||
|
@ -5,12 +5,7 @@ homepage: https://github.com/vishalxl/nostr_console
|
|||||||
|
|
||||||
# Release 0.1.3-beta
|
# Release 0.1.3-beta
|
||||||
|
|
||||||
# horizontal menu
|
# limited menu columns to 4
|
||||||
# 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
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.17.3 <3.0.0'
|
sdk: '>=2.17.3 <3.0.0'
|
||||||
|
Reference in New Issue
Block a user