Skip to content

Commit

Permalink
Application: Update icons and theme; upgrade to FlatLaf 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadelessFox committed Mar 14, 2024
1 parent f264efe commit 5c9ebc3
Show file tree
Hide file tree
Showing 81 changed files with 501 additions and 290 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,60 +337,68 @@ private void configureUI() {
log.error("Failed to setup look and feel '" + settings.themeClassName + "'l: " + e);
}

UIManager.put("Action.addElementIcon", new FlatSVGIcon("icons/actions/add_element.svg"));
UIManager.put("Action.closeAllIcon", new FlatSVGIcon("icons/actions/tab_close_all.svg"));
UIManager.put("Action.closeIcon", new FlatSVGIcon("icons/actions/tab_close.svg"));
UIManager.put("Action.closeOthersIcon", new FlatSVGIcon("icons/actions/tab_close_others.svg"));
UIManager.put("Action.closeUninitializedIcon", new FlatSVGIcon("icons/actions/tab_close_uninitialized.svg"));
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.duplicateElementIcon", new FlatSVGIcon("icons/actions/duplicate_element.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"));
UIManager.put("Action.hideIcon", new FlatSVGIcon("icons/actions/hide.svg"));
UIManager.put("Action.importIcon", new FlatSVGIcon("icons/actions/import.svg"));
UIManager.put("Action.navigateIcon", new FlatSVGIcon("icons/actions/navigate.svg"));
UIManager.put("Action.nextIcon", new FlatSVGIcon("icons/actions/next.svg"));
UIManager.put("Action.normalsIcon", new FlatSVGIcon("icons/actions/normals.svg"));
UIManager.put("Action.nullTerminatorIcon", new FlatSVGIcon("icons/actions/null_terminator.svg"));
UIManager.put("Action.outlineIcon", new FlatSVGIcon("icons/actions/outline.svg"));
UIManager.put("Action.packIcon", new FlatSVGIcon("icons/actions/pack.svg"));
UIManager.put("Action.undoIcon", new FlatSVGIcon("icons/actions/undo.svg"));
UIManager.put("Action.pauseIcon", new FlatSVGIcon("icons/actions/pause.svg"));
UIManager.put("Action.playIcon", new FlatSVGIcon("icons/actions/play.svg"));
UIManager.put("Action.previousIcon", new FlatSVGIcon("icons/actions/previous.svg"));
UIManager.put("Action.redoIcon", new FlatSVGIcon("icons/actions/redo.svg"));
UIManager.put("Action.removeElementIcon", new FlatSVGIcon("icons/actions/remove_element.svg"));
UIManager.put("Action.saveIcon", new FlatSVGIcon("icons/actions/save.svg"));
UIManager.put("Action.searchIcon", new FlatSVGIcon("icons/actions/search.svg"));
UIManager.put("Action.closeIcon", new FlatSVGIcon("icons/actions/tab_close.svg"));
UIManager.put("Action.closeAllIcon", new FlatSVGIcon("icons/actions/tab_close_all.svg"));
UIManager.put("Action.closeOthersIcon", new FlatSVGIcon("icons/actions/tab_close_others.svg"));
UIManager.put("Action.closeUninitializedIcon", new FlatSVGIcon("icons/actions/tab_close_uninitialized.svg"));
UIManager.put("Action.splitRightIcon", new FlatSVGIcon("icons/actions/split_right.svg"));
UIManager.put("Action.shadingIcon", new FlatSVGIcon("icons/actions/shading.svg"));
UIManager.put("Action.splitDownIcon", new FlatSVGIcon("icons/actions/split_down.svg"));
UIManager.put("Action.splitRightIcon", new FlatSVGIcon("icons/actions/split_right.svg"));
UIManager.put("Action.starIcon", new FlatSVGIcon("icons/actions/star.svg"));
UIManager.put("Action.undoIcon", new FlatSVGIcon("icons/actions/undo.svg"));
UIManager.put("Action.wireframeIcon", new FlatSVGIcon("icons/actions/wireframe.svg"));
UIManager.put("Action.zoomFitIcon", new FlatSVGIcon("icons/actions/zoom_fit.svg"));
UIManager.put("Action.zoomInIcon", new FlatSVGIcon("icons/actions/zoom_in.svg"));
UIManager.put("Action.zoomOutIcon", new FlatSVGIcon("icons/actions/zoom_out.svg"));
UIManager.put("Action.zoomFitIcon", new FlatSVGIcon("icons/actions/zoom_fit.svg"));
UIManager.put("Action.addElementIcon", new FlatSVGIcon("icons/actions/add_element.svg"));
UIManager.put("Action.removeElementIcon", new FlatSVGIcon("icons/actions/remove_element.svg"));
UIManager.put("Action.duplicateElementIcon", new FlatSVGIcon("icons/actions/duplicate_element.svg"));
UIManager.put("Action.normalsIcon", new FlatSVGIcon("icons/actions/normals.svg"));
UIManager.put("Action.shadingIcon", new FlatSVGIcon("icons/actions/shading.svg"));
UIManager.put("Action.wireframeIcon", new FlatSVGIcon("icons/actions/wireframe.svg"));
UIManager.put("Action.navigateIcon", new FlatSVGIcon("icons/actions/navigate.svg"));
UIManager.put("Action.outlineIcon", new FlatSVGIcon("icons/actions/outline.svg"));
UIManager.put("Action.nullTerminatorIcon", new FlatSVGIcon("icons/actions/null_terminator.svg"));

