From bdfa75d27c6a700af52ad54460b9ccaee93f2085 Mon Sep 17 00:00:00 2001 From: strangelookingnerd <49242855+strangelookingnerd@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:25:41 +0200 Subject: [PATCH] Cleanup deprecation --- CHANGELOG.md | 3 +++ .../com/github/strangelookingnerd/PedroProgressBarUI.java | 7 +++---- src/main/resources/META-INF/plugin.xml | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22223e1..f13cfa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ # Pedro Progress Bar Changelog ## [Unreleased] +### Added +- Do not use deprecated `UIUtil.isUnderWin10LookAndFeel()` +- Plugin description cleanup - Various dependency updates ## [0.0.2] diff --git a/src/main/java/com/github/strangelookingnerd/PedroProgressBarUI.java b/src/main/java/com/github/strangelookingnerd/PedroProgressBarUI.java index ae290d5..236c7e6 100644 --- a/src/main/java/com/github/strangelookingnerd/PedroProgressBarUI.java +++ b/src/main/java/com/github/strangelookingnerd/PedroProgressBarUI.java @@ -29,7 +29,6 @@ import com.intellij.ui.JBColor; import com.intellij.ui.scale.JBUIScale; import com.intellij.util.ui.JBInsets; -import com.intellij.util.ui.UIUtil; import com.intellij.util.ui.UIUtilities; import javax.swing.ImageIcon; @@ -260,9 +259,9 @@ protected int getBoxLength(int availableLength, int otherDimension) { } private Shape getShapedRect(float x, float y, float w, float h, float ar) { - boolean flatEnds = UIUtil.isUnderWin10LookAndFeel() || progressBar.getClientProperty( - "ProgressBar.flatEnds") == Boolean.TRUE; - return flatEnds ? new Rectangle2D.Float(x, y, w, h) : new RoundRectangle2D.Float(x, y, w, h, ar, ar); + return progressBar.getClientProperty("ProgressBar.flatEnds") == Boolean.TRUE + ? new Rectangle2D.Float(x, y, w, h) + : new RoundRectangle2D.Float(x, y, w, h, ar, ar); } private int getStripeWidth() { diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index d96fd37..4e1a443 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -1,8 +1,8 @@ - + com.github.strangelookingnerd.pedro-progress-bar Pedro Progress Bar - strangelookingnerd + strangelookingnerd User Interface com.intellij.modules.platform