Skip to content

Commit d3b9b26

Browse files
committed
Update to latest packages and don't show F1 help if menu is open or context menu popped.
1 parent 0d82c1c commit d3b9b26

20 files changed

+73
-79
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ italics are experimental and require passing the `-e` flag when starting applica
171171
- [x] Container views (e.g. TabView)
172172
- [ ] To OS clipboard (e.g. open one Designer.cs View and copy to another)
173173
- [x] Retain PosRelative mappings in pasted views (e.g. `A` LeftOf `B`)
174-
- [x] Move views to subviews
174+
- [x] Move views to SubViews
175175
- [x] With mouse
176176
- [ ] With keyboard
177177
- [ ] Read and present xmldoc comments when editing properties

Showcase/Menu.Designer.cs

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Showcase/Showcase.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Terminal.Gui" Version="2.0.0-develop.4363" />
11+
<PackageReference Include="Terminal.Gui" Version="2.0.0-develop.4372" />
1212
</ItemGroup>
1313

1414
</Project>

src/Design.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ public IEnumerable<Design> GetSiblings()
458458
yield break;
459459
}
460460

461-
foreach (var v in this.View.SuperView.Subviews)
461+
foreach (var v in this.View.SuperView.SubViews)
462462
{
463463
if (v == this.View)
464464
{

src/StatusBarExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static class StatusBarExtensions
3838
int distance = initialWhitespace;
3939
Dictionary<int, Shortcut?> xLocations = new();
4040

41-
foreach (var si in statusBar.Subviews.OfType<Shortcut>())
41+
foreach (var si in statusBar.SubViews.OfType<Shortcut>())
4242
{
4343
xLocations.Add(distance, si);
4444
distance += si.Title.GetColumns() + afterEachItemWhitespace;
@@ -65,7 +65,7 @@ public static class StatusBarExtensions
6565
/// <returns></returns>
6666
public static int CountShortcuts(this StatusBar bar)
6767
{
68-
return bar.Subviews.OfType<Shortcut>().Count();
68+
return bar.SubViews.OfType<Shortcut>().Count();
6969
}
7070

7171
/// <summary>
@@ -76,7 +76,7 @@ public static int CountShortcuts(this StatusBar bar)
7676
/// <returns></returns>
7777
public static Shortcut[] GetShortcuts(this StatusBar bar)
7878
{
79-
return bar.Subviews.OfType<Shortcut>().ToArray();
79+
return bar.SubViews.OfType<Shortcut>().ToArray();
8080
}
8181

8282
/// <summary>

src/TerminalGuiDesigner.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
* Right click context menu support
130130
* Increased mouse resizing click hit box
131131
* Added progress indicator for creating new Views
132-
* Fixed mouse dragging/resizing of views in subviews (e.g. TabViews)
132+
* Fixed mouse dragging/resizing of views in SubViews (e.g. TabViews)
133133
</PackageReleaseNotes>
134134
</PropertyGroup>
135135
<ItemGroup>
@@ -143,8 +143,6 @@
143143
<ItemGroup>
144144
<PackageReference Include="Basic.Reference.Assemblies.Net70" Version="1.7.7" />
145145
<PackageReference Include="CommandLineParser" Version="2.9.1" />
146-
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" />
147-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
148146
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
149147
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
150148
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.1" />
@@ -153,7 +151,7 @@
153151
<PackageReference Include="Serilog" Version="4.2.0" />
154152
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.0" />
155153
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
156-
<PackageReference Include="Terminal.Gui" Version="2.0.0-develop.4363" />
154+
<PackageReference Include="Terminal.Gui" Version="2.0.0-develop.4372 " />
157155
<PackageReference Include="nlog" Version="5.3.3" />
158156
<PackageReference Include="Basic.Reference.Assemblies.Net80" Version="1.7.7" />
159157
<PackageReference Include="System.CodeDom" Version="8.0.0" />

src/ToCode/ViewToCode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public void GenerateDesignerCs(Design rootDesign, Type viewType)
206206
public void AddSubViewsToDesignerCs(View forView, CodeDomArgs args, CodeExpression? parentViewExpression = null)
207207
{
208208
// order the controls top left to lower right so that tab order is good
209-
foreach (var sub in ViewExtensions.OrderViewsByScreenPosition(forView.Subviews))
209+
foreach (var sub in ViewExtensions.OrderViewsByScreenPosition(forView.SubViews))
210210
{
211211
// If the sub child has a Design (and is not an public part of another control,
212212
// For example ContentView sub-view of Window

src/UI/Editor.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,18 @@ private void ShowViewSpecificOperations()
10661066

10671067
private void ShowHelp()
10681068
{
1069+
if (menuOpen)
1070+
{
1071+
return;
1072+
}
1073+
var menuItem = MenuTracker.Instance.CurrentlyOpenMenuItem;
1074+
1075+
// if we are in a menu
1076+
if (menuItem != null)
1077+
{
1078+
return;
1079+
}
1080+
10691081
ChoicesDialog.Query("Help", this.GetHelp(), "Ok");
10701082
}
10711083

src/UI/Windows/ChoicesDialog.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public ChoicesDialog(string title, string message, params string[] options) {
6363
};
6464
}
6565

66-
buttonPanel.LayoutSubviews();
66+
buttonPanel.LayoutSubViews();
6767

6868
// hide other buttons
6969
for(int i=options.Length;i<buttons.Length;i++)
@@ -77,7 +77,7 @@ public ChoicesDialog(string title, string message, params string[] options) {
7777
int buttonWidth;
7878

7979
// align buttons bottom of dialog
80-
buttonPanel.Width = buttonWidth = buttons.Sum(b=>buttonPanel.Subviews.Contains(b) ? b.Frame.Width : 0) + 1;
80+
buttonPanel.Width = buttonWidth = buttons.Sum(b=>buttonPanel.SubViews.Contains(b) ? b.Frame.Width : 0) + 1;
8181

8282
int maxWidthLine = TextFormatter.GetSumMaxCharWidth(message);
8383
if (maxWidthLine > Application.Driver.Cols)

src/ViewExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ public static class ViewExtensions
2323
/// <param name="v"><see cref="View"/> whose children you want to find.</param>
2424
/// <returns>All <see cref="View"/> that user perceives as within <paramref name="v"/> skipping over
2525
/// any Terminal.Gui artifacts (e.g. ContentView).</returns>
26-
public static IList<View> GetActualSubviews(this View v)
26+
public static IReadOnlyCollection<View> GetActualSubviews(this View v)
2727
{
2828
if (v is TabView t)
2929
{
3030
return t.Tabs.Select(tab => tab.View).Where(v => v != null).ToList();
3131
}
3232

33-
return v.Subviews;
33+
return v.SubViews;
3434
}
3535

3636
/// <summary>
@@ -401,8 +401,8 @@ public static IEnumerable<View> OrderViewsByScreenPosition(IEnumerable<View> vie
401401
}
402402

403403
/// <summary>
404-
/// Returns all subviews that are not Designable. Beware that designs can be nested
405-
/// e.g. calling this on a root view with return subviews that belong to other designed
404+
/// Returns all SubViews that are not Designable. Beware that designs can be nested
405+
/// e.g. calling this on a root view with return SubViews that belong to other designed
406406
/// components that were added to the root designed window.
407407
/// </summary>
408408
/// <param name="view"></param>
@@ -415,7 +415,7 @@ public static IEnumerable<View> GetAllNonDesignableSubviews(this View view)
415415
}
416416
private static void RecursivelyIgnoreAllNonDesignableSubviews(View view, List<View> alsoIgnore)
417417
{
418-
foreach (var sub in view.Subviews)
418+
foreach (var sub in view.SubViews)
419419
{
420420
// If Data is string then it is likely a View that is going to
421421
// end up having a Design but we haven't gotten to it yet (i.e. method is being called mid-load)

0 commit comments

Comments
 (0)