UIManager.put("Editor.binaryIcon", new FlatSVGIcon("icons/editors/binary.svg"));
UIManager.put("Editor.coreIcon", new FlatSVGIcon("icons/editors/core.svg"));

UIManager.put("File.binaryIcon", new FlatSVGIcon("icons/files/binary.svg"));
UIManager.put("File.coreIcon", new FlatSVGIcon("icons/files/core.svg"));
UIManager.put("Node.archiveIcon", new FlatSVGIcon("icons/nodes/archive.svg"));
UIManager.put("Node.enumIcon", new FlatSVGIcon("icons/nodes/enum.svg"));
UIManager.put("Node.uuidIcon", new FlatSVGIcon("icons/nodes/uuid.svg"));
UIManager.put("Node.arrayIcon", new FlatSVGIcon("icons/nodes/array.svg"));
UIManager.put("Node.objectIcon", new FlatSVGIcon("icons/nodes/object.svg"));
UIManager.put("Node.referenceIcon", new FlatSVGIcon("icons/nodes/reference.svg"));
UIManager.put("Node.booleanIcon", new FlatSVGIcon("icons/nodes/boolean.svg"));
UIManager.put("Node.decimalIcon", new FlatSVGIcon("icons/nodes/decimal.svg"));
UIManager.put("Node.enumIcon", new FlatSVGIcon("icons/nodes/enum.svg"));
UIManager.put("Node.integerIcon", new FlatSVGIcon("icons/nodes/integer.svg"));
UIManager.put("Node.modelIcon", new FlatSVGIcon("icons/nodes/model.svg"));
UIManager.put("Node.monitorActiveIcon", new FlatSVGIcon("icons/nodes/monitorActive.svg"));
UIManager.put("Node.monitorInactiveIcon", new FlatSVGIcon("icons/nodes/monitorInactive.svg"));
UIManager.put("Node.objectIcon", new FlatSVGIcon("icons/nodes/object.svg"));
UIManager.put("Node.referenceIcon", new FlatSVGIcon("icons/nodes/reference.svg"));
UIManager.put("Node.stringIcon", new FlatSVGIcon("icons/nodes/string.svg"));
UIManager.put("Node.booleanIcon", new FlatSVGIcon("icons/nodes/boolean.svg"));

UIManager.put("Node.textureIcon", new FlatSVGIcon("icons/nodes/texture.svg"));
UIManager.put("Node.uuidIcon", new FlatSVGIcon("icons/nodes/uuid.svg"));
UIManager.put("Overlay.addIcon", new FlatSVGIcon("icons/overlays/add.svg"));
UIManager.put("Overlay.modifyIcon", new FlatSVGIcon("icons/overlays/modify.svg"));

UIManager.put("Toolbar.hideIcon", new FlatSVGIcon("icons/toolbars/hide.svg"));
UIManager.put("Toolbar.pauseIcon", new FlatSVGIcon("icons/toolbars/pause.svg"));
UIManager.put("Toolbar.playIcon", new FlatSVGIcon("icons/toolbars/play.svg"));
UIManager.put("Toolbar.previousIcon", new FlatSVGIcon("icons/toolbars/previous.svg"));
UIManager.put("Toolbar.nextIcon", new FlatSVGIcon("icons/toolbars/next.svg"));
UIManager.put("Tree.closedIcon", new FlatSVGIcon("icons/nodes/folder.svg"));
UIManager.put("Tree.leafIcon", new FlatSVGIcon("icons/nodes/file.svg"));
UIManager.put("Tree.openIcon", new FlatSVGIcon("icons/nodes/folder.svg"));

// See resources/icons/guidelines.md for more information
final FlatSVGIcon.ColorFilter filter = FlatSVGIcon.ColorFilter.getInstance();
filter.add(new Color(0x6C707E), UIColor.named("Icon.baseColor"));
filter.add(new Color(0xEBECF0), UIColor.named("Icon.baseColor2"));
filter.add(new Color(0x3574F0), UIColor.named("Icon.accentColor"));
filter.add(new Color(0xE7EFFD), UIColor.named("Icon.accentColor2"));
}

private void saveState() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.shade.decima.ui.data.handlers;

import com.shade.decima.model.rtti.RTTIType;
import com.shade.decima.ui.data.registry.ValueHandlerRegistration;
import com.shade.decima.ui.data.registry.ValueHandlerRegistration.Selector;
import com.shade.decima.ui.data.registry.ValueHandlerRegistration.Type;
import com.shade.util.NotNull;
import com.shade.util.Nullable;

