diff --git a/CHANGELOG.md b/CHANGELOG.md index 71466d034..6b88eb690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added +- PR119 Option to set scale factor in advanced settings (Set it to 2.0 on Mac retina displays) ## [17.0.0] - 2022-11-20 ### Added diff --git a/build.xml b/build.xml index 9316cf37e..8c8ee617a 100644 --- a/build.xml +++ b/build.xml @@ -422,7 +422,6 @@ ${max.heap.size.percent} -Djava.net.preferIPv4Stack=true -Djna.nosys=true - -Dsun.java2d.uiScale=1.0 graphics/splash2.bmp @@ -685,7 +684,6 @@ - diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java index 12e00a956..b91d64f14 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -812,6 +812,11 @@ public final class Configuration { @ConfigurationCategory("script") public static ConfigurationItem flattenASPackages = null; + @ConfigurationDefaultDouble(1.0) + @ConfigurationCategory("display") + @ConfigurationName("gui.scale") + public static ConfigurationItem uiScale = null; + private enum OSId { WINDOWS, OSX, UNIX } diff --git a/nbproject/ide-targets.xml b/nbproject/ide-targets.xml index 1f96025d5..1c6edd129 100644 --- a/nbproject/ide-targets.xml +++ b/nbproject/ide-targets.xml @@ -13,8 +13,7 @@ - - + diff --git a/resources/ffdec.bat b/resources/ffdec.bat index b7d5743c5..3e8ea8e16 100644 --- a/resources/ffdec.bat +++ b/resources/ffdec.bat @@ -2,4 +2,4 @@ rem Set following to higher value if you want more memory: rem You need 64 bit OS and 64 bit java to set it to higher values set MEMORY=1024m -java -Xmx%MEMORY% -Djna.nosys=true -Dsun.java2d.uiScale=1.0 -jar "%~dp0\ffdec.jar" %* \ No newline at end of file +java -Xmx%MEMORY% -Djna.nosys=true -jar "%~dp0\ffdec.jar" %* \ No newline at end of file diff --git a/resources/ffdec.sh b/resources/ffdec.sh index 1c27256f9..947efe5e2 100644 --- a/resources/ffdec.sh +++ b/resources/ffdec.sh @@ -71,7 +71,7 @@ fi popd > /dev/null -args=(-Djava.net.preferIPv4Stack=true -Dsun.java2d.uiScale=1.0 -Xmx$MEMORY -jar $JAR_FILE "$@") +args=(-Djava.net.preferIPv4Stack=true -Xmx$MEMORY -jar $JAR_FILE "$@") if [ "`uname`" = "Darwin" ]; then args=(-Xdock:name=FFDec -Xdock:icon=icon.png "${args[@]}") diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 905928ef3..8057d9038 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -142,6 +142,7 @@ import com.jpexs.decompiler.flash.abc.ABCOpenException; import com.jpexs.decompiler.flash.tags.DoABC2Tag; import com.jpexs.decompiler.flash.treeitems.Openable; import com.jpexs.helpers.MemoryInputStream; +import java.awt.GraphicsDevice; /** * Main executable class @@ -2073,6 +2074,8 @@ public class Main { return null; } + + private static void initGui() { if (GraphicsEnvironment.isHeadless()) { System.err.println("Error: Your system does not support Graphic User Interface"); @@ -2081,6 +2084,10 @@ public class Main { System.setProperty("sun.java2d.d3d", "false"); System.setProperty("sun.java2d.noddraw", "true"); + + if (System.getProperty("sun.java2d.uiScale") == null) { //it was not set by commandline, etc. + System.setProperty("sun.java2d.uiScale", "" + Configuration.uiScale.get()); + } if (Configuration.hwAcceleratedGraphics.get()) { System.setProperty("sun.java2d.opengl", Configuration._debugMode.get() ? "True" : "true"); diff --git a/src/com/jpexs/decompiler/flash/gui/View.java b/src/com/jpexs/decompiler/flash/gui/View.java index 6df936eaa..723562551 100644 --- a/src/com/jpexs/decompiler/flash/gui/View.java +++ b/src/com/jpexs/decompiler/flash/gui/View.java @@ -42,6 +42,7 @@ import java.awt.image.BufferedImage; import java.awt.image.VolatileImage; import java.io.IOException; import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; @@ -682,7 +683,7 @@ public class View { } return conf; } - + public static BufferedImage toCompatibleImage(BufferedImage image) { if (image.getColorModel().equals(getDefaultConfiguration().getColorModel())) { return image; diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties index 921a9899f..e7020aeb3 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties @@ -621,3 +621,5 @@ config.description.pinnedItemsTagListPaths = Paths of nodes of tag list view tre config.name.flattenASPackages = Flatten ActionScript packages config.description.flattenASPackages = Make one item per package instead of package tree. +config.name.gui.scale = UI scale factor +config.description.gui.scale = Scaling factor of graphics interface. Set this to 2.0 on Mac retina displays. Application true exit (not just restart after asking) is required. diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties index dfad233d0..ca8f803a0 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_cs.properties @@ -606,4 +606,7 @@ config.name.pinnedItemsTagListPaths = Cesty p\u0159ipnut\u00fdch polo\u017eek v config.description.pinnedItemsTagListPaths = Cesty uzl\u016f v stromu seznamu tag\u016f, kter\u00e9 jsou p\u0159ipnuty. config.name.flattenASPackages = Zplo\u0161tit bal\u00ed\u010dky ActionScriptu -config.description.flattenASPackages = Zobraz\u00ed bal\u00ed\u010dky jako jednu polo\u017eku pro bal\u00ed\u010dek m\u00edsto stromu bal\u00ed\u010dku. \ No newline at end of file +config.description.flattenASPackages = Zobraz\u00ed bal\u00ed\u010dky jako jednu polo\u017eku pro bal\u00ed\u010dek m\u00edsto stromu bal\u00ed\u010dku. + +config.name.gui.scale = UI faktor zv\u011bt\u0161en\u00ed +config.description.gui.scale = Zv\u011bt\u0161ovac\u00ed faktor grafick\u00e9ho rozhran\u00ed. Nastavte toto na 2.0 na retina displej\u00edch na Macu. Je vy\u017eadov\u00e1no tvrd\u00e9 ukon\u010den\u00ed aplikace (nejen restart po dotazu).