mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
welcome screen: update New Project icons, use General.Add for other places
GitOrigin-RevId: 866d7cfb0926259fd705db426c242bdd3ce4132b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c2c889a630
commit
bb828d33c4
@@ -78,8 +78,7 @@
|
||||
</group>
|
||||
|
||||
<group id="WelcomeScreen.QuickStart.IDEA">
|
||||
<action id="WelcomeScreen.CreateNewProject" class="com.intellij.ide.actions.NewProjectAction"
|
||||
icon="AllIcons.Welcome.CreateNewProject"/>
|
||||
<action id="WelcomeScreen.CreateNewProject" class="com.intellij.ide.actions.NewProjectAction"/>
|
||||
<action id="WelcomeScreen.OpenProject" class="com.intellij.ide.actions.OpenFileAction$OnWelcomeScreen"/>
|
||||
<add-to-group group-id="WelcomeScreen.QuickStart" anchor="first"/>
|
||||
</group>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.ide.actions;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.JavaUiBundle;
|
||||
import com.intellij.ide.impl.NewProjectUtil;
|
||||
import com.intellij.ide.projectWizard.NewProjectWizard;
|
||||
@@ -10,10 +9,8 @@ import com.intellij.lang.java.JavaLanguage;
|
||||
import com.intellij.openapi.actionSystem.ActionPlaces;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.roots.ui.configuration.ModulesProvider;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.wm.impl.welcomeScreen.NewWelcomeScreen;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -26,14 +23,7 @@ public class NewProjectAction extends AnAction implements DumbAware, NewProjectO
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
if (NewWelcomeScreen.isNewWelcomeScreen(e)) {
|
||||
Presentation presentation = e.getPresentation();
|
||||
presentation.setIcon(AllIcons.Welcome.CreateNewProject);
|
||||
if (Registry.is("use.tabbed.welcome.screen")) {
|
||||
presentation.setIcon(AllIcons.Welcome.CreateNewProjectTab);
|
||||
presentation.setSelectedIcon(AllIcons.Welcome.CreateNewProjectTabSelected);
|
||||
}
|
||||
}
|
||||
NewWelcomeScreen.updateNewProjectIconIfWelcomeScreen(e);
|
||||
updateActionText(this, e);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.openapi.wm.IdeFrame;
|
||||
import com.intellij.openapi.wm.impl.welcomeScreen.NewWelcomeScreen;
|
||||
import com.intellij.platform.*;
|
||||
import com.intellij.platform.templates.ArchivedTemplatesFactory;
|
||||
import com.intellij.platform.templates.LocalArchivedTemplate;
|
||||
@@ -61,6 +62,7 @@ public abstract class AbstractNewProjectStep<T> extends DefaultActionGroup imple
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
super.update(e);
|
||||
NewWelcomeScreen.updateNewProjectIconIfWelcomeScreen(e);
|
||||
updateActions();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.intellij.openapi.application.ex.ApplicationInfoEx;
|
||||
import com.intellij.openapi.updateSettings.impl.UpdateChecker;
|
||||
import com.intellij.openapi.util.DimensionService;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.wm.WelcomeScreen;
|
||||
import com.intellij.ui.ScreenUtil;
|
||||
import com.intellij.ui.components.labels.LinkLabel;
|
||||
@@ -136,6 +137,17 @@ public class NewWelcomeScreen extends JPanel implements WelcomeScreen {
|
||||
return e.getPlace() == ActionPlaces.WELCOME_SCREEN;
|
||||
}
|
||||
|
||||
public static void updateNewProjectIconIfWelcomeScreen(@NotNull AnActionEvent e) {
|
||||
if (isNewWelcomeScreen(e)) {
|
||||
Presentation presentation = e.getPresentation();
|
||||
presentation.setIcon(AllIcons.General.Add);
|
||||
if (Registry.is("use.tabbed.welcome.screen")) {
|
||||
presentation.setIcon(AllIcons.Welcome.CreateNewProjectTab);
|
||||
presentation.setSelectedIcon(AllIcons.Welcome.CreateNewProjectTabSelected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final class WelcomeScreenGroup extends DefaultActionGroup {
|
||||
private WelcomeScreenGroup(Icon icon, String text, AnAction... actions) {
|
||||
super(text, true);
|
||||
|
||||
@@ -80,8 +80,7 @@
|
||||
</action>
|
||||
|
||||
<group id="WelcomeScreen.Platform.NewProject">
|
||||
<action id="WelcomeScreen.CreateDirectoryProject" class="com.jetbrains.python.newProject.steps.PyCharmNewProjectStep"
|
||||
icon="AllIcons.Welcome.CreateNewProject"/>
|
||||
<action id="WelcomeScreen.CreateDirectoryProject" class="com.jetbrains.python.newProject.steps.PyCharmNewProjectStep"/>
|
||||
<action id="WelcomeScreen.OpenDirectoryProject" class="com.intellij.ide.actions.OpenFileAction$OnWelcomeScreen"
|
||||
icon="AllIcons.Actions.Menu_open"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user