Пример #1
0
        // Component with user preferences should be added to rootWidget at this moment
        public void Initialize()
        {
            var up = RootWidget.Components.Get <ViewNodeComponent>().ViewNode as FSViewNode;

            toolbar = new FilesystemToolbar(this);
            toolbar.TabTravesable = new TabTraversable();
            model = new Model(up.Path);
            InitializeWidgets();
            selectionPreviewSplitter.Stretches = Splitter.GetStretchesList(up.SelectionPreviewSplitterStretches, 1, 1);
            cookingRulesSplitter.Stretches     = Splitter.GetStretchesList(up.CookingRulesSplitterStretches, 1, 1);
            toggleCookingRules = new NodeToggler(crEditor.RootWidget, () => { crEditor.Invalidate(selection); });
            togglePreview      = new NodeToggler(preview.RootWidget, () => { preview.Invalidate(selection); });
            if (!up.ShowCookingRulesEditor)
            {
                toggleCookingRules.Toggle();
            }
            if (!up.ShowSelectionPreview)
            {
                togglePreview.Toggle();
            }
            foreach (var n in RootWidget.Descendants)
            {
                var w = n.AsWidget;
                if (w.TabTravesable != null)
                {
                    w.HitTestTarget = true;
                }
            }
        }
Пример #2
0
        // Component with user preferences should be added to rootWidget at this moment
        public void Initialize()
        {
            var up = RootWidget.Components.Get <ViewNodeComponent>().ViewNode as FSViewNode;

            model   = new Model(up.Path);
            toolbar = new FilesystemToolbar(this, model);
            toolbar.TabTravesable = new TabTraversable();
            InitializeWidgets();
            selectionPreviewSplitter.Stretches = Splitter.GetStretchesList(up.SelectionPreviewSplitterStretches, 1, 1);
            cookingRulesSplitter.Stretches     = Splitter.GetStretchesList(up.CookingRulesSplitterStretches, 1, 1);
            toggleCookingRules = new NodeToggler(crEditor.RootWidget, () => { crEditor.Invalidate(selection); });
            togglePreview      = new NodeToggler(preview.RootWidget, () => { preview.Invalidate(selection); });
            if (!up.ShowCookingRulesEditor)
            {
                toggleCookingRules.Toggle();
            }
            if (!up.ShowSelectionPreview)
            {
                togglePreview.Toggle();
            }
            foreach (var n in RootWidget.Descendants)
            {
                var w = n.AsWidget;
                if (w.TabTravesable != null)
                {
                    w.HitTestTarget = true;
                }
            }
            RootWidget.Updating += (float delta) => {
                if (
                    RootWidget.Input.IsKeyPressed(Key.Control) &&
                    RootWidget.Input.WasKeyReleased(Key.L)
                    )
                {
                    toolbar.AddressBar.SetFocusOnEditor();
                }
            };
        }