Skip to content

Commit

Permalink
Merge pull request #4639 from thelsing/more-pics
Browse files Browse the repository at this point in the history
Add more icons from Rod Takehara
  • Loading branch information
cwisniew authored Jan 21, 2024
2 parents dbb53bf + 29b489b commit 7292082
Show file tree
Hide file tree
Showing 64 changed files with 31,702 additions and 47 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

Expand Down
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ spotless {
target project.fileTree(project.rootDir) {
include 'src/**/*.java'
exclude '**/JTextAreaAppender.java'
exclude 'src/main/java/net/rptools/maptool/client/ui/themes/Flat*ContrastIJTheme.java'
exclude 'src/main/java/net/rptools/maptool/client/ui/themes/Utils.java'
}
licenseHeaderFile 'spotless.license.java'
toggleOffOn()
Expand Down Expand Up @@ -420,11 +422,11 @@ dependencies {
implementation 'com.thoughtworks.xstream:xstream:1.4.20'

// themes
implementation 'com.formdev:flatlaf:3.1.1'
implementation 'com.formdev:flatlaf-intellij-themes:3.1.1'
implementation 'com.formdev:flatlaf-extras:3.2.5'
implementation 'com.formdev:svgSalamander:1.1.4'
implementation 'com.formdev:flatlaf-jide-oss:3.2.5'
implementation 'com.formdev:flatlaf:3.3'
implementation 'com.formdev:flatlaf-intellij-themes:3.3'
implementation 'com.formdev:flatlaf-extras:3.3'
implementation 'com.github.weisj:jsvg:1.2.0'
implementation 'com.formdev:flatlaf-jide-oss:3.3'

// JS support for macros
implementation group: 'org.graalvm.js', name: 'js', version: '21.2.0'
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/rptools/maptool/client/ui/theme/Icons.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public enum Icons {
ACTION_SELECT_ALL_TOKENS,
ACTION_SELECT_NO_TOKENS,
ACTION_SETTINGS,
ACTION_TARGET_ADD,
ACTION_TARGET_EDIT,
ACTION_TARGET_REMOVE,
ADD_RESSOURCE_LOCAL,
ADD_RESSOURCE_RPTOOLS,
ADD_RESSOURCE_WEB,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Set;
import java.util.TreeSet;
import javax.swing.*;
import net.rptools.lib.image.ImageUtil;
import net.rptools.maptool.client.AppPreferences;
Expand All @@ -36,6 +36,9 @@ public class RessourceManager {
// This icons don't exist in classic.
put(Icons.ACTION_EXPORT, null);
put(Icons.ACTION_IMPORT, null);
put(Icons.ACTION_TARGET_ADD, null);
put(Icons.ACTION_TARGET_EDIT, null);
put(Icons.ACTION_TARGET_REMOVE, null);
put(Icons.PROPERTIES_TABLE_ALPHABETIC, null);
put(Icons.PROPERTIES_TABLE_CATEGORIES, null);
put(Icons.PROPERTIES_TABLE_COLLAPSE, null);
Expand Down Expand Up @@ -300,10 +303,35 @@ public class RessourceManager {
put(Icons.ACTION_SELECT_ALL_TOKENS, ROD_ICONS + "misc/Select All Tokens.svg");
put(Icons.ACTION_SELECT_NO_TOKENS, ROD_ICONS + "misc/Deselect All Tokens.svg");
put(Icons.ACTION_SETTINGS, ROD_ICONS + "initiative/Initiative Settings.svg");
put(Icons.ACTION_TARGET_ADD, ROD_ICONS + "add target.svg");
put(Icons.ACTION_TARGET_EDIT, ROD_ICONS + "edit target.svg");
put(Icons.ACTION_TARGET_REMOVE, ROD_ICONS + "remove target.svg");
put(Icons.ADD_RESSOURCE_LOCAL, ROD_ICONS + "folder.svg");
put(Icons.ASSETPANEL_HEROLABS, ROD_ICONS + "hero-lab-icon.svg");
put(Icons.ASSETPANEL_HEROLABS_FOLDER, ROD_ICONS + "hero_lab_folder.svg");
put(Icons.CHAT_HIDE_TYPING_NOTIFICATION, ROD_ICONS + "misc/Hide Typing notification.svg");
put(Icons.CHAT_SCROLL_LOCK_ON, ROD_ICONS + "misc/Scroll Lock.svg");
put(Icons.CHAT_SHOW_TYPING_NOTIFICATION, ROD_ICONS + "misc/Show Typing notification.svg");
put(Icons.COLORPICKER_CAP_ROUND, ROD_ICONS + "round_cap.svg");
put(Icons.COLORPICKER_CAP_SQUARE, ROD_ICONS + "square_cap.svg");
put(Icons.COLORPICKER_ERASER, ROD_ICONS + "eraser.svg");
put(Icons.COLORPICKER_OPACITY, ROD_ICONS + "contrast_high.svg");
put(Icons.COLORPICKER_PENCIL, ROD_ICONS + "pencil.svg");
put(Icons.COLORPICKER_PEN_WIDTH, ROD_ICONS + "paintbrush.svg");
put(Icons.COLORPICKER_SNAP_OFF, ROD_ICONS + "freehand.svg");
put(Icons.COLORPICKER_SNAP_ON, ROD_ICONS + "shape_handles.svg");
put(Icons.EDIT_TOKEN_COLOR_PICKER, ROD_ICONS + "misc/Colour Selection (eye dropper).svg");
put(Icons.EDIT_TOKEN_HEROLAB, ROD_ICONS + "hero-lab-icon.svg");
// FIXME: both icons are the same. Maybe we could change the color of svgs according to
// the theme?
put(Icons.EDIT_TOKEN_REFRESH_OFF, ROD_ICONS + "refresh_arrows.svg");
put(Icons.EDIT_TOKEN_REFRESH_ON, ROD_ICONS + "refresh_arrows.svg");
put(Icons.GRID_HEX_HORIZONTAL, ROD_ICONS + "gridHorizontalHex.svg");
put(Icons.GRID_HEX_VERTICAL, ROD_ICONS + "gridVerticalHex.svg");
put(Icons.GRID_ISOMETRIC, ROD_ICONS + "gridIsometric.svg");
put(Icons.GRID_NONE, ROD_ICONS + "cross.svg");
put(Icons.GRID_SQUARE, ROD_ICONS + "gridSquare.svg");
put(Icons.MAPTOOL, ROD_ICONS + "maptool_icon.svg");
put(Icons.MENU_DOCUMENTATION, ROD_ICONS + "menu/Documentation.svg");
put(Icons.MENU_FORUMS, ROD_ICONS + "menu/Forums.svg");
put(Icons.MENU_FRAMEWORKS, ROD_ICONS + "menu/Frameworks.svg");
Expand Down Expand Up @@ -349,6 +377,8 @@ public class RessourceManager {
put(Icons.TOOLBAR_FOG_EXPOSE_POLYGON, ROD_ICONS + "ribbon/Draw Polygon.svg");
put(Icons.TOOLBAR_FOG_OFF, ROD_ICONS + "ribbon/Fog of War Tools.svg");
put(Icons.TOOLBAR_FOG_ON, ROD_ICONS + "ribbon/Fog of War Tools.svg");
put(Icons.TOOLBAR_HIDE_OFF, ROD_ICONS + "upArrow.svg");
put(Icons.TOOLBAR_HIDE_ON, ROD_ICONS + "downArrow.svg");
put(
Icons.TOOLBAR_POINTERTOOL_AI_OFF,
ROD_ICONS + "ribbon/Pathing MBL - VBL (AI) - OFF.svg");
Expand Down Expand Up @@ -405,6 +435,7 @@ public class RessourceManager {
put(Icons.TOOLBAR_VOLUME_OFF, ROD_ICONS + "ribbon/Mute - OFF.svg");
put(Icons.TOOLBAR_VOLUME_ON, ROD_ICONS + "ribbon/Mute - ON.svg");
put(Icons.TOOLBAR_ZONE, ROD_ICONS + "ribbon/Select Map.svg");
put(Icons.TOOLBAR_ZONE_NOT_VISIBLE, ROD_ICONS + "notvisible.svg");
put(Icons.WINDOW_CAMPAIGN_MACROS, ROD_ICONS + "windows/Campaign Macros.svg");
put(Icons.WINDOW_CHAT, ROD_ICONS + "windows/Chat.svg");
put(Icons.WINDOW_CONNECTIONS, ROD_ICONS + "windows/Connections.svg");
Expand Down Expand Up @@ -531,18 +562,24 @@ private static <KEY, CACHEKEY, RESULT> RESULT getFromHashMapsAndCache(
}

public static void main(String[] args) {
checkMissingFiles();
// checkMissingFiles();
checkMissingIcons(classicIcons, rodIcons);
for (var img : Set.of(images.values())) System.out.println(img);
// for (var img : Set.of(images.values())) System.out.println(img);
}

private static void checkMissingIcons(
HashMap<Icons, String> classicIcons, HashMap<Icons, String> rodIcons) {
var missing = new TreeSet<Icons>();
for (var key : classicIcons.keySet()) {
if (rodIcons.containsKey(key)) continue;
if (rodIcons.containsKey(key)) {
continue;
}
missing.add(key);
}

System.out.println(
key + " missing from iconset. File for classic icon is :" + classicIcons.get(key));
System.out.println("Missing icons:");
for (var key : missing) {
System.out.println(key + " classic: " + classicIcons.get(key));
}
}

Expand Down
53 changes: 18 additions & 35 deletions src/main/java/net/rptools/maptool/client/ui/theme/ThemeSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
import javax.swing.*;
import net.rptools.maptool.client.AppConstants;
import net.rptools.maptool.client.MapTool;
import net.rptools.maptool.client.ui.themes.AahLAF;
import net.rptools.maptool.client.ui.themes.AahLAF_LP;
import net.rptools.maptool.client.ui.themes.AahLAF_SP;
import net.rptools.maptool.client.ui.themes.AahLAF_VLP;
import net.rptools.maptool.client.ui.themes.*;
import net.rptools.maptool.events.MapToolEventBus;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -161,7 +158,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Arc Dark Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatArcDarkContrastIJTheme.class,
FlatArcDarkContrastIJTheme.class,
"Arc-Dark-Contrast-Material.png",
true),
new ThemeDetails(
Expand All @@ -176,8 +173,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Atom One Dark Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneDarkContrastIJTheme
.class,
FlatAtomOneDarkContrastIJTheme.class,
"Atom-One-Dark-Contrast-Material.png",
true),
new ThemeDetails(
Expand All @@ -187,8 +183,7 @@ public record ThemeDetails(
false),
new ThemeDetails(
"Atom One Light Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneLightContrastIJTheme
.class,
FlatAtomOneLightContrastIJTheme.class,
"Atom-One-Light-Contrast-Material.png",
false),
new ThemeDetails(
Expand Down Expand Up @@ -228,7 +223,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Darcula Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatDraculaContrastIJTheme.class,
FlatDraculaContrastIJTheme.class,
"Darcula-Contrast-Material.png",
true),
new ThemeDetails(
Expand All @@ -238,7 +233,7 @@ public record ThemeDetails(
false),
new ThemeDetails(
"GitHub Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubContrastIJTheme.class,
FlatGitHubContrastIJTheme.class,
"GitHub-Contrast-Material.png",
false),
new ThemeDetails(
Expand All @@ -248,8 +243,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"GitHub Dark Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubDarkContrastIJTheme
.class,
FlatGitHubDarkContrastIJTheme.class,
"GitHub-Dark-Contrast-Material.png",
true),
new ThemeDetails(
Expand Down Expand Up @@ -311,8 +305,7 @@ public record ThemeDetails(
false),
new ThemeDetails(
"Light Owl Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatLightOwlContrastIJTheme
.class,
FlatLightOwlContrastIJTheme.class,
"Light-Owl-Contrast-Material.png",
false),
new ThemeDetails(
Expand All @@ -327,8 +320,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Material Darker Contrast",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDarkerContrastIJTheme
.class,
FlatMaterialDarkerContrastIJTheme.class,
"Material-Darker-Contrast.png",
true),
new ThemeDetails(
Expand All @@ -339,8 +331,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Material Deep Ocean Contrast",
com.formdev.flatlaf.intellijthemes.materialthemeuilite
.FlatMaterialDeepOceanContrastIJTheme.class,
FlatMaterialDeepOceanContrastIJTheme.class,
"Material-Deep-Ocean-Contrast.png",
true),
new ThemeDetails(
Expand All @@ -350,8 +341,7 @@ public record ThemeDetails(
false),
new ThemeDetails(
"Material Lighter Contrast",
com.formdev.flatlaf.intellijthemes.materialthemeuilite
.FlatMaterialLighterContrastIJTheme.class,
FlatMaterialLighterContrastIJTheme.class,
"Material-Lighter-Contrast.png",
false),
new ThemeDetails(
Expand All @@ -361,8 +351,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Material Oceanic Contrast",
com.formdev.flatlaf.intellijthemes.materialthemeuilite
.FlatMaterialOceanicContrastIJTheme.class,
FlatMaterialOceanicContrastIJTheme.class,
"Material-Oceanic-Contrast.png",
true),
new ThemeDetails(
Expand All @@ -373,8 +362,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Material Palenight Contrast",
com.formdev.flatlaf.intellijthemes.materialthemeuilite
.FlatMaterialPalenightContrastIJTheme.class,
FlatMaterialPalenightContrastIJTheme.class,
"Material-Palenight-Contrast.png",
true),
new ThemeDetails(
Expand All @@ -394,8 +382,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Monokai Pro Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMonokaiProContrastIJTheme
.class,
FlatMonokaiProContrastIJTheme.class,
"Monokai-Pro-Contrast-Material.png",
true),
new ThemeDetails(
Expand All @@ -405,8 +392,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Moonlight Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMoonlightContrastIJTheme
.class,
FlatMoonlightContrastIJTheme.class,
"Moonlight-Contrast-Material.png",
true),
new ThemeDetails(
Expand All @@ -418,8 +404,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Night Owl Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatNightOwlContrastIJTheme
.class,
FlatNightOwlContrastIJTheme.class,
"Night-Owl-Contrast-Material.png",
true),
new ThemeDetails(
Expand All @@ -439,8 +424,7 @@ public record ThemeDetails(
true),
new ThemeDetails(
"Solarized Dark Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedDarkContrastIJTheme
.class,
FlatSolarizedDarkContrastIJTheme.class,
"Solarized-Dark-Contrast-Material.png",
true),
new ThemeDetails(
Expand All @@ -455,8 +439,7 @@ public record ThemeDetails(
false),
new ThemeDetails(
"Solarized Light Contrast (Material)",
com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedLightContrastIJTheme
.class,
FlatSolarizedLightContrastIJTheme.class,
"Solarized-Light-Contrast-Material.png",
false),
new ThemeDetails(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2020 FormDev Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.rptools.maptool.client.ui.themes;

//
// taken from
// https://github.com/JFormDesigner/FlatLaf/tree/0291dd5416b6bbf8ea2f3d5e4f7a4f22d6368e36/flatlaf-intellij-themes
//

import com.formdev.flatlaf.IntelliJTheme;

/**
* @author Karl Tauber
*/
public class FlatArcDarkContrastIJTheme extends IntelliJTheme.ThemeLaf {
public static final String NAME = "Arc Dark Contrast (Material)";

public static boolean setup() {
try {
return setup(new FlatArcDarkContrastIJTheme());
} catch (RuntimeException ex) {
return false;
}
}

public static void installLafInfo() {
installLafInfo(NAME, FlatArcDarkContrastIJTheme.class);
}

public FlatArcDarkContrastIJTheme() {
super(Utils.loadTheme("Arc Dark Contrast.theme.json"));
}

@Override
public String getName() {
return NAME;
}
}
Loading

0 comments on commit 7292082

Please sign in to comment.