From 7f87ee264d44f61905170cb9fbecf90ff3a2b14a Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Tue, 28 Oct 2014 17:34:38 +0300 Subject: [PATCH 1/6] IDEA-130032 Compare with screen smooshes commit messages. * font size is a little bigger on windows 8.1 and several others OS; * titled border may disappear if there is no enough space --- .../CompareWithSelectedRevisionAction.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CompareWithSelectedRevisionAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CompareWithSelectedRevisionAction.java index 2fb5b60e0d39..a4acd1d4864b 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CompareWithSelectedRevisionAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/CompareWithSelectedRevisionAction.java @@ -28,10 +28,7 @@ import com.intellij.openapi.vcs.diff.DiffProvider; import com.intellij.openapi.vcs.history.*; import com.intellij.openapi.vcs.impl.VcsBackgroundableActions; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.ui.IdeBorderFactory; -import com.intellij.ui.ScrollPaneFactory; -import com.intellij.ui.SpeedSearchBase; -import com.intellij.ui.TableUtil; +import com.intellij.ui.*; import com.intellij.ui.dualView.TreeTableView; import com.intellij.ui.table.TableView; import com.intellij.ui.treeStructure.treetable.ListTreeTableModelOnColumns; @@ -322,10 +319,12 @@ public class CompareWithSelectedRevisionAction extends AbstractVcsAction { JPanel jPanel = new JPanel(new BorderLayout()); final JScrollPane textScrollPane = ScrollPaneFactory.createScrollPane(textArea); - textScrollPane.setBorder(IdeBorderFactory.createTitledBorder(VcsBundle.message("border.selected.revision.commit.message"), false - )); - jPanel.add(textScrollPane, BorderLayout.SOUTH); - + // text on title border has some problems if text font size is bigger than expected. + final JLabel commentLabel = new JLabel(VcsBundle.message("border.selected.revision.commit.message")); + jPanel.add(commentLabel, BorderLayout.NORTH); + commentLabel.setBorder(IdeBorderFactory.createBorder(SideBorder.TOP | SideBorder.LEFT | SideBorder.BOTTOM)); + textScrollPane.setBorder(null); + jPanel.add(textScrollPane, BorderLayout.CENTER); jPanel.setPreferredSize(new Dimension(300, 100)); return jPanel; } From 4b8c4cea5199d54ee47add88743d011ffdb93531 Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Tue, 28 Oct 2014 17:38:47 +0300 Subject: [PATCH 2/6] UI: one simple way to control toolwindow toolbars visibility 3 --- .../openapi/vcs/impl/ProjectLevelVcsManagerImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java index 45f550271825..6886dd5098d8 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java @@ -16,6 +16,7 @@ package com.intellij.openapi.vcs.impl; import com.intellij.icons.AllIcons; +import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.components.ProjectComponent; @@ -33,6 +34,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ex.ProjectEx; import com.intellij.openapi.roots.FileIndexFacade; import com.intellij.openapi.startup.StartupManager; +import com.intellij.openapi.ui.SimpleToolWindowPanel; import com.intellij.openapi.util.*; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.registry.Registry; @@ -57,6 +59,7 @@ import com.intellij.openapi.wm.ToolWindow; import com.intellij.openapi.wm.ToolWindowAnchor; import com.intellij.openapi.wm.ToolWindowId; import com.intellij.openapi.wm.ToolWindowManager; +import com.intellij.openapi.wm.ex.ToolWindowEx; import com.intellij.ui.content.Content; import com.intellij.ui.content.ContentFactory; import com.intellij.ui.content.ContentManager; @@ -238,6 +241,9 @@ public class ProjectLevelVcsManagerImpl extends ProjectLevelVcsManagerEx impleme toolWindowManager.registerToolWindow(ToolWindowId.VCS, true, ToolWindowAnchor.BOTTOM, myProject, true); myContentManager = toolWindow.getContentManager(); toolWindow.setIcon(AllIcons.Toolwindows.VcsSmallTab); + DefaultActionGroup gearActions = new DefaultActionGroup(); + gearActions.addAction(SimpleToolWindowPanel.createToggleToolbarAction(myProject, toolWindow)).setAsSecondary(true); + ((ToolWindowEx)toolWindow).setAdditionalGearActions(gearActions); toolWindow.installWatcher(myContentManager); } else { From afe016bf6f43425c29aebd02a8f07cc09fdb63a3 Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Tue, 28 Oct 2014 17:39:54 +0300 Subject: [PATCH 3/6] DFM: use editor scheme foreground color for progress messages --- .../wm/impl/status/InfoAndProgressPanel.java | 2 +- .../impl/status/PresentationModeProgressPanel.java | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java index 386eae1ef478..0aa196baedef 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java @@ -388,7 +388,7 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge final Component anchor = getAnchor(pane); - JBPopupFactory.getInstance().createBalloonBuilder(panel.getRootPanel()) + JBPopupFactory.getInstance().createBalloonBuilder(panel.getProgressPanel()) .setFadeoutTime(0) .setFillColor(Gray.TRANSPARENT) .setShowCallout(false) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.java index 9f82a2f60cdf..f62910ffd556 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.java @@ -16,6 +16,7 @@ package com.intellij.openapi.wm.impl.status; import com.intellij.icons.AllIcons; +import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.ui.popup.IconButton; import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.InplaceButton; @@ -48,6 +49,7 @@ public class PresentationModeProgressPanel { myText.setIcon(EmptyIcon.create(1, 16)); myText2.setIcon(EmptyIcon.create(1, 16)); } + public void update() { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override @@ -57,7 +59,15 @@ public class PresentationModeProgressPanel { }); } + @NotNull + public Color getTextForeground() { + return EditorColorsManager.getInstance().getGlobalScheme().getDefaultForeground(); + } + private void updateImpl() { + myText.setForeground(getTextForeground()); + myText2.setForeground(getTextForeground()); + if (!StringUtil.equals(myText.getText(), myProgress.getText())) { myText.setText(myProgress.getText()); } @@ -74,7 +84,8 @@ public class PresentationModeProgressPanel { } } - public JPanel getRootPanel() { + @NotNull + public JComponent getProgressPanel() { return myRootPanel; } From bf123d7252eb6fa619352c1faba66a46be306536 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Tue, 28 Oct 2014 15:39:23 +0100 Subject: [PATCH 4/6] enabling process pre-load optimization by default --- platform/util/resources/misc/registry.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index d9f47ad0209a..405bd3383775 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -198,7 +198,7 @@ compiler.process.use.memory.temp.cache=true compiler.process.use.memory.temp.cache.description=Store temporary data in memory for faster compilation;\ requires larger heap size for the build process. If parallel build is enabled, the option is ignored and temp data is always stored in memory. -compiler.process.preload=false +compiler.process.preload=true compiler.process.preload.description=After build finishes, the IDE will pre-load and leave waiting in memory the build process for the next compilation. This will save time for process start and project model loading (may be noticeable for big projects).\ compiler.process.debug.port=-1 From da577a31736273a7a905f3f170a709221336ef3e Mon Sep 17 00:00:00 2001 From: Yaroslav Lepenkin Date: Tue, 28 Oct 2014 17:56:47 +0400 Subject: [PATCH 5/6] Enable "Only VCS change checkbox" if file has only deletion changes (IDEA-131975). It will allow to optimize imports through "reformat code dialog" on file having only deletion changes with no reformatting (Previously checkbox was disabled and optimize imports can only be used with whole file reformatting) --- .../actions/FormatChangedTextUtil.java | 10 +--------- .../ReformatOnlyVcsChangedTextTest.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java index dadafc7a7d84..72fe48a46e42 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/FormatChangedTextUtil.java @@ -86,15 +86,7 @@ public class FormatChangedTextUtil { return false; } final List ranges = lineStatusTracker.getRanges(); - if (ranges == null || ranges.isEmpty()) { - return false; - } - for (Range range : ranges) { - if (range.getType() != Range.DELETED) { - return true; - } - } - return false; + return !ranges.isEmpty(); } /** diff --git a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java index d66988ab2ef5..4b7ac648fd95 100644 --- a/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java +++ b/platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatOnlyVcsChangedTextTest.java @@ -141,6 +141,24 @@ public class ReformatOnlyVcsChangedTextTest extends LightPlatformTestCase { ); } + public void testNoReformatOn_DeletionModification() throws IOException { + doTest( + "public class B {\n" + + " int a = 3;\n" + + " String text;\n" + + " Object last = null;\n" + + " Object first = null;\n" + + " Object second = null;\n" + + "}", + + "public class B {\n" + + " int a = 3;\n" + + " String text;\n" + + " Object last = null;\n" + + "}" + ); + } + public void testModification() throws IOException { doTest( "public class B {\n" + From 3b35b879ecb9ba18ecf12032f56f11969627b400 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Tue, 28 Oct 2014 16:04:23 +0100 Subject: [PATCH 6/6] IDEA-129887 Welcome screen redesign --- .../wm/impl/welcomeScreen/FlatWelcomeFrame.java | 10 +++++----- .../wm/impl/welcomeScreen/NewRecentProjectPanel.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/FlatWelcomeFrame.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/FlatWelcomeFrame.java index b93a024a1660..72f9fbf05459 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/FlatWelcomeFrame.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/FlatWelcomeFrame.java @@ -283,7 +283,7 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame { panel.add(toolbar, BorderLayout.EAST); - panel.setBorder(new EmptyBorder(0,0,8,21)); + panel.setBorder(new EmptyBorder(0,0,8,11)); return panel; } @@ -302,7 +302,7 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame { ref.get().setPaintUnderline(false); ref.get().setNormalColor(getLinkNormalColor()); NonOpaquePanel panel = new NonOpaquePanel(new BorderLayout()); - panel.setBorder(new EmptyBorder(4, 10, 4, 10)); + panel.setBorder(new EmptyBorder(4, 6, 4, 6)); panel.add(ref.get()); panel.add(createArrow(ref.get()), BorderLayout.EAST); installFocusable(panel, action, KeyEvent.VK_UP, KeyEvent.VK_DOWN, focusListOnLeft); @@ -346,7 +346,6 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame { } } - actions.setBorder(new EmptyBorder(0, 0, 0, 0)); WelcomeScreenActionsPanel panel = new WelcomeScreenActionsPanel(); panel.actions.add(actions); return panel.root; @@ -366,6 +365,7 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame { NonOpaquePanel panel = new NonOpaquePanel(new BorderLayout()); ApplicationInfoEx app = ApplicationInfoEx.getInstanceEx(); JLabel logo = new JLabel(IconLoader.getIcon(app.getWelcomeScreenLogoUrl())); + logo.setBorder(new EmptyBorder(30,0,10,0)); logo.setHorizontalAlignment(SwingConstants.CENTER); panel.add(logo, BorderLayout.NORTH); JLabel appName = new JLabel(ApplicationNamesInfo.getInstance().getFullProductName()); @@ -380,13 +380,13 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame { } JLabel version = new JLabel(appVersion); - version.setFont(font.deriveFont(16f).deriveFont(Font.PLAIN)); + version.setFont(getProductFont().deriveFont(16f)); version.setHorizontalAlignment(SwingConstants.CENTER); version.setForeground(Gray._128); panel.add(appName); panel.add(version, BorderLayout.SOUTH); - panel.setBorder(new EmptyBorder(20, 10, 30, 10)); + panel.setBorder(new EmptyBorder(0, 0, 20, 0)); return panel; } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/NewRecentProjectPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/NewRecentProjectPanel.java index fb1fc55c32ae..827c9ba5d1ab 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/NewRecentProjectPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/NewRecentProjectPanel.java @@ -98,8 +98,8 @@ public class NewRecentProjectPanel extends RecentProjectPanel { @Override protected void layoutComponents() { setLayout(new BorderLayout()); - myName.setBorder(new EmptyBorder(6, 5, 1, 5)); - myPath.setBorder(new EmptyBorder(1, 5, 6, 5)); + myName.setBorder(new EmptyBorder(6, 0, 1, 5)); + myPath.setBorder(new EmptyBorder(1, 0, 6, 5)); add(myName, BorderLayout.NORTH); add(myPath, BorderLayout.SOUTH); }