diff --git a/pom.xml b/pom.xml index 9b6677076..465ec7ccc 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.formdev flatlaf - 3.2 + 3.2.1 diff --git a/src/main/java/pixelitor/filters/gui/DialogMenuBar.java b/src/main/java/pixelitor/filters/gui/DialogMenuBar.java index 9c423b241..54308dc4c 100644 --- a/src/main/java/pixelitor/filters/gui/DialogMenuBar.java +++ b/src/main/java/pixelitor/filters/gui/DialogMenuBar.java @@ -51,7 +51,7 @@ public DialogMenuBar(DialogMenuOwner owner, boolean addPresets) { addPresetsMenu(); } - if (owner.hasHelp()) { + if (OpenInBrowserAction.CAN_BROWSE && owner.hasHelp()) { JMenu helpMenu = new JMenu(GUIText.HELP); helpMenu.add(new OpenInBrowserAction("Wikipedia", owner.getHelpURL())); add(helpMenu); diff --git a/src/main/java/pixelitor/gui/PreferencesPanel.java b/src/main/java/pixelitor/gui/PreferencesPanel.java index 72d24a627..b07af5652 100644 --- a/src/main/java/pixelitor/gui/PreferencesPanel.java +++ b/src/main/java/pixelitor/gui/PreferencesPanel.java @@ -41,9 +41,11 @@ import javax.swing.border.Border; import javax.swing.plaf.FontUIResource; import javax.swing.plaf.nimbus.NimbusLookAndFeel; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.GridBagLayout; import java.io.File; -import java.util.function.Consumer; import static java.lang.Integer.parseInt; import static pixelitor.gui.GUIText.CLOSE_DIALOG; @@ -127,7 +129,7 @@ private void addThemeChooser(GridBagHelper gbh) { themeChooser.setName("themeChooser"); gbh.addLabelAndControlNoStretch("Theme: ", themeChooser); - JLabel accentColorLabel = new JLabel("Accent Color (Flat Themes)"); +/* JLabel accentColorLabel = new JLabel("Accent Color (Flat Themes)"); EnumComboBoxModel accentColors = new EnumComboBoxModel<>(AccentColor.class); @SuppressWarnings("unchecked") JComboBox accentColorChooser = new JComboBox<>(accentColors); @@ -139,20 +141,20 @@ private void addThemeChooser(GridBagHelper gbh) { accentColorEnabler.accept(currentTheme.isFlat()); gbh.addTwoControlsNoStretch(accentColorLabel, accentColorChooser); - +*/ themeChooser.addActionListener(e -> { Theme theme = themes.getSelectedItem(); setCursor(Cursors.BUSY); EventQueue.invokeLater(() -> { Themes.install(theme, true, false); - accentColorEnabler.accept(theme.isFlat()); +// accentColorEnabler.accept(theme.isFlat()); SwingUtilities.getWindowAncestor(this).pack(); setCursor(Cursors.DEFAULT); }); }); - accentColorChooser.addActionListener(e -> Themes.changeAccentColor(accentColors.getSelectedItem())); +// accentColorChooser.addActionListener(e -> Themes.changeAccentColor(accentColors.getSelectedItem())); } private void addFontChoosers(GridBagHelper gbh) { diff --git a/src/main/java/pixelitor/layers/LayerGroup.java b/src/main/java/pixelitor/layers/LayerGroup.java index 8db3fba99..9004958cc 100644 --- a/src/main/java/pixelitor/layers/LayerGroup.java +++ b/src/main/java/pixelitor/layers/LayerGroup.java @@ -535,7 +535,7 @@ public PixelitorEdit endMovement() { @Override PixelitorEdit createMovementEdit(int oldTx, int oldTy) { - return null; // the group has no content on its own + return null; // the group has no content of its own } @Override diff --git a/src/main/java/pixelitor/tools/pen/PathBuilder.java b/src/main/java/pixelitor/tools/pen/PathBuilder.java index 5467b4978..c14de4d03 100644 --- a/src/main/java/pixelitor/tools/pen/PathBuilder.java +++ b/src/main/java/pixelitor/tools/pen/PathBuilder.java @@ -85,11 +85,11 @@ public void mousePressed(PMouseEvent e) { if (state == NO_INTERACTION) { if (controlDown) { - if (handleCtrlPressHitBeforeSubpath(altDown, x, y)) { + if (handleCtrlPressBeforeSubpath(altDown, x, y)) { return; } } else if (altDown) { - if (handleAltPressHitBeforeSubpath(x, y)) { + if (handleAltPressBeforeSubpath(x, y)) { return; } } @@ -144,8 +144,8 @@ public void mousePressed(PMouseEvent e) { assert path.checkConsistency(); } - private static boolean handleCtrlPressHitBeforeSubpath(boolean altDown, - double x, double y) { + private static boolean handleCtrlPressBeforeSubpath(boolean altDown, + double x, double y) { // if we are over an old point, just move it DraggablePoint hit = path.handleWasHit(x, y, altDown); if (hit != null) { @@ -155,8 +155,8 @@ private static boolean handleCtrlPressHitBeforeSubpath(boolean altDown, return false; } - private static boolean handleAltPressHitBeforeSubpath(double x, double y) { - // if only alt is down, then break control points + private static boolean handleAltPressBeforeSubpath(double x, double y) { + // if only alt is down, then break the control points DraggablePoint hit = path.handleWasHit(x, y, true); if (hit != null) { if (hit instanceof ControlPoint cp) { @@ -190,10 +190,10 @@ private static void startDraggingOutNewHandles(AnchorPoint ap, double x, double private static void breakAndStartMoving(ControlPoint cp, double x, double y) { if (!cp.isRetracted()) { - // alt-press on an anchor point should break the handle + // alt-press on an anchor point should break the handle... cp.getAnchor().setType(CUSP); } else { - // except when it is retracted: then drag out symmetrically + // ...except when it is retracted: then drag out symmetrically cp.getAnchor().setType(SYMMETRIC); } // after breaking, move it as usual @@ -318,7 +318,6 @@ public boolean mouseMoved(MouseEvent e, View view) { return false; } BuildState state = path.getBuildState(); -// assert state.isMoving() : "state = " + state; if (state == DRAGGING_THE_CONTROL_OF_LAST) { state = recoverFromUnexpectedDragState("mouseMoved", view); } diff --git a/src/main/java/pixelitor/tools/pen/PathTransformer.java b/src/main/java/pixelitor/tools/pen/PathTransformer.java index f697e4aec..4c146c198 100644 --- a/src/main/java/pixelitor/tools/pen/PathTransformer.java +++ b/src/main/java/pixelitor/tools/pen/PathTransformer.java @@ -97,8 +97,8 @@ public void mousePressed(PMouseEvent e) { double x = e.getOrigCoX(); double y = e.getOrigCoY(); - // first look for a handle hit in all the boxes so that - // handles can be manipulated even when the boxes are overlapping + // First, check all boxes for a handle hit so that handles + // can be manipulated even when the boxes overlap. boolean handleWasHit = false; for (TransformBox box : boxes) { DraggablePoint hit = box.findHandleAt(x, y); @@ -115,7 +115,7 @@ public void mousePressed(PMouseEvent e) { } activePoint = null; - // if no handle was hit, then look for whole-box movements + // if no handle was hit, then check for whole-box movements for (TransformBox box : boxes) { if (box.contains(x, y)) { box.startWholeBoxDrag(x, y); diff --git a/src/main/java/pixelitor/utils/OpenInBrowserAction.java b/src/main/java/pixelitor/utils/OpenInBrowserAction.java index cfe6ff6f6..a18e3287c 100644 --- a/src/main/java/pixelitor/utils/OpenInBrowserAction.java +++ b/src/main/java/pixelitor/utils/OpenInBrowserAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Laszlo Balazs-Csiki and Contributors + * Copyright 2023 Laszlo Balazs-Csiki and Contributors * * This file is part of Pixelitor. Pixelitor is free software: you * can redistribute it and/or modify it under the terms of the GNU @@ -23,10 +23,15 @@ import java.net.URI; import java.net.URISyntaxException; +import static java.awt.Desktop.Action.BROWSE; + /** * An action that opens a URL in an external browser */ public class OpenInBrowserAction extends AbstractAction { + public static final boolean CAN_BROWSE = Desktop.isDesktopSupported() + && Desktop.getDesktop().isSupported(BROWSE); + private URI uri; public OpenInBrowserAction(String name, String url) { @@ -44,13 +49,13 @@ public void actionPerformed(ActionEvent e) { } private static void openURI(URI uri) { - if (Desktop.isDesktopSupported()) { - Desktop desktop = Desktop.getDesktop(); - try { - desktop.browse(uri); - } catch (IOException e) { - Messages.showException(e); - } + if (!CAN_BROWSE) { + return; + } + try { + Desktop.getDesktop().browse(uri); + } catch (IOException e) { + Messages.showException(e); } } } diff --git a/website/release_notes.html b/website/release_notes.html index 41e573ada..e89f91695 100644 --- a/website/release_notes.html +++ b/website/release_notes.html @@ -35,7 +35,7 @@

Pixelitor release notes

-

4.3.1 - released on 2023-02-

+

4.3.1 - released on 2023-09-06

  • New themes: flat dark, flat light, system
  • UI font type and size in Preferences
  • @@ -43,6 +43,7 @@

    4.3.1 - released on 2023-02-

  • New filters: Abstract Lights, Tile Seamless, Rose, Concentric Shapes, Border Mask
  • Blinds, Checkerboard, Goo and Shapes Grid as separate transition filters
  • Improved filters: Photo Collage, Spheres
  • +
  • Snapping to pixel boundaries
  • Layer isolation
  • Crop to content
  • Adjustment layers, layer groups (experimental)