Refactor editor code, confirm on new if modified

* Break out the doDeleteValue method in Editor
* Confirm to save/discard when document modified and new requested
* Re-add the title to menus
This commit is contained in:
2024-10-04 17:08:54 +02:00
parent 14d5239ea6
commit ed57eec3b0
2 changed files with 52 additions and 19 deletions
+3
View File
@@ -89,10 +89,13 @@ class Menu
$thumbTop = round($scrollTop * $visibleItems);
$thumbBottom = round($visibleItems * $scrollBottom);
$tleft = round(($width / 2) - ((mb_strlen($this->title) + 2) / 2));
// draw head
echo "\e[40;37m";
$this->terminal
->writeAt($left, $top + 0, self::U_CORNER_ROUNDED_TOPLEFT.str_repeat(self::U_EDGE_HORIZONTAL,$width - 2).self::U_CORNER_ROUNDED_TOPRIGHT)
->writeAt($left + $tleft, $top + 0, " \e[1m{$this->title}\e[22m ")
//->writeAt($left, $top + 1, self::U_EDGE_VERTICAL.str_repeat(" ",$width - 2).self::U_EDGE_VERTICAL)
//->writeAt($left + 2, $top + 1, "\e[1m" . $this->title . "\e[22m")
//->writeAt($left, $top + 2, self::U_EDGE_VERTICAL_RIGHT.str_repeat(self::U_EDGE_HORIZONTAL,$width - 2).self::U_EDGE_VERTICAL_LEFT)