import javax.swing.*;

@ValueHandlerRegistration(value = {
@Selector(type = @Type(name = "ModelResource")),
@Selector(type = @Type(name = "MeshResourceBase")),
})
public class ModelValueHandler extends ObjectValueHandler {
@Nullable
@Override
public Icon getIcon(@NotNull RTTIType<?> type) {
return UIManager.getIcon("Node.modelIcon");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.shade.decima.ui.data.handlers;

import com.shade.decima.model.rtti.RTTIType;
import com.shade.decima.ui.data.registry.ValueHandlerRegistration;
import com.shade.decima.ui.data.registry.ValueHandlerRegistration.Selector;
import com.shade.decima.ui.data.registry.ValueHandlerRegistration.Type;
import com.shade.util.NotNull;
import com.shade.util.Nullable;

import javax.swing.*;

@ValueHandlerRegistration(value = {
@Selector(type = @Type(name = "Texture")),
})
public class TextureValueHandler extends ObjectValueHandler {
@Nullable
@Override
public Icon getIcon(@NotNull RTTIType<?> type) {
return UIManager.getIcon("Node.textureIcon");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private void setProgress(double progress) {

private class PreviousTrackAction extends AbstractAction {
public PreviousTrackAction() {
putValue(SMALL_ICON, UIManager.getIcon("Toolbar.previousIcon"));
putValue(SMALL_ICON, UIManager.getIcon("Action.previousIcon"));
putValue(SHORT_DESCRIPTION, "Previous");
}

Expand All @@ -189,7 +189,7 @@ public void actionPerformed(ActionEvent e) {

private class NextTrackAction extends AbstractAction {
public NextTrackAction() {
putValue(SMALL_ICON, UIManager.getIcon("Toolbar.nextIcon"));
putValue(SMALL_ICON, UIManager.getIcon("Action.nextIcon"));
putValue(SHORT_DESCRIPTION, "Next");
}

Expand Down Expand Up @@ -219,10 +219,10 @@ public void actionPerformed(ActionEvent e) {

public void setPlaying(boolean playing) {
if (playing) {
putValue(SMALL_ICON, UIManager.getIcon("Toolbar.pauseIcon"));
putValue(SMALL_ICON, UIManager.getIcon("Action.pauseIcon"));
putValue(SHORT_DESCRIPTION, "Pause");
} else {
putValue(SMALL_ICON, UIManager.getIcon("Toolbar.playIcon"));
putValue(SMALL_ICON, UIManager.getIcon("Action.playIcon"));
putValue(SHORT_DESCRIPTION, "Play");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ public String getName() {
@Nullable
@Override
public Icon getIcon() {
return UIManager.getIcon("Editor.binaryIcon");
return UIManager.getIcon("File.binaryIcon");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public String getName() {
@Nullable
@Override
public Icon getIcon() {
return UIManager.getIcon("Editor.coreIcon");
return UIManager.getIcon("File.coreIcon");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.shade.util.NotNull;
import com.shade.util.Nullable;

import javax.swing.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.stream.Collector;
Expand Down Expand Up @@ -91,7 +92,7 @@ public String getLabel() {
@Nullable
@Override
public Icon getIcon() {
return UIManager.getIcon("Editor.coreIcon");
return UIManager.getIcon("File.coreIcon");
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public String getLabel() {
@Override
public Icon getIcon() {
return switch (extension) {
case "core" -> UIManager.getIcon("Editor.coreIcon");
case "stream" -> UIManager.getIcon("Editor.binaryIcon");
case "core" -> UIManager.getIcon("File.coreIcon");
case "stream" -> UIManager.getIcon("File.binaryIcon");
default -> super.getIcon();
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected NavigatorNode[] loadChildren(@NotNull ProgressMonitor monitor) throws
@Nullable
@Override
public Icon getIcon() {
return UIManager.getIcon(project != null ? "Action.monitorActiveIcon" : "Action.monitorInactiveIcon");
return UIManager.getIcon(project != null ? "Node.monitorActiveIcon" : "Node.monitorInactiveIcon");
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public ViewPane(@NotNull ViewRegistration registration, @NotNull Component compo
));
toolbar.add(UIUtils.createBoldLabel(registration.label()));
toolbar.add(Box.createHorizontalGlue());
toolbar.add(new AbstractAction("Hide", UIManager.getIcon("Toolbar.hideIcon")) {
toolbar.add(new AbstractAction("Hide", UIManager.getIcon("Action.hideIcon")) {
@Override
public void actionPerformed(ActionEvent e) {
hideView(registration.id());
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions modules/decima-ui/src/main/resources/icons/actions/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions modules/decima-ui/src/main/resources/icons/actions/edit_modal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions modules/decima-ui/src/main/resources/icons/actions/export.svg
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.
10 changes: 8 additions & 2 deletions modules/decima-ui/src/main/resources/icons/actions/import.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5c9ebc3

Please sign in to comment.