From aebeea8bf7519d6f401c291fa3a4e9222b5ce19b Mon Sep 17 00:00:00 2001 From: Konstantin Aleev Date: Tue, 10 Oct 2017 19:33:38 +0300 Subject: [PATCH] RunDashboard: Change content toolbar layout on show/hide configurations --- .../execution/dashboard/RunDashboardContent.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/execution/dashboard/RunDashboardContent.java b/platform/lang-impl/src/com/intellij/execution/dashboard/RunDashboardContent.java index 1cdba9fb2f01..a3c7d0781fb2 100644 --- a/platform/lang-impl/src/com/intellij/execution/dashboard/RunDashboardContent.java +++ b/platform/lang-impl/src/com/intellij/execution/dashboard/RunDashboardContent.java @@ -146,7 +146,7 @@ public class RunDashboardContent extends JPanel implements TreeContent, Disposab } RunnerLayoutUiImpl layoutUiImpl = (RunnerLayoutUiImpl)layoutUi; layoutUiImpl.setLeftToolbarVisible(false); - layoutUiImpl.setContentToolbarBefore(false); + layoutUiImpl.setContentToolbarBefore(!RunDashboardManager.getInstance(myProject).isShowConfigurations()); List leftToolbarActions = layoutUiImpl.getActions(); myContentActions.put(content, leftToolbarActions); updateContentToolbar(content); @@ -397,6 +397,18 @@ public class RunDashboardContent extends JPanel implements TreeContent, Disposab public void updateContent(boolean withStructure) { AppUIUtil.invokeLaterIfProjectAlive(myProject, () -> { boolean showConfigurations = RunDashboardManager.getInstance(myProject).isShowConfigurations(); + + Content selectedContent = myContentManager.getSelectedContent(); + if (selectedContent != null) { + RunContentDescriptor descriptor = RunContentManagerImpl.getRunContentDescriptorByContent(selectedContent); + if (descriptor != null) { + RunnerLayoutUi layoutUi = descriptor.getRunnerLayoutUi(); + if (layoutUi instanceof RunnerLayoutUiImpl) { + ((RunnerLayoutUiImpl)layoutUi).setContentToolbarBefore(!showConfigurations); + } + } + } + if (myTreePanel.isVisible() ^ showConfigurations) { setTreeVisible(showConfigurations);