From 6c2b74b1d7958a70c3354aaafffb8c3d5a91fd21 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 14:06:34 +0000 Subject: [PATCH 1/3] Bump ReportGenerator from 5.1.10 to 5.1.11 Bumps [ReportGenerator](https://github.com/danielpalme/ReportGenerator) from 5.1.10 to 5.1.11. - [Release notes](https://github.com/danielpalme/ReportGenerator/releases) - [Commits](https://github.com/danielpalme/ReportGenerator/compare/v5.1.10...v5.1.11) --- updated-dependencies: - dependency-name: ReportGenerator dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- UnitTests/UnitTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index f01db4c0c..42fffbd9f 100644 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -19,7 +19,7 @@ - + From 4b8917a08d0dc021942477cb590a746bb2fef387 Mon Sep 17 00:00:00 2001 From: BDisp Date: Thu, 10 Nov 2022 17:14:45 +0000 Subject: [PATCH 2/3] Fixes #2213. ContextMenu.IsShow is wrongly inheriting previous value on a new instance. --- Terminal.Gui/Views/ContextMenu.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Terminal.Gui/Views/ContextMenu.cs b/Terminal.Gui/Views/ContextMenu.cs index 71d3c41b3..84e4db4da 100644 --- a/Terminal.Gui/Views/ContextMenu.cs +++ b/Terminal.Gui/Views/ContextMenu.cs @@ -52,7 +52,10 @@ namespace Terminal.Gui { public ContextMenu (int x, int y, MenuBarItem menuItems) { if (IsShow) { - Hide (); + if (menuBar.SuperView != null) { + Hide (); + } + IsShow = false; } MenuItems = menuItems; Position = new Point (x, y); @@ -126,7 +129,7 @@ namespace Terminal.Gui { } else if (ForceMinimumPosToZero && position.Y < 0) { position.Y = 0; } - + menuBar = new MenuBar (new [] { MenuItems }) { X = position.X, Y = position.Y, From 828ab61ff0ea9d2d09d134d65b1f56e215fa4d80 Mon Sep 17 00:00:00 2001 From: BDisp Date: Fri, 11 Nov 2022 12:37:20 +0000 Subject: [PATCH 3/3] Fixes #2216. MessageBox default width should be proportional for smaller screens. --- Terminal.Gui/Windows/MessageBox.cs | 5 ++++- UnitTests/MessageBoxTests.cs | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Terminal.Gui/Windows/MessageBox.cs b/Terminal.Gui/Windows/MessageBox.cs index 9d9c74864..8afa8fc5d 100644 --- a/Terminal.Gui/Windows/MessageBox.cs +++ b/Terminal.Gui/Windows/MessageBox.cs @@ -238,7 +238,10 @@ namespace Terminal.Gui { static int QueryFull (bool useErrorColors, int width, int height, ustring title, ustring message, int defaultButton = 0, Border border = null, params ustring [] buttons) { - const int defaultWidth = 50; + int defaultWidth = 50; + if (defaultWidth > Application.Driver.Cols / 2) { + defaultWidth = (int)(Application.Driver.Cols * 0.60f); + } int maxWidthLine = TextFormatter.MaxWidthLine (message); if (maxWidthLine > Application.Driver.Cols) { maxWidthLine = Application.Driver.Cols; diff --git a/UnitTests/MessageBoxTests.cs b/UnitTests/MessageBoxTests.cs index 2c79aa299..dc9881551 100644 --- a/UnitTests/MessageBoxTests.cs +++ b/UnitTests/MessageBoxTests.cs @@ -30,11 +30,11 @@ namespace Terminal.Gui.Views { } else if (iterations == 1) { Application.Top.Redraw (Application.Top.Bounds); TestHelpers.AssertDriverContentsWithFrameAre (@" - ┌ Title ─────────────────────────────────────────┐ - │ Message │ - │ │ - │ │ - └────────────────────────────────────────────────┘ + ┌ Title ───────────────────────────────────────┐ + │ Message │ + │ │ + │ │ + └──────────────────────────────────────────────┘ ", output); Application.RequestStop ();