Skip to content

Commit

Permalink
Navigator: Replace buggy application icon with a cute monitor icon
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadelessFox committed Mar 3, 2024
1 parent 82e75d8 commit c85e235
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ private void configureUI() {
}

UIManager.put("Action.containsIcon", new FlatSVGIcon("icons/actions/contains.svg"));
UIManager.put("Action.monitorActiveIcon", new FlatSVGIcon("icons/actions/monitorActive.svg"));
UIManager.put("Action.monitorInactiveIcon", new FlatSVGIcon("icons/actions/monitorInactive.svg"));
UIManager.put("Action.editIcon", new FlatSVGIcon("icons/actions/edit.svg"));
UIManager.put("Action.editModalIcon", new FlatSVGIcon("icons/actions/edit_modal.svg"));
UIManager.put("Action.exportIcon", new FlatSVGIcon("icons/actions/export.svg"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public void projectUpdated(@NotNull ProjectContainer container) {
final var model = tree.getModel();
final var projectNode = model.getProjectNode(new VoidProgressMonitor(), container);

projectNode.resetIcon();
model.fireNodesChanged(projectNode);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,25 @@
import com.shade.decima.ui.navigator.NavigatorPath;
import com.shade.decima.ui.navigator.NavigatorSettings;
import com.shade.decima.ui.navigator.NavigatorTreeModel;
import com.shade.platform.model.Lazy;
import com.shade.platform.model.runtime.ProgressMonitor;
import com.shade.platform.model.runtime.VoidProgressMonitor;
import com.shade.util.NotNull;
import com.shade.util.Nullable;

import javax.swing.*;
import javax.swing.filechooser.FileSystemView;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class NavigatorProjectNode extends NavigatorNode {
private final ProjectContainer container;
private final Lazy<Icon> icon;
private final NavigatorSettings settings;
private Project project;

public NavigatorProjectNode(@Nullable NavigatorNode parent, @NotNull ProjectContainer container) {
super(parent);
this.container = container;
this.icon = Lazy.of(() -> FileSystemView.getFileSystemView().getSystemIcon(container.getExecutablePath().toFile()));
this.settings = NavigatorSettings.getInstance().getState();
}

Expand Down Expand Up @@ -123,11 +119,7 @@ protected NavigatorNode[] loadChildren(@NotNull ProgressMonitor monitor) throws
@Nullable
@Override
public Icon getIcon() {
return icon.get();
}

public void resetIcon() {
icon.clear();
return UIManager.getIcon(project != null ? "Action.monitorActiveIcon" : "Action.monitorInactiveIcon");
}

@NotNull
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c85e235

Please sign in to comment.