@@ -14,6 +14,7 @@ internal static class NodeTypesBuilder
14
14
{
15
15
private static readonly List < Type [ ] > defaultNodeTypeGroupList = new List < Type [ ] > ( ) ;
16
16
private static readonly Dictionary < Plugin , IReadOnlyList < Type > > pluginNodeTypes = new Dictionary < Plugin , IReadOnlyList < Type > > ( ) ;
17
+ private static readonly HashSet < Type > nodeTypesWhichCanOverflowInToolbar ;
17
18
18
19
static NodeTypesBuilder ( )
19
20
{
@@ -27,6 +28,9 @@ static NodeTypesBuilder()
27
28
defaultNodeTypeGroupList . Add ( new [ ] { typeof ( PointerNode ) , typeof ( ArrayNode ) , typeof ( UnionNode ) } ) ;
28
29
defaultNodeTypeGroupList . Add ( new [ ] { typeof ( ClassInstanceNode ) } ) ;
29
30
defaultNodeTypeGroupList . Add ( new [ ] { typeof ( VirtualMethodTableNode ) , typeof ( FunctionNode ) , typeof ( FunctionPtrNode ) } ) ;
31
+
32
+ // define the node types which can overflow in the toolbar if the window is too narrow. Add types here which aren't used that much
33
+ nodeTypesWhichCanOverflowInToolbar = new HashSet < Type > { typeof ( NIntNode ) , typeof ( NUIntNode ) , typeof ( BitFieldNode ) , typeof ( Utf16TextNode ) , typeof ( Utf16TextPtrNode ) } ;
30
34
}
31
35
32
36
public static void AddPluginNodeGroup ( Plugin plugin , IReadOnlyList < Type > nodeTypes )
@@ -66,6 +70,7 @@ public static IEnumerable<ToolStripItem> CreateToolStripButtons(Action<Type> han
66
70
DisplayStyle = ToolStripItemDisplayStyle . Image ,
67
71
Image = icon ,
68
72
ShortcutKeys = shortcutKeys ,
73
+ Overflow = nodeTypesWhichCanOverflowInToolbar . Contains ( t ) ? ToolStripItemOverflow . AsNeeded : ToolStripItemOverflow . Never ,
69
74
} ;
70
75
item . Click += clickHandler ;
71
76
return item ;
0 commit comments