Exemplo n.º 1
0
            public ProgressBarField()
            {
                Layout = new HBoxLayout {
                    Spacing = 6
                };
                MinMaxHeight = Theme.Metrics.DefaultButtonSize.Y;

                var bar  = new ThemedFrame();
                var rect = new Widget();

                rect.CompoundPresenter.Add(new WidgetFlatFillPresenter(Lime.Theme.Colors.SelectedBorder));
                rect.Tasks.AddLoop(() => {
                    rect.Size = new Vector2(bar.Width * Mathf.Clamp((float)CurrentPosition / MaxPosition, 0, 1), bar.ContentHeight);
                });
                bar.AddNode(rect);

                textFieldA = new ThemedSimpleText {
                    VAlignment = VAlignment.Center,
                    HAlignment = HAlignment.Center,
                };
                textFieldB = new ThemedSimpleText {
                    VAlignment = VAlignment.Center,
                    HAlignment = HAlignment.Center,
                };

                AddNode(bar);
                AddNode(textFieldA);
                AddNode(textFieldB);

                HideAndClear();
            }
Exemplo n.º 2
0
 public ExpandablePropertyEditor(IPropertyEditorParams editorParams) : base(editorParams)
 {
     ExpandableContent = new ThemedFrame {
         Padding = new Thickness(4),
         Layout  = new VBoxLayout(),
         Visible = false
     };
     ExpandButton = new ThemedExpandButton {
         Anchors    = Anchors.Left,
         MinMaxSize = Vector2.One * 20f,
     };
     ExpandButton.Clicked += () => Expanded = !Expanded;
     editorParams.InspectorPane.AddNode(ExpandableContent);
     ContainerWidget.Nodes.Insert(0, ExpandButton);
 }
Exemplo n.º 3
0
 public TabbedWidget()
 {
     Frame = new ThemedFrame {
         Padding    = new Thickness(8),
         LayoutCell = new LayoutCell {
             StretchY = float.MaxValue
         },
         Layout = new StackLayout(),
     };
     TabBar = new ThemedTabBar();
     Layout = new VBoxLayout();
     Nodes.Add(TabBar);
     Nodes.Add(Frame);
     Nodes.Add(new Widget {
         MinHeight = 8
     });
 }