Пример #1
0
        public override void _Ready()
        {
            base._Ready();

            CustomMinimumSize = new Vector2(0, 228) * EditorScale;
            SizeFlagsVertical = (int)SizeFlags.ExpandFill;

            var toolBarHBox = new HBoxContainer {
                SizeFlagsHorizontal = (int)SizeFlags.ExpandFill
            };

            AddChild(toolBarHBox);

            _buildMenuBtn = new MenuButton {
                Text = "Build", Icon = GetThemeIcon("Play", "EditorIcons")
            };
            toolBarHBox.AddChild(_buildMenuBtn);

            var buildMenu = _buildMenuBtn.GetPopup();

            buildMenu.AddItem("Build Solution".TTR(), (int)BuildMenuOptions.BuildSolution);
            buildMenu.AddItem("Rebuild Solution".TTR(), (int)BuildMenuOptions.RebuildSolution);
            buildMenu.AddItem("Clean Solution".TTR(), (int)BuildMenuOptions.CleanSolution);
            buildMenu.IdPressed += BuildMenuOptionPressed;

            _errorsBtn = new Button
            {
                HintTooltip   = "Show Errors".TTR(),
                Icon          = GetThemeIcon("StatusError", "EditorIcons"),
                ExpandIcon    = false,
                ToggleMode    = true,
                ButtonPressed = true,
                FocusMode     = FocusModeEnum.None
            };
            _errorsBtn.Toggled += ErrorsToggled;
            toolBarHBox.AddChild(_errorsBtn);

            _warningsBtn = new Button
            {
                HintTooltip   = "Show Warnings".TTR(),
                Icon          = GetThemeIcon("NodeWarning", "EditorIcons"),
                ExpandIcon    = false,
                ToggleMode    = true,
                ButtonPressed = true,
                FocusMode     = FocusModeEnum.None
            };
            _warningsBtn.Toggled += WarningsToggled;
            toolBarHBox.AddChild(_warningsBtn);

            _viewLogBtn = new Button
            {
                Text          = "Show Output".TTR(),
                ToggleMode    = true,
                ButtonPressed = true,
                FocusMode     = FocusModeEnum.None
            };
            _viewLogBtn.Toggled += ViewLogToggled;
            toolBarHBox.AddChild(_viewLogBtn);

            BuildOutputView = new BuildOutputView();
            AddChild(BuildOutputView);
        }
Пример #2
0
 public static void StopBuild(BuildOutputView buildOutputView) => throw new NotImplementedException();
Пример #3
0
        public override void _Ready()
        {
            base._Ready();

            RectMinSize       = new Vector2(0, 228) * EditorScale;
            SizeFlagsVertical = (int)SizeFlags.ExpandFill;

            var toolBarHBox = new HBoxContainer {
                SizeFlagsHorizontal = (int)SizeFlags.ExpandFill
            };

            AddChild(toolBarHBox);

            var buildMenuBtn = new MenuButton {
                Text = "Build", Icon = GetIcon("Play", "EditorIcons")
            };

            toolBarHBox.AddChild(buildMenuBtn);

            var buildMenu = buildMenuBtn.GetPopup();

            buildMenu.AddItem("Build Solution".TTR(), (int)BuildMenuOptions.BuildSolution);
            buildMenu.AddItem("Rebuild Solution".TTR(), (int)BuildMenuOptions.RebuildSolution);
            buildMenu.AddItem("Clean Solution".TTR(), (int)BuildMenuOptions.CleanSolution);
            buildMenu.Connect("id_pressed", this, nameof(BuildMenuOptionPressed));

            errorsBtn = new Button
            {
                HintTooltip = "Show Errors".TTR(),
                Icon        = GetIcon("StatusError", "EditorIcons"),
                ExpandIcon  = false,
                ToggleMode  = true,
                Pressed     = true,
                FocusMode   = FocusModeEnum.None
            };
            errorsBtn.Connect("toggled", this, nameof(ErrorsToggled));
            toolBarHBox.AddChild(errorsBtn);

            warningsBtn = new Button
            {
                HintTooltip = "Show Warnings".TTR(),
                Icon        = GetIcon("NodeWarning", "EditorIcons"),
                ExpandIcon  = false,
                ToggleMode  = true,
                Pressed     = true,
                FocusMode   = FocusModeEnum.None
            };
            warningsBtn.Connect("toggled", this, nameof(WarningsToggled));
            toolBarHBox.AddChild(warningsBtn);

            viewLogBtn = new Button
            {
                Text       = "Show Output".TTR(),
                ToggleMode = true,
                Pressed    = true,
                FocusMode  = FocusModeEnum.None
            };
            viewLogBtn.Connect("toggled", this, nameof(ViewLogToggled));
            toolBarHBox.AddChild(viewLogBtn);

            BuildOutputView = new BuildOutputView();
            AddChild(BuildOutputView);
        }