diff --git a/.github/workflows/api-docs.yml b/.github/workflows/api-docs.yml index ea46a750a..0386c3fef 100644 --- a/.github/workflows/api-docs.yml +++ b/.github/workflows/api-docs.yml @@ -36,14 +36,14 @@ jobs: - name: Upload artifact if: github.ref_name == 'main' || github.ref_name == 'develop' - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 with: path: docfx/_site - name: Deploy to GitHub Pages if: github.ref_name == 'main' || github.ref_name == 'develop' id: deployment - uses: actions/deploy-pages@v3 + uses: actions/deploy-pages@v4 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Terminal.Gui/Application.cs b/Terminal.Gui/Application.cs index 328e36729..1ec014d5f 100644 --- a/Terminal.Gui/Application.cs +++ b/Terminal.Gui/Application.cs @@ -640,7 +640,7 @@ public static partial class Application { /// it will be set to if at least one iteration happened. public static void RunIteration (ref RunState state, ref bool firstIteration) { - if (MainLoop.EventsPending () && MainLoop.Running) { + if (MainLoop.Running && MainLoop.EventsPending ()) { // Notify Toplevel it's ready if (firstIteration) { state.Toplevel.OnReady (); diff --git a/Terminal.Gui/View/Layout/PosDim.cs b/Terminal.Gui/View/Layout/PosDim.cs index 1971ee863..fa60c6683 100644 --- a/Terminal.Gui/View/Layout/PosDim.cs +++ b/Terminal.Gui/View/Layout/PosDim.cs @@ -1,5 +1,4 @@ using System; -using static Terminal.Gui.Dim; namespace Terminal.Gui; diff --git a/UICatalog/Scenarios/Animation.cs b/UICatalog/Scenarios/Animation.cs index 0758dd461..5d22e1497 100644 --- a/UICatalog/Scenarios/Animation.cs +++ b/UICatalog/Scenarios/Animation.cs @@ -39,7 +39,15 @@ namespace UICatalog.Scenarios { }; Win.Add (lbl2); - var dir = new DirectoryInfo (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location)); + DirectoryInfo dir; + + var assemblyLocation = Assembly.GetExecutingAssembly ().Location; + + if (!string.IsNullOrEmpty (assemblyLocation)) { + dir = new DirectoryInfo (Path.GetDirectoryName (assemblyLocation)); + } else { + dir = new DirectoryInfo (System.AppContext.BaseDirectory); + } var f = new FileInfo ( Path.Combine (dir.FullName, "Scenarios", "Spinning_globe_dark_small.gif")); diff --git a/UICatalog/Scenarios/Dialogs.cs b/UICatalog/Scenarios/Dialogs.cs index f11ad242b..0cebc45b7 100644 --- a/UICatalog/Scenarios/Dialogs.cs +++ b/UICatalog/Scenarios/Dialogs.cs @@ -115,6 +115,20 @@ namespace UICatalog.Scenarios { }; frame.Add (styleRadioGroup); + frame.ValidatePosDim = true; + void Top_Loaded (object sender, EventArgs args) + { + frame.Height = + widthEdit.Frame.Height + + heightEdit.Frame.Height + + titleEdit.Frame.Height + + numButtonsEdit.Frame.Height + + glyphsNotWords.Frame.Height + + styleRadioGroup.Frame.Height; + Application.Top.Loaded -= Top_Loaded; + } + Application.Top.Loaded += Top_Loaded; + Win.Add (frame); label = new Label ("Button Pressed:") { diff --git a/UICatalog/Scenarios/MessageBoxes.cs b/UICatalog/Scenarios/MessageBoxes.cs index 901e7b545..b9d5d04f4 100644 --- a/UICatalog/Scenarios/MessageBoxes.cs +++ b/UICatalog/Scenarios/MessageBoxes.cs @@ -145,7 +145,24 @@ namespace UICatalog.Scenarios { Y = Pos.Top (label) + 3 }; frame.Add (ckbWrapMessage); - + + frame.ValidatePosDim = true; + void Top_Loaded (object sender, EventArgs args) + { + frame.Height = + widthEdit.Frame.Height + + heightEdit.Frame.Height + + titleEdit.Frame.Height + + messageEdit.Frame.Height + + numButtonsEdit.Frame.Height + + defaultButtonEdit.Frame.Height + + styleRadioGroup.Frame.Height + + 2 + + ckbWrapMessage.Frame.Height; + Application.Top.Loaded -= Top_Loaded; + } + //Application.Top.Loaded += Top_Loaded; + label = new Label ("Button Pressed:") { X = Pos.Center (), Y = Pos.Bottom (frame) + 4, diff --git a/UICatalog/UICatalog.cs b/UICatalog/UICatalog.cs index b8171714f..91c2a60fd 100644 --- a/UICatalog/UICatalog.cs +++ b/UICatalog/UICatalog.cs @@ -147,8 +147,18 @@ class UICatalogApp { { // Setup a file system watcher for `./.tui/` _currentDirWatcher.NotifyFilter = NotifyFilters.LastWrite; - var f = new FileInfo (Assembly.GetExecutingAssembly ().Location); - string tuiDir = Path.Combine (f.Directory!.FullName, ".tui"); + + var assemblyLocation = Assembly.GetExecutingAssembly ().Location; + string tuiDir; + + if (!string.IsNullOrEmpty (assemblyLocation)) { + var assemblyFile = new FileInfo (assemblyLocation); + tuiDir = Path.Combine (assemblyFile.Directory!.FullName, ".tui"); + } else { + tuiDir = Path.Combine (System.AppContext.BaseDirectory, ".tui"); + } + + if (!Directory.Exists (tuiDir)) { Directory.CreateDirectory (tuiDir); @@ -158,7 +168,7 @@ class UICatalogApp { // Setup a file system watcher for `~/.tui/` _homeDirWatcher.NotifyFilter = NotifyFilters.LastWrite; - f = new FileInfo (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile)); + var f = new FileInfo (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile)); tuiDir = Path.Combine (f.FullName, ".tui"); if (!Directory.Exists (tuiDir)) { diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index 0da497ab8..48f79fce3 100644 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -25,8 +25,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive