From 16b7dce8ab33d677abee5340651786c5ba21816e Mon Sep 17 00:00:00 2001 From: openaudible Date: Mon, 4 Jun 2018 16:48:33 -0700 Subject: [PATCH] Bump version and smaller fonts on linux. --- .../openaudible/desktop/swt/manager/Version.java | 2 +- .../desktop/swt/util/shop/FontShop.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/openaudible/desktop/swt/manager/Version.java b/src/main/java/org/openaudible/desktop/swt/manager/Version.java index 9924372..056d159 100644 --- a/src/main/java/org/openaudible/desktop/swt/manager/Version.java +++ b/src/main/java/org/openaudible/desktop/swt/manager/Version.java @@ -3,7 +3,7 @@ package org.openaudible.desktop.swt.manager; public interface Version { String appName = "OpenAudible"; - String appVersion = "1.1"; + String appVersion = "1.1.1"; boolean appDebug = false; String appLink = "http://openaudible.org"; String versionLink = "http://openaudible.org/swt_version.json"; diff --git a/src/main/java/org/openaudible/desktop/swt/util/shop/FontShop.java b/src/main/java/org/openaudible/desktop/swt/util/shop/FontShop.java index 6c8380f..69a9cdf 100644 --- a/src/main/java/org/openaudible/desktop/swt/util/shop/FontShop.java +++ b/src/main/java/org/openaudible/desktop/swt/util/shop/FontShop.java @@ -10,6 +10,7 @@ import org.eclipse.swt.widgets.Display; import org.openaudible.desktop.swt.gui.GUI; import org.openaudible.desktop.swt.i8n.Translate; import org.openaudible.desktop.swt.manager.Application; +import org.openaudible.util.Platform; // ugly singleton swt font manager public class FontShop { @@ -121,8 +122,12 @@ public class FontShop { private Font newDefaultFont(int id) { Display display = Display.getCurrent(); - int bump = 0; + int sizeAdjust = 0; Font fontCopy = null; + if (Platform.isLinux()) + { + sizeAdjust -=2; + } switch (id) { case DIALOG_FONT: @@ -131,11 +136,10 @@ public class FontShop { case TABLE_FONT: fontCopy = JFaceResources.getDefaultFont(); if (GUI.isMac()) - bump = -1; + sizeAdjust = -1; break; case TEXT_FONT: - fontCopy = JFaceResources.getTextFont(); break; @@ -151,16 +155,12 @@ public class FontShop { } FontData fd; - if (fontCopy != null) fd = fontCopy.getFontData()[0]; else fd = display.getSystemFont().getFontData()[0]; - int size = Math.round(fd.getHeight()) + bump; - + int size = Math.round(fd.getHeight()) + sizeAdjust; Font f = new Font(display, fd.getName(), size, 0); - FontData ff = f.getFontData()[0]; - return f; }