Skip to content

Commit 42236d7

Browse files
committed
Fix various issues
- View and other types are missing from Add - Borders do not show because sometimes style is set but Thickness is 0 - Start work on keybindings dialog
1 parent 53b3965 commit 42236d7

6 files changed

+121
-6
lines changed

src/Design.cs

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public class Design
3838
typeof(TabView),
3939
typeof(Window),
4040
typeof(Toplevel),
41-
typeof(View),
4241
typeof(GraphView),
4342
typeof(HexView),
4443
typeof(LineView),

src/UI/Editor.cs

+10-1
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ private void BuildRootMenu()
769769
$"{this.keyMap.ShowHelp} - Show Help",
770770
$"{this.keyMap.New} - New Window/Class",
771771
$"{this.keyMap.Open} - Open a .Designer.cs file",
772+
$"Keybindings",
772773
};
773774

774775
// center all the commands
@@ -783,7 +784,7 @@ private void BuildRootMenu()
783784
X = Pos.Center(),
784785
Y = Pos.Percent(75),
785786
Width = maxWidth,
786-
Height = 3,
787+
Height = 4,
787788
ColorScheme = new ColorScheme
788789
(
789790
new Attribute(new Color(Color.White),new Color(Color.Black)),
@@ -813,6 +814,9 @@ private void BuildRootMenu()
813814
case 2:
814815
this.Open();
815816
break;
817+
case 3:
818+
this.ChangeKeybindings();
819+
break;
816820
}
817821
}
818822

@@ -836,6 +840,11 @@ private void BuildRootMenu()
836840
this.Add(this.rootCommandsListView);
837841
}
838842

843+
private void ChangeKeybindings()
844+
{
845+
//new keybi
846+
}
847+
839848
private void Editor_Closing(object? sender, ToplevelClosingEventArgs obj)
840849
{
841850
if (this.viewBeingEdited == null)

src/UI/Windows/KeyBindingsUI.Designer.cs

+83
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/UI/Windows/KeyBindingsUI.cs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
//------------------------------------------------------------------------------
3+
4+
// <auto-generated>
5+
// This code was generated by:
6+
// TerminalGuiDesigner v2.0.0.0
7+
// You can make changes to this file and they will not be overwritten when saving.
8+
// </auto-generated>
9+
// -----------------------------------------------------------------------------
10+
namespace TerminalGuiDesigner.UI.Windows {
11+
using Terminal.Gui;
12+
13+
14+
public partial class KeyBindingsUI {
15+
16+
public KeyBindingsUI() {
17+
InitializeComponent();
18+
}
19+
}
20+
}

src/ViewExtensions.cs

+4
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ private static bool HasNoBorderProperty(this View v)
435435
return true;
436436
}
437437

438+
if (v.Border.Thickness is { Top: 0, Left: 0, Right: 0, Bottom: 0 })
439+
{
440+
return true;}
441+
438442
return false;
439443
}
440444

src/ViewFactory.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ internal static MenuBarItem[] DefaultMenuBarItems
9292
IsPublic: true,
9393
IsValueType: false
9494
})
95-
.Where(filteredType => filteredType.IsSubclassOf(typeof(View)) && filteredType != typeof(Adornment)
96-
&& !filteredType.IsSubclassOf(typeof(Adornment)))
97-
.Where(viewDescendantType => !KnownUnsupportedTypes.Any(viewDescendantType.IsAssignableTo)
98-
|| viewDescendantType == typeof(Window))
95+
.Where(filteredType => filteredType == typeof(View) || filteredType.IsSubclassOf(typeof(View))
96+
&& filteredType != typeof(Adornment)
97+
&& !filteredType.IsSubclassOf(typeof(Adornment)))
98+
.Except(KnownUnsupportedTypes)
9999
// Slider is an alias of Slider<object> so don't offer that
100100
.Where(vt => vt != typeof(Slider));
101101

0 commit comments

Comments
 (0)