11---
22name : editor-ui
3- description : JEngine Editor UI component library with theming. Triggers on: custom inspector, editor window, Unity editor UI, UIElements, VisualElement, JButton, JStack, JCard, JTextField, JDropdown, design tokens, dark theme, light theme, editor styling, themed button, form layout, progress bar, status bar, toggle button, button group
3+ description : JEngine Editor UI component library with theming. Triggers on: custom inspector, editor window, Unity editor UI, UIElements, VisualElement, JButton, JStack, JCard, JTextField, JDropdown, JTabView, tab view, tabbed container, design tokens, dark theme, light theme, editor styling, themed button, form layout, progress bar, status bar, toggle button, button group
44---
55
66# JEngine Editor UI Components
@@ -241,6 +241,28 @@ bc.SetPath("New", "Path");
241241bc .Clear ();
242242```
243243
244+ ### JTabView - Tabbed Container
245+ ``` csharp
246+ // Basic tab view
247+ var tabs = new JTabView ()
248+ .AddTab (" General" , generalContent )
249+ .AddTab (" Advanced" , advancedContent )
250+ .AddTab (" Debug" , debugContent );
251+
252+ // Responsive: max 3 tabs per row before wrapping
253+ var responsiveTabs = new JTabView (maxTabsPerRow : 3 )
254+ .AddTab (" Tab 1" , content1 )
255+ .AddTab (" Tab 2" , content2 );
256+
257+ // Programmatic selection (zero-based index: 0=General, 1=Advanced, 2=Debug)
258+ tabs .SelectTab (2 ); // Select "Debug" tab
259+
260+ // Read state
261+ int selected = tabs .SelectedIndex ; // -1 if no tabs
262+ int count = tabs .TabCount ;
263+ int maxPerRow = tabs .MaxTabsPerRow ;
264+ ```
265+
244266## Design Tokens
245267
246268The ` Tokens ` class provides named constants that adapt to Unity's dark/light theme.
@@ -365,7 +387,7 @@ enum AlignItems { Start, Center, End, Stretch }
365387
366388## Game Development Examples
367389
368- ### Settings Panel
390+ ### Settings Panel (with Tabs)
369391``` csharp
370392public class GameSettingsWindow : EditorWindow
371393{
@@ -384,8 +406,8 @@ public class GameSettingsWindow : EditorWindow
384406 root .style .paddingBottom = Tokens .Spacing .Lg ;
385407 root .style .paddingLeft = Tokens .Spacing .Lg ;
386408
387- // Graphics Section
388- var graphics = new JSection ( " Graphics " )
409+ // Graphics tab content
410+ var graphics = new JStack ( GapSize . MD )
389411 .Add (
390412 new JFormField (" VSync" , _vsyncToggle = new JToggle (true )),
391413 new JFormField (" Target FPS" , _fpsDropdown = new JDropdown <int >(
@@ -394,17 +416,22 @@ public class GameSettingsWindow : EditorWindow
394416 formatSelectedValue : static fps => fps == - 1 ? " Unlimited" : $" {fps } FPS" ,
395417 formatListItem : static fps => fps == - 1 ? " Unlimited" : $" {fps } FPS" )));
396418
397- // Audio Section
398- var audio = new JSection ( " Audio " )
419+ // Audio tab content
420+ var audio = new JStack ( GapSize . MD )
399421 .Add (new JFormField (" Master Volume" , _volumeSlider = new JProgressBar (0 . 8 f )
400422 .WithHeight (20 )));
401423
424+ // Tabbed settings
425+ var tabs = new JTabView ()
426+ .AddTab (" Graphics" , graphics )
427+ .AddTab (" Audio" , audio );
428+
402429 // Actions
403430 var actions = new JButtonGroup (
404431 new JButton (" Apply" , ApplySettings , ButtonVariant .Primary ),
405432 new JButton (" Reset" , ResetSettings , ButtonVariant .Secondary ));
406433
407- root .Add (graphics , audio , actions );
434+ root .Add (tabs , actions );
408435 rootVisualElement .Add (root );
409436 }
410437}
0 commit comments