Skip to content

Commit 57ff86f

Browse files
Option --scale now handled in the Java code, not in a wrapper.
Resolves #513.
1 parent 6c4e325 commit 57ff86f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/main/config/irscrutinizer.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,10 @@
88
# When changing this file, or updating the programs, it may be a good idea to
99
# delete the property file, normally ~/.config/IrScrutinizer/properties.xml.
1010

11-
if [ "$1" = "-s" -o "$1" = "--scale" ] ; then
12-
SCALE_FACTOR=$2
13-
shift 2
14-
fi
15-
1611
# Set to the preferred Java VM, with or without directory.
1712
JAVA=${JAVA:-java}
1813

19-
# Modify for Hight DPI usage.
20-
# Not all JVMs recognize this; some only accept integer arguments.
21-
JVM_ARGS=-Dsun.java2d.uiScale=${SCALE_FACTOR:-1}
14+
JVM_ARGS=
2215

2316
# Where the programs are installed, adjust if required
2417
export IRSCRUTINIZERHOME="$(dirname -- "$(readlink -f -- "${0}")" )"

src/main/java/org/harctoolbox/irscrutinizer/IrScrutinizer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ public static void main(String[] args) {
101101
System.exit(IrpUtils.EXIT_SUCCESS);
102102
}
103103

104+
if (commandLineArgs.scaling != null)
105+
System.setProperty("sun.java2d.uiScale", commandLineArgs.scaling);
106+
104107
setupRadixPrefixes();
105108

106109
String applicationHome = Utils.findApplicationHome(commandLineArgs.applicationHome, IrScrutinizer.class, Version.appName);
@@ -209,6 +212,9 @@ private final static class CommandLineArgs {
209212
@Parameter(names = {"-p", "--properties"}, description = "Pathname of properties file")
210213
private String propertiesFilename = null;
211214

215+
@Parameter(names = {"-s", "--scale", "--scaling"}, description = "Set scaling of the GUI. Accepted values and their semantics depend on the JVM.")
216+
private String scaling = null;
217+
212218
@Parameter(names = {"-V", "--version"}, description = "Display version information")
213219
private boolean versionRequested;
214220

0 commit comments

Comments
 (0)