mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-09-27 17:16:13 +02:00
minor improvement in re alignment logic
This commit is contained in:
@@ -98,6 +98,11 @@ Future<void> terminalMenuUi(Tree node, var contactList) async {
|
|||||||
//gDebug = 1;
|
//gDebug = 1;
|
||||||
bool userContinue = true;
|
bool userContinue = true;
|
||||||
while(userContinue) {
|
while(userContinue) {
|
||||||
|
// align the text again in case the window size has been changed
|
||||||
|
if( gAlignment == "center") {
|
||||||
|
gNumLeftMarginSpaces = (stdout.terminalColumns - gTextWidth )~/2;
|
||||||
|
}
|
||||||
|
|
||||||
// need a bit of wait to give other events to execute, so do a delay, which allows
|
// need a bit of wait to give other events to execute, so do a delay, which allows
|
||||||
// relays to recieve and handle new events
|
// relays to recieve and handle new events
|
||||||
const int waitMilliSeconds = 400;
|
const int waitMilliSeconds = 400;
|
||||||
@@ -122,11 +127,6 @@ Future<void> terminalMenuUi(Tree node, var contactList) async {
|
|||||||
print('You picked: $option');
|
print('You picked: $option');
|
||||||
switch(option) {
|
switch(option) {
|
||||||
case 1:
|
case 1:
|
||||||
// align the text again in case the window size has been changed
|
|
||||||
if( gAlignment == "center") {
|
|
||||||
gNumLeftMarginSpaces = (stdout.terminalColumns - gTextWidth )~/2;
|
|
||||||
}
|
|
||||||
|
|
||||||
node.printTree(0, true, DateTime.now().subtract(Duration(days:numLastDays)));
|
node.printTree(0, true, DateTime.now().subtract(Duration(days:numLastDays)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ Future<void> main(List<String> arguments) async {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// can be computed only after screenWidth has been found
|
// can be computed only after textWidth has been found
|
||||||
gNumLeftMarginSpaces = (stdout.terminalColumns - gTextWidth )~/2;
|
gNumLeftMarginSpaces = (stdout.terminalColumns - gTextWidth )~/2;
|
||||||
|
|
||||||
// undo above if left option is given
|
// undo above if left option is given
|
||||||
|
Reference in New Issue
Block a user