Exemple #1
0
        public Inspector(Widget panelWidget)
        {
            PanelWidget = panelWidget;
            RootWidget  = new Widget {
                Layout = new VBoxLayout()
            };
            var toolbarArea = new Widget {
                Layout = new StackLayout(), Padding = new Thickness(4, 0)
            };

            contentWidget = new ThemedScrollView();
            RootWidget.AddNode(toolbarArea);
            RootWidget.AddNode(contentWidget);
            RootWidget.Gestures.Add(DropFilesGesture = new DropFilesGesture());
            contentWidget.Content.Layout             = new VBoxLayout();
            Toolbar = new ToolbarView(toolbarArea, GetToolbarLayout());
            Objects = new List <object>();
            content = new InspectorContent(contentWidget.Content)
            {
                Footer = new Widget {
                    MinHeight = 300.0f
                },
                History = Document.Current.History
            };
            DropFilesGesture.Recognized += content.DropFiles;
            CreateWatchersToRebuild();
            OnCreate?.Invoke(this);
        }
Exemple #2
0
        private IEnumerator <object> UpdateScrollPositionOnNextUpdate()
        {
            var nodes = Document.Current.InspectRootNode
                                ? new[] { Document.Current.RootNode }
                                : Document.Current.SelectedNodes().ToArray();

            var types    = new HashSet <Type>(InspectorContent.GetTypes(nodes));
            var areEqual = types.SetEquals(prevTypes);

            contentWidget.ScrollPosition = areEqual ?
                                           Math.Min(contentWidget.MaxScrollPosition, contentWidget.ScrollPosition) : contentWidget.MinScrollPosition;
            prevTypes = types;
            yield break;
        }
Exemple #3
0
        public Inspector(Widget panelWidget)
        {
            PanelWidget = panelWidget;
            RootWidget  = new ThemedScrollView();
            var toolbarArea = new Widget {
                Layout = new StackLayout(), Padding = new Thickness(4, 0)
            };

            contentWidget = new Widget();
            RootWidget.Content.AddNode(toolbarArea);
            RootWidget.Content.AddNode(contentWidget);
            RootWidget.Content.Layout = new VBoxLayout();
            Toolbar = new Toolbar(toolbarArea);
            contentWidget.Layout = new VBoxLayout {
                Tag = "InspectorContent"
            };
            Objects = new List <object>();
            content = new InspectorContent(contentWidget);
            CreateWatchersToRebuild();
            SetupToolbar();
        }
Exemple #4
0
        public Inspector(Widget panelWidget)
        {
            PanelWidget = panelWidget;
            RootWidget  = new ThemedScrollView();
            var toolbarArea = new Widget {
                Layout = new StackLayout(), Padding = new Thickness(4, 0)
            };

            contentWidget = new Widget();
            RootWidget.Content.AddNode(toolbarArea);
            RootWidget.Content.AddNode(contentWidget);
            RootWidget.Content.Layout = new VBoxLayout();
            Toolbar = new ToolbarView(toolbarArea, GetToolbarLayout());
            contentWidget.Layout = new VBoxLayout();
            Objects = new List <object>();
            content = new InspectorContent(contentWidget)
            {
                Footer = new Widget {
                    MinHeight = 300.0f
                },
                History = Document.Current.History
            };
            CreateWatchersToRebuild();
        }