Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- Base.java Thu Jul 16 07:20:16 2015
- +++ Base.java Thu Jul 16 21:35:24 2015
- @@ -1734,9 +1734,11 @@
- g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
- - g.setFont(new Font("SansSerif", Font.PLAIN, 11));
- + int scale = Theme.getInteger("gui.scalePercent");
- + Font f = new Font("SansSerif", Font.PLAIN, 11 * scale / 100);
- + g.setFont(f);
- g.setColor(Color.white);
- - g.drawString(BaseNoGui.VERSION_NAME_LONG, 33, 20);
- + g.drawString(BaseNoGui.VERSION_NAME_LONG, 33 * scale / 100, 20 * scale / 100);
- }
- };
- window.addMouseListener(new MouseAdapter() {
- @@ -2038,6 +2040,9 @@
- static public Image getLibImage(String name, Component who) {
- Toolkit tk = Toolkit.getDefaultToolkit();
- + int scale = Theme.getInteger("gui.scalePercent");
- + // TODO: create high-res enlarged copies and load those if
- + // the scale is more than 125%
- File imageLocation = new File(getContentFile("lib"), name);
- Image image = tk.getImage(imageLocation.getAbsolutePath());
- MediaTracker tracker = new MediaTracker(who);
- @@ -2045,6 +2050,15 @@
- try {
- tracker.waitForAll();
- } catch (InterruptedException e) {
- + }
- + if (scale != 100) {
- + int width = image.getWidth(null) * scale / 100;
- + int height = image.getHeight(null) * scale / 100;
- + image = image.getScaledInstance(width, height, Image.SCALE_SMOOTH);
- + tracker.addImage(image, 1);
- + try {
- + tracker.waitForAll();
- + } catch (InterruptedException e) { }
- }
- return image;
- }
- --- EditorHeader.java Thu Jul 16 07:20:16 2015
- +++ EditorHeader.java Thu Jul 16 21:38:13 2015
- @@ -68,6 +68,8 @@
- static final int MENU = 3;
- static final int PIECE_WIDTH = 4;
- + // value for the size bars, buttons, etc
- + static final int GRID_SIZE = 33 * Theme.getInteger("gui.scalePercent") / 100;
- static Image[][] pieces;
- @@ -383,16 +385,16 @@
- public Dimension getMinimumSize() {
- if (OSUtils.isMacOS()) {
- - return new Dimension(300, Preferences.GRID_SIZE);
- + return new Dimension(300, GRID_SIZE);
- }
- - return new Dimension(300, Preferences.GRID_SIZE - 1);
- + return new Dimension(300, GRID_SIZE - 1);
- }
- public Dimension getMaximumSize() {
- if (OSUtils.isMacOS()) {
- - return new Dimension(3000, Preferences.GRID_SIZE);
- + return new Dimension(3000, GRID_SIZE);
- }
- - return new Dimension(3000, Preferences.GRID_SIZE - 1);
- + return new Dimension(3000, GRID_SIZE - 1);
- }
- }
- --- EditorLineStatus.java Thu Jul 16 07:20:16 2015
- +++ EditorLineStatus.java Thu Jul 16 21:39:14 2015
- @@ -57,7 +57,7 @@
- background = Theme.getColor("linestatus.bgcolor");
- font = Theme.getFont("linestatus.font");
- foreground = Theme.getColor("linestatus.color");
- - high = Theme.getInteger("linestatus.height");
- + high = Theme.getInteger("linestatus.height") * Theme.getInteger("gui.scalePercent") / 100;
- if (OSUtils.isMacOS()) {
- resize = Base.getThemeImage("resize.gif", this);
- --- EditorStatus.java Thu Jul 16 07:20:16 2015
- +++ EditorStatus.java Thu Jul 16 21:40:54 2015
- @@ -45,6 +45,8 @@
- private static final int EDIT = 2;
- private static final int PROGRESS = 5;
- private static final String NO_MESSAGE = "";
- + //value for the size bars, buttons, etc
- + static final int GRID_SIZE = 33 * Theme.getInteger("gui.scalePercent") / 100;
- private static final Color[] BGCOLOR;
- private static final Color[] FGCOLOR;
- @@ -394,11 +396,11 @@
- }
- public Dimension getMinimumSize() {
- - return new Dimension(300, Preferences.GRID_SIZE);
- + return new Dimension(300, GRID_SIZE);
- }
- public Dimension getMaximumSize() {
- - return new Dimension(3000, Preferences.GRID_SIZE);
- + return new Dimension(3000, GRID_SIZE);
- }
- public boolean isErr() {
- --- EditorToolbar.java Thu Jul 16 07:20:16 2015
- +++ EditorToolbar.java Thu Jul 16 21:42:06 2015
- @@ -56,19 +56,19 @@
- /**
- * Width of each toolbar button.
- */
- - private static final int BUTTON_WIDTH = 27;
- + private static final int BUTTON_WIDTH = 27 * Theme.getInteger("gui.scalePercent") / 100;
- /**
- * Height of each toolbar button.
- */
- - private static final int BUTTON_HEIGHT = 32;
- + private static final int BUTTON_HEIGHT = 32 * Theme.getInteger("gui.scalePercent") / 100;
- /**
- * The amount of space between groups of buttons on the toolbar.
- */
- - private static final int BUTTON_GAP = 5;
- + private static final int BUTTON_GAP = 5 * Theme.getInteger("gui.scalePercent") / 100;
- /**
- * Size of the button image being chopped up.
- */
- - private static final int BUTTON_IMAGE_SIZE = 33;
- + private static final int BUTTON_IMAGE_SIZE = 33 * Theme.getInteger("gui.scalePercent") / 100;
- private static final int RUN = 0;
- @@ -437,7 +437,7 @@
- public Dimension getMaximumSize() {
- - return new Dimension(3000, BUTTON_HEIGHT);
- + return new Dimension(3000 * Theme.getInteger("gui.scalePercent") / 100, BUTTON_HEIGHT);
- }
- --- Preferences.java Thu Jul 16 07:20:16 2015
- +++ Preferences.java Thu Jul 16 21:42:54 2015
- @@ -73,11 +73,6 @@
- */
- static public int BUTTON_HEIGHT = 24;
- - // value for the size bars, buttons, etc
- -
- - static final int GRID_SIZE = 33;
- -
- -
- // indents and spacing standards. these probably need to be modified
- // per platform as well, since macosx is so huge, windows is smaller,
- // and linux is all over the map
- --- Theme.java Thu Jul 16 07:20:16 2015
- +++ Theme.java Thu Jul 16 21:44:20 2015
- @@ -109,6 +109,10 @@
- set(attr, value);
- font = PreferencesHelper.getFont(table, attr);
- }
- + int scale = getInteger("gui.scalePercent");
- + if (scale != 100) {
- + font = font.deriveFont((float)(font.getSize()) * (float)scale / (float)100.0);
- + }
- return font;
- }
- --- theme.txt Thu Jul 16 07:20:16 2015
- +++ theme.txt Thu Jul 16 21:44:18 2015
- @@ -1,3 +1,6 @@
- +# GUI - Scaling, edit this to scale to higher dots-per-inch displays
- +gui.scalePercent = 100
- +
- #FUNCTIONS COLOR #D35400 - ORANGE KEYWORD1
- #FUNCTIONS COLOR #D35400 - ORANGE KEYWORD2
- #STRUCTURE COLORS #5E6D03 - GREEN KEYWORD3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement