This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new 1c1b7f3969 code hardening on taskbar icon for hop, fixes #7051 (#7089)
1c1b7f3969 is described below
commit 1c1b7f396972dcb64823bf3c2fd3cc91f88535fe
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Mon May 4 16:09:12 2026 +0200
code hardening on taskbar icon for hop, fixes #7051 (#7089)
---
.../main/java/org/apache/hop/ui/core/gui/GuiResource.java | 15 +++++++++++++++
ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java | 6 +++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/ui/src/main/java/org/apache/hop/ui/core/gui/GuiResource.java
b/ui/src/main/java/org/apache/hop/ui/core/gui/GuiResource.java
index eb2f878a4f..78bea972f9 100644
--- a/ui/src/main/java/org/apache/hop/ui/core/gui/GuiResource.java
+++ b/ui/src/main/java/org/apache/hop/ui/core/gui/GuiResource.java
@@ -1256,6 +1256,21 @@ public class GuiResource {
}
}
+ /**
+ * Multi-resolution icon set for {@link
org.eclipse.swt.widgets.Shell#setImages(Image[])}. Giving
+ * Windows the standard sizes (16/32/48/64/128/256) lets it pick a precise
match for each slot
+ * (title bar, taskbar, alt-tab, jump-list previews) instead of scaling a
single 16x16 up to 64x64
+ * — which is what made the taskbar icon appear correctly only
intermittently.
+ */
+ public Image[] getImagesHopUiTaskbar() {
+ int[] sizes = {16, 32, 48, 64, 128, 256};
+ Image[] images = new Image[sizes.length];
+ for (int i = 0; i < sizes.length; i++) {
+ images[i] = getZoomedImaged(imageLogo, display, sizes[i], sizes[i]);
+ }
+ return images;
+ }
+
public void drawGradient(Display display, GC gc, Rectangle rect, boolean
vertical) {
if (!vertical) {
gc.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java
b/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java
index 7d4faea14e..703485d69a 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java
@@ -447,7 +447,11 @@ public class HopGui
/** Build the shell */
protected void open() {
- shell.setImage(GuiResource.getInstance().getImageHopUiTaskbar());
+ // Hand Windows a multi-resolution icon set so it can pick the right size
for each slot
+ // (title bar, taskbar, alt-tab, jump-list). Passing only one 16x16 image
left Windows
+ // scaling up to 64x64 for the taskbar, which sometimes worked and
sometimes fell back
+ // to a generic icon depending on DPI and the icon cache state.
+ shell.setImages(GuiResource.getInstance().getImagesHopUiTaskbar());
/*
* On macOs the image gets loaded too soon, add a listener to set the
image when the shell is