From 3ca0e13d03a1e4c6b23d368593ef33ef0ec42e20 Mon Sep 17 00:00:00 2001 From: Patrick Ziegler Date: Tue, 24 Mar 2026 20:52:41 +0100 Subject: [PATCH] Add SVG variants for WindowBuilder cursors Using pixel-based images still leads to improperly scaled cursors on Windows if at > 100% zoom. The old cursors are still kept for backwards compatibility, but on latest SWT versions we'll now use SVGs. --- .../wb/internal/gef/core/SharedCursors.java | 108 ++++++++++++++---- .../wb/internal/gef/core/icons/Tree_Add.gif | Bin 125 -> 0 bytes .../gef/core/icons/Tree_Add_Cursor.gif | Bin 1199 -> 0 bytes .../gef/core/icons/Tree_Add_Cursor2.gif | Bin 1185 -> 0 bytes .../internal/gef/core/icons/Tree_Add_Mask.gif | Bin 129 -> 0 bytes .../wb/internal/gef/core/icons/add_cursor.gif | Bin 1064 -> 0 bytes .../wb/internal/gef/core/icons/add_cursor.png | Bin 0 -> 766 bytes .../wb/internal/gef/core/icons/add_cursor.svg | 67 +++++++++++ .../internal/gef/core/icons/add_cursor3.png | Bin 500 -> 0 bytes .../wb/internal/gef/core/icons/addcursor.gif | Bin 1078 -> 0 bytes .../internal/gef/core/icons/cursor@1.5x.svg | 22 ++++ .../wb/internal/gef/core/icons/cursor@1x.svg | 22 ++++ .../wb/internal/gef/core/icons/cursor@2x.svg | 22 ++++ .../internal/gef/core/icons/move_cursor.gif | Bin 1073 -> 0 bytes .../internal/gef/core/icons/move_cursor.png | Bin 0 -> 809 bytes .../internal/gef/core/icons/move_cursor.svg | 67 +++++++++++ .../internal/gef/core/icons/move_cursor2.gif | Bin 1080 -> 0 bytes .../internal/gef/core/icons/move_cursor3.png | Bin 491 -> 0 bytes .../wb/internal/gef/core/icons/no_cursor.gif | Bin 1079 -> 0 bytes .../wb/internal/gef/core/icons/no_cursor.png | Bin 0 -> 896 bytes .../wb/internal/gef/core/icons/no_cursor.svg | 70 ++++++++++++ .../wb/internal/gef/core/icons/no_cursor3.png | Bin 734 -> 0 bytes .../internal/gef/core/icons/noaddcursor.gif | Bin 1074 -> 0 bytes .../wb/core/editor/constants/CoreImages.java | 10 +- .../wb/internal/core/DesignerPlugin.java | 14 ++- 25 files changed, 371 insertions(+), 31 deletions(-) delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/Tree_Add.gif delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/Tree_Add_Cursor.gif delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/Tree_Add_Cursor2.gif delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/Tree_Add_Mask.gif delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/add_cursor.gif create mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/add_cursor.png create mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/add_cursor.svg delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/add_cursor3.png delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/addcursor.gif create mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/cursor@1.5x.svg create mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/cursor@1x.svg create mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/cursor@2x.svg delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor.gif create mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor.png create mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor.svg delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor2.gif delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor3.png delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor.gif create mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor.png create mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor.svg delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor3.png delete mode 100644 org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/noaddcursor.gif diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/SharedCursors.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/SharedCursors.java index 3bc0f0a2e..4c7989c8d 100644 --- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/SharedCursors.java +++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/SharedCursors.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2026 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -12,9 +12,20 @@ *******************************************************************************/ package org.eclipse.wb.internal.gef.core; +import org.eclipse.wb.internal.core.DesignerPlugin; + import org.eclipse.draw2d.Cursors; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.DecorationOverlayIcon; +import org.eclipse.jface.viewers.IDecoration; import org.eclipse.swt.graphics.Cursor; +import org.eclipse.swt.graphics.Device; import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.ImageDataProvider; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.net.URL; /** * A shared collection of Cursors. @@ -23,25 +34,78 @@ * @coverage gef.core */ public class SharedCursors extends Cursors { - public static final Cursor CURSOR_TREE_ADD = new Cursor(null, - new ImageData(SharedCursors.class.getResourceAsStream("icons/Tree_Add_Mask.gif")), - new ImageData(SharedCursors.class.getResourceAsStream("icons/Tree_Add.gif")), - 0, - 0); - public static final Cursor CURSOR_TREE_ADD_MAC = new Cursor(null, - new ImageData(SharedCursors.class.getResourceAsStream("icons/Tree_Add_Cursor2.gif")), - 0, - 0); - public static final Cursor CURSOR_ADD = new Cursor(null, - new ImageData(SharedCursors.class.getResourceAsStream("icons/add_cursor.gif")), - 0, - 0); - public static final Cursor CURSOR_MOVE = new Cursor(null, - new ImageData(SharedCursors.class.getResourceAsStream("icons/move_cursor.gif")), - 0, - 0); - public static final Cursor CURSOR_NO = new Cursor(null, - new ImageData(SharedCursors.class.getResourceAsStream("icons/no_cursor.gif")), - 0, - 0); + + /** + * Local cache to store the cursor data for each zoom level. + */ + private static final ImageDescriptor CURSOR_AT_100_ZOOM = createDescriptor("icons/cursor@1x.svg"); //$NON-NLS-1$ + private static final ImageDescriptor CURSOR_AT_150_ZOOM = createDescriptor("icons/cursor@1.5x.svg"); //$NON-NLS-1$ + private static final ImageDescriptor CURSOR_AT_200_ZOOM = createDescriptor("icons/cursor@2x.svg"); //$NON-NLS-1$ + private static final ImageDescriptor CURSOR_DESCRIPTOR = ImageDescriptor.createFromImageDataProvider(zoom -> { + if (zoom < 150) { + return CURSOR_AT_100_ZOOM.getImageData(100); + } + if (zoom < 200) { + return CURSOR_AT_150_ZOOM.getImageData(100); + } + return CURSOR_AT_200_ZOOM.getImageData(100); + }); + + public static final Cursor CURSOR_ADD = createCursor("icons/add_cursor.svg"); + public static final Cursor CURSOR_MOVE = createCursor("icons/move_cursor.svg"); + public static final Cursor CURSOR_NO = createCursor("icons/no_cursor.svg"); + + private static Cursor createCursor(String sourceName) { + if (DesignerPlugin.isSvgSupported()) { + ImageDescriptor src1 = createDescriptor(sourceName); + ImageDescriptor src = new DecorationOverlayIcon(src1, CURSOR_DESCRIPTOR, IDecoration.TOP_LEFT) { + @Override + // Disabled by default due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=97506 + protected boolean supportsZoomLevel(int zoomLevel) { + return true; + } + }; + return createCursor(src, 0, 0); + } + ImageDescriptor src = createDescriptor(sourceName); + return createCursor(src, 0, 0); + } + + /** + * Creates and returns an image descriptor from the given file. If the file is + * an SVG, it will be automatically swapped out with a PNG if not yet supported + * by SWT. + */ + public static ImageDescriptor createDescriptor(String filename) { + URL resourceURL = SharedCursors.class.getResource(DesignerPlugin.getEffectiveFileName(filename)); + return ImageDescriptor.createFromURL(resourceURL); + } + + /** + * This method attempts to create the cursor using a constructor introduced in + * SWT 3.131.0 that takes an {@link ImageDataProvider}. If this constructor is + * not available (SWT versions prior to 3.131.0), it falls back to using the + * older constructor that accepts {@link ImageData}. + */ + private static Cursor createCursor(ImageDescriptor source, int hotspotX, int hotspotY) { + try { + ImageDataProvider provider = zoom -> { + if (zoom < 150) { + return source.getImageData(100); + } + if (zoom < 200) { + return source.getImageData(150); + } + return source.getImageData(200); + }; + Constructor ctor = Cursor.class.getConstructor(Device.class, ImageDataProvider.class, int.class, + int.class); + return ctor.newInstance(null, provider, hotspotX, hotspotY); + } catch (NoSuchMethodException e) { + // SWT version < 3.131.0 (no ImageDataProvider-based constructor) + return new Cursor(null, source.getImageData(100), hotspotX, hotspotY); // older constructor + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException("Failed to instantiate Cursor", e); //$NON-NLS-1$ + } + } } \ No newline at end of file diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/Tree_Add.gif b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/Tree_Add.gif deleted file mode 100644 index 75d6cc23b6110514ffb9c9edfe5f74e9e346e836..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 125 zcmZ?wbhEHbRA5kGXkY+=|NsB%fM}2i15->(|H|11`2!0!uJT-aEYkg6C67cGZ)RW0 z%yq$4MIV|N-`7Z)*Oge$XTB71VEzX8oSQi!?w>ZFv6#N$iEzrd=Go~$ljJTyU{HQvVAVN2FA-i20|M}*dH=p-; zp7%}OvP0(Gduld9K0E`^8Fj1+Jz&Y_K|X|mZpY-rqu94O;zH{tR#HqZ}j1lr!-Maj}W^ zOzYPETVoD0TpjYYH0#AcI3Qg^-ph;KD37U=3QVJJacL2cqY%VEudV+^ztwA%E~Dd? zszb-;;#?yw`cd=?jtQVD?T0JShfqf6fCBKjriX#~`;f}842D_a<=$TLu^>s{P6oY880O$* z-2k0Sz_q4!Xa~^1%efTaf)c-@kY%c9!3!h+C}31CNZv%cR)L3;Gp2!_VK+WB7<>aY zBgTx^i@Scs!jiL^ZI*yLtAclc0GUkhLJT|HuGoAp6o5V-W|#< zDE#uLygg-2@r5I2$xPF+712KLZT_zE?UligOQeH2LWX4=z|^@x`|$atiD94dy~Dn$ z>RI!-9CzBd_xHA;jF#{Di_yI1>{27~W<$KXV0YPiqN2($S#q$2+EZsr{6!RAqxAGW zlBw!>--V@*_5@N!lhfp!IM2Pa|MK{%cSG}UnY#lAoYg%5V6=DGm3i|= zyFC(XKGzXFfA?gtrKJ5aQNe%oSz+YwtyI%!z&EgN?2F<<`|D1w5@UXCPLo~RFk|u; z*}F|IwD;F{Wo<(PrdvA)#xx&_S8tPBimsOG-{OyIHsPN;BXC5hC-N$}pNBP@vX)y= zQ(up1TWfc~tDLU2Fs-cWXf)%<4!~?({Q8B2rXbCq-lwb)u|@giV|)veKBkbqk^rR##-VOWMI6A0Iz{{N8)N z_ddSD3#PMKRfixMo&sP;FtQzq9+4YIbUTfT5p80zdc=6p(((%D=BRekwt$Fc6#OH| zx*1e~Xg3?ey9<>b{Ep`ic8`+JClBlpBalf~-ZBAw*RWTqDQW8LAmEy~uFXNL`}VAFNy5R<@U* zTWD}>!B5?Aod>uIpo)hc0KRHi;-e*aC_$9OL4$u=g-7_WwD2cDo2&pRRvg&)56=KJ z0hB>FrU0q|6c8_CYixvyT;3{p!~-6|q?|7&<1hm-*a1(|02jhV^>B6zpc}?sxPeGl z0O^0H0dSS#1z-FG52Zn?0KA;wm1}Ot!2#KOBq6?^7%@_ z7~n}KEHh9jqm;jq0w58LVLJRL4yfgqnP1DB@XiY8p9vd9cI}nqojCkrQBQPxxt3f6{rReVeckEVHdR7ndRsnixtf3YFy<8wMh$%2W>;%w iT4S)&W%HlE<#PyhikP?1mHRADEXp8yL`0r5dH3``L$O)F3Lmd%;N=+-rP@65b= zmhuvM%8_>Ir{=J&-k~3JGGp7NTPxmAyt?{lo}z$(M6-hLsRg;ys)W=pTnh=3{bZvd et+u+TcK4=@CCPT?iE&Z0W6O>|Omb&rum%9Je=p+z diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/add_cursor.gif b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/add_cursor.gif deleted file mode 100644 index b5a819008adc9c7f41e801bc4ed58801c0671fb8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1064 zcmeHGT}YE*7(LT{-`wB3KmQ7Uw$cJoFfg4+GDRvY1%DusF08De!pjg$*mP=BvXX{E zX|83NicM2=&fzw7Gf`ZKq~%Q}XklPrg%G~^QI~;TblKtIT%G3}&I8Yh?Bm*$^J=KE z1`gsDh#o=E0kIXrE{J*|?E*6dH~=T4Hc0zH`XC(w82}lCcm!exM5B-lLuv=HLpBWJ z02u`tgW@TItx$9#q#KG+V3L84WnEy$A@G2i1m6qB2TZe=L*NY9DPUGiJRsvBK9Fh1 zW`Wl-yxnCv=9O639Tk@L<6Q)nqe5q(^dn>eSk~YpgAF0RDH$4tmBaXc0AG{vBSlD) z!)dX4r<_vCHT(+=eOW;VD(PV5=hj-7f1|x@4nkF1k7OE9JLl+`NZuu#)q)RsA_)uXV1@fBd@(Xtw!0&MlrJ?k5nmgXVai z&era(4pJ%4JuYqc)X8~?*Tef(+@|1!;)#~LgISG{#}4uLdSd5XP2%mSkgl!ux%;^f0v6qtxVp&X3gxPNHK_3g z%PtyCYLg-|DKo~Er|ZcjC+j6{O<-2NLdzdMYX2ZmM5mV73N-=VdR|dZnf!vaRuUS2 z_Ds3ueYLdzl$mq+yxe8-DAAP!&^j)n8&TTr#JTt-EqV)rLrx vu5L`#>+UcKNu{^G=zV%;oPfV>aPy3;$D)efv{c-9#(&PHkBQPR>yY*n6AwGu diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/add_cursor.png b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/add_cursor.png new file mode 100644 index 0000000000000000000000000000000000000000..f43a2fde3508f3277cc6ddbb791d8422231b7688 GIT binary patch literal 766 zcmZ{gdq`6O6vjW@D>v_T&PO7pCe24nyG}7360hxsbdVGHgMOmsc=r zv9XV7&1)2i8F4S`CMJ*BFCCLOOXOH=)HAnPBxk6@OWBOJZ0_yZFQzO*kau zwsikU@0?NVHG%=lierT?xl|L! zUba~6tGgeXL_wJgCVDTvW@{bguEH-u&8jzZu~@In(rfeeI$7Zv9V3uZ(%1+pIzk$g z5fv|sijz^X5{i;hRHZmn@E1^eT3cLn?*9O + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/add_cursor3.png b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/add_cursor3.png deleted file mode 100644 index 543c56e5982dfb5889f68d6fe9a522e1f0aba64f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 500 zcmV z0GO`1bKC#`010qNS#tmY4#WTe4#WYKD-Ig~00ERqL_t(|ob8ppOT$1I#-EF!gH^g% zp+h$Zr$R0G7Zh<2oLyWBi9?~bxJeMdP)H%|RtqjJ4uV6w6~|76)KUL}X0fGn2|0(0 zN61&BG=tD*dhhPN_m}6sLI41$!3XCn@V;A$_N;RY<6 z;R9GKgRpY`V}y9`ho(z}5K3va(2fG|cfjQJq3M#MbO@0ZrK9Q6-vQ)D0Gtd$h^qDg zsA`Xm&Xwq@%a<$Y@t7sok;E)YZ5JTqi`cr`jZB93H-<6*(=^X^ALju0elio3Qr@HK zlJfL%`}}Fo$Y$*+`>!lGKiaMjNHUeK-l^5ReewrMR78j qToqqp0sK~BkKGcm1S|pn1@H}6W2#(=a`Be{0000y3Hzzbw{&(Z#!B3irjAu1POnn^C?ep<+u)-Nvk%T`9GD(rWjmSMJTL-I-OpGrN9gZo$Fi z%7ZCY$Fge^fB0f2g+eM19x!+9~@Rdrmj@ooVU2)I8~E!_)&!(~q}KKhrw-Y{!h#Z8Ofa z&p6XH>)^E62d7WD+%@fT=hQ1*)2?(+zuGNAFSW^XxrW=+YaB}apcawpMQo?zhk$H2_Wx^7_GT8(4&r+h(&Rhlo`MA3MP>s-r)Fp;7fD^Hh^p zF&_ + + + + + + + + diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/cursor@1x.svg b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/cursor@1x.svg new file mode 100644 index 000000000..cd22d6738 --- /dev/null +++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/cursor@1x.svg @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/cursor@2x.svg b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/cursor@2x.svg new file mode 100644 index 000000000..1b3f3ae79 --- /dev/null +++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/cursor@2x.svg @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor.gif b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor.gif deleted file mode 100644 index d72830d8d186c252e882cdfdc028e00bdeba5f0a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1073 zcmZ?wbh9u|RA5kGc+LO<+%p)s<}z6h2DTFnEGO7lPqVX}VP!hY&3u-N`8*fPDGsg!jC_X}7%y`(Uf^fE#K&-p zf#EhA!$kqc%K{8ng&41kGu#kiyeYzPQ;Ok^9Mc_Hrn|B%_vFORFo<4dV7srv@RF6` z4JX4lA=dwLEDw|!zAG{OG3WemCh_?dgw|9e~h?{EFTbJG94 zQ~w`m{eP_c|FL=hFVFpdcESJaOaEV3^Z(|C|IZKn|8N3o0z}Q>sRWd5tp%CCp$WSc zgtUWWY?Po{2q^w!VFVeb10q0qf`Q{7!|D)5hYbr3HggCIt#L|SaHw5?(I7`+$T+2CROitE%9A*ID=I^8!eL8)%*;4esa2S_N$Z^ z1}o0D8uZGEuKM!g{1m_0Ocx3lzG9U%s}|bxq1mH%JsaDNmd*nw1f=z2YE}d~tU1T+ zTETMAu-TQ9-B`0J6J*R&4j3ppaf%8sZKB(v6=PMMt)=Y1q*8`mb0vk+uvoE=D=VL0MTVk AZ2$lO diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor.png b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor.png new file mode 100644 index 0000000000000000000000000000000000000000..68220fa5c262ca4269acc797914e6786ea149632 GIT binary patch literal 809 zcmZ{hc}Nst7{;F&cXoBx9k0bz%I>DRJ@R;5hCc1UijXJ=jHqH@P6N=Fyn5y)J+ON zZV1vv2)cUtSX&8QS9ZB=*(3%=2;61FT3dHivHm2r_JM zlwPNQqv1yceSfHdS!tIq|TE=+j#A zg8~B#(MMZ#OQ}{d_ccX&9~h-D=PvrFB!?8lyA?#gy;YBt>XgI{#)>=OPyvcp;*BF= zVYrcG;*}lQEfc-8jvG8cH^ZR`&eg!U4cf&-zbt0xpr}I}XNgT5;OHh`5TY)s;7fkO zYtF6_4wZ0z1F990HZpD?hJFV6DddkJuY$ChkiH<|Uvmll9Bl^u7_w5x>p-`lXe3{D z2l6MN8$j3NMk`}0JON>fFh(Na>%ie=mxR%@ zK^GXcr8BqJvcDz3R{Y7xc?U8KL;2ZL;iHZ9l|gz9#RLxX`--z?yb2f6rc0*3c@)?e z>>zV&Tyw}w2h>EPB$~W3FKLP<_UB|dRV%V5PqW?|Yy-YeJU{w2yRM_J)p}R_RxgcR zaYxY)bNJ_iD>dzY8YjbP*{Jf!)>|Jf-Qz!xWR%s}(bukqPUZHy7q4k(Kl|`p_|qnH zEqP|@LQ3QFXL)&?;z4gdO(}1N3SXz1$Q7mX4bv6(-jB^LCgpCQ%$r!ny3Kjsi0x|$ z<&Q6ZnDJDq^IjAVm+(u$Cu&8(&gYfeWY^ER+}+t{W^PYfuPhSQUuV)so08&9$=bw| z$$~)5syC}xf0d7K6zi|`VYQpp8(CJ%vXSM1#(#j+w4`H)&;B29pI?{~fc1Y9Ovh4_ oGfeTR>C22p#coomeWQGY5Pz-jpOBs^zFA;k&>MBNyAEal26jspVE_OC literal 0 HcmV?d00001 diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor.svg b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor.svg new file mode 100644 index 000000000..410f85be6 --- /dev/null +++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor2.gif b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/move_cursor2.gif deleted file mode 100644 index 8fa3c9858772baabe4592c3e9292aa426b9c1913..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1080 zcmeH`TS(J!6vxl+zyD?XZ~Hsv)J<~DD;gO-lnN2JvWr$?CLz+pLVYP8e26eIGIco7 z5|)p(&iPl)JzO5gbJh(#9vyy^yEvA9S)zT?>Ps)U(V^oQ*p6Z zRG@-Y*ezi-u+M>M0AU>njKDU7*a%byh|M5w1FjXs9l*T;t{qql683|*2e>Zq>IAME zxE>Jog18Sv{UEX+t`|59csGKq4!oPd_a%7u0yt@&lVWTHWe3KwLz1%7jGbg0B;%yO z1GEcB7frop$PtQg^U)|vj0$<9EYHJ|Za#kyu>(6zur@+4M2H3vX9dm%oD(=Vph+Pb z^Fk9Gyajki!?*-ZN?=L~(^53!53@2fCxf{Fm{$_>fy6=}xv2CT0pDq$--p5{3f2Yi zT}ojkxfB9Ff?+FGfMeu1L$#fUG2Sr;cj<9o6&}!HM;UfJ!;??(r~%J3;4u@PGvn0( z{MGeG`CDVF+C$cU8=H!-xe)gh;=W>R(f)N}ukl}r{l`CZAZU|ByUPylV)rM2zYUgr z6mK>R7V&+gTg%x7Yl#F!=g3=^2TNs98AH_Vr0be&;e!^M zo-HmllsybTsWWL(<4te4%Z-|wFA`kkKIh2JBMNPjUqrHAUi%@~?&Zfb*R14H!}<_) z)>KNZ%}Go4r`>3h5@$s6sFao2@e@29S5soj3$hOJ_bCqLROeqf-)3Q>T z=91!LK_wHbO4r4!kMks@nVd=$hAPAXF^6ZPH7#z0>iyC*OB!_j%LG%9erGXKZCq&S Ju24we=uZz z0GO`1bKC#`010qNS#tmY4#WTe4#WYKD-Ig~00E0hL_t(|oMU8QU|?Wi$Tyt9KpVis zz`*eT|Nn{SGiYc5P3>TUvuI=o6EcSub}*swscr|l1yr{Kiv`rR1G@!Ov;(IFc0WdvFfvX&`Hewd9;@tc28QYl zPg~bV;Ie~-0X4Yu4QD`N0`9H<|NrL%sdwyukKG5%jIEKfGdxOin9SjT%4AR^T2YeZ(ILyTF zJ{J7am_U)2fuD_mpN(O!4`I`BS^$X&25h-umh;Tp$I|)P7|Kito6dkMh^Pqgl|`c# hj9M^i!KejL002T#s)WyKX{!JL002ovPDHLkV1hsZ;AsE= diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor.gif b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor.gif deleted file mode 100644 index 77cfaeab8fec15d66b0698c5c022ef8ab88f2824..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1079 zcmZ?wbh9u|RA5kGc+LOM57vGh zYwszA9w+yTQNrwNEjsK?@{ZBRdpKAI)-Qs_S`Tq>d|5-p}{Xg60e~!)nJo}S% z#gDUGzU908&v*D%?D3_<<7>6=|02i#Mb7_=T>cjWk?a3bkN;&J|I0o9S9tud^!{Jv z^B<_D&i`{o#Fx7GKb1lMDue#l2mGrKIn`Ktv8nh{TiNa2@;jZScP7^SZw&n36!fn- zYoWo|0gB>pPur6M#}%0Y5(VC|DRp^ ze^KuL#d-gi3|4Oo?zhk$8dWKqr-*;2b(#Bg>nw3EjZLJ zz-W*ovGLKtP7&RxBQpY(UHW8g)mS8hmN-sQ_4P_Qyh+u&T}yn|9L``>&qj;nbu~YO zo}Zj9oc${0g~5vRtp>evqN~2VI6uX2Hq(tqibvSlta84oSTy;}(o1O6*uZIga+Y!Y zI*-UpPu-d3D_xl)dHE>U6jkS48x#a4vr8B!?a5g9$i;Jln7i1M083_HF`ckgE|En` z+PMTgQdZOmxSg6ZGsh>#A<1DWv!2hahGzkdTfC(FJ0vufjvVh6QPA@^v8JfKSKTyW zPefr8a~r1z*PV{a14o5LR2?#Q2q;!&&gJm1IhoMN#G=ByPV~3P1%}Q_6~-g-M+FZz OG)lR$! diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor.png b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor.png new file mode 100644 index 0000000000000000000000000000000000000000..a675bedab610dbc223145b75d7605321d9e50fc2 GIT binary patch literal 896 zcmZ{geN2;A6vl5`3EGV*R*Uj2&B}?|lPIAu4bMO7# zC+E2HH92AYXg(n%Or>PBY>!{c3sf=-7Ue=U6WAm9wxjO%Ml~i+VrCeZoN(<7 z=EgibT#ET?xYLKrE{xdGTa9Ce#RIxOa$gEsmH63@TRu!4!mu5uO>h^XUU^q4n0;>_ z#*Se66#OnswBlkD&RKABFOHO;tq}HY@a&!|*zi?b?K8U;HwST{3FjMe&W1BpXxV{U zC8{^WZ45TQwNNg@L^sZwVP^1-d@ftCP$I(M0rVK)Eko5Nye(N|KRMonL$AZL3!XP{ za3`Evu(Q~dD3`)O&$?}k`*ql#kLK;DQ^CTZQVOH!?v}XETWoVVF=)txMFI0x?3F{G zKF>tMoQ=wjD9?mZjMB94H%5Oa3V&3XJd+;rrPK1LzUX?hB^aE3ja?m*<3iwy?<$|!HtiuLiQxc%fZ z|1ftv+0UOJa3uN9a6cfU{2uO!myoSR`+BpM?M z#kMfD&=j*LD}^5nd%nZqQ8Tu@=_z5#NYd~}ks~dP??ay}D>CGTPR)%~A*n+}5g(5= z);HLnK7QhT8d`iYfx4C@xtb}ON|awop!vr$PwQv(fvLb>f|P`j8M4f+`t|zyfr`in zk{@4;qG_Qc{<-(%ysfpJ6HS^_-U>nzUy1wLyXMwyc0q|&MUmA|Vl~S2W+U4OP0?Z@ zB^9QLbd*$Fi@t?o3K+?Ys)(Vr+Vl6S%EHN2E gDqTp6bZM-KR3=XU$E2?=*v&FTrO+@#TZ)~31JKlZ9{>OV literal 0 HcmV?d00001 diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor.svg b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor.svg new file mode 100644 index 000000000..cc552c222 --- /dev/null +++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor3.png b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/no_cursor3.png deleted file mode 100644 index 3e482ff7e3ebc958e11dc76f2eb03cd809f93334..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 734 zcmV<40wMj0P) z0GO`1bKC#`010qNS#tmY4#WTe4#WYKD-Ig~00MqVL_t(|oMU8QU|?Wi$Tyt9KpVis zz`*eT|Nn{SGiYc5P3>TUvuI=o6EcSub}*swscr|l1yr{Kiv`rRgArmJb~#2ywEWS3 zHVq;U(NbtUiy{kZxYpPxTJK7A^zq!d1Lrh=VanZ1{uQ>StY38fr7$Ra9Q=dc{B1&BySb2YN~xxPN8 zSFcp`^}n7!f2OPJ&!eHhdOfrWSNXw{Huwu?d@- zyDVL*YGdtR)kXBXY{`QUG)2CPe{#hA=g*%wEg)DE{Qv)7#>Iu}>C-n;r*d<1zhz<3Te3vX!Qto9 zrB5?6IiEa{c5?din(5TcEV`zo6is6DMA$ zr~kTkjagDs`p}^}zkkn+K7=!f@Pi_g*^CMbQVSOfNJ#wa?*3qC_(?jqckL3$%i|Fh<$U&xTTqZcBSUce_GhZ9z5d(q zxQ{^kK?BVPquAKk*x1;9{`~pn%a<0nwFI@0W&s(1a2$+UFlxc51%uxL04%>H&P-zm QQ~&?~07*qoM6N<$f=kI~UjP6A diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/noaddcursor.gif b/org.eclipse.wb.core/src-gef/org/eclipse/wb/internal/gef/core/icons/noaddcursor.gif deleted file mode 100644 index 2807e1e615afc441c42d67da4b30fe1d61e5a353..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1074 zcmZ?wbh9u|RA5kGc+LOL(V1yoJ$HmksW#_Bm7!I$kp8B+Zidhvor2yXWhxmyj+-a zr=s{?W%08xpJx$1&m#R^M*6;t_J0-@@GL6md2HmXn1DC&ArDex-lYY-Opbn)7V|DE z?n6r0=i=DM*@=(yk{{+5JSs?gR9*U{qVQ2g#p8;~hxN6O>T6zB7rdw{eOX`esXX~} zW%8@$+IKCr@7wC$b(MZ=%J|lj^P#oiLv!_qp7M`0=@$KZkca!?R^fmsP)&6U4_s2QYKF*!?aOJ!QtLA@MFz?Hv zd0!XL|FwAH@0D|Yt)BaG!ppDV_T%urKgW0dJbmQnQuXz^a(I)fce|GOt~s2+s-BG&$?Ix<20cGHT{!zy$_s-P=UWYW40$f?2oQ{B=@5$NbLl+E*d`^S?$YwZ;ZS!glbz}k p3*nSjPK8)0mI5iqgMC_|SppIY52id2 { - URI uri = URI.create("platform:/plugin/" + bundle.getSymbolicName() + "/icons/" + effectiveFileName); + URI uri = URI.create("platform:/plugin/" + bundle.getSymbolicName() + "/icons/" + DesignerPlugin.getEffectiveFileName(fileName)); URL url = uri.toURL(); return ImageDescriptor.createFromURL(url); }, ImageDescriptor.getMissingImageDescriptor()); diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/DesignerPlugin.java b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/DesignerPlugin.java index 7eb9a9bc7..e6675b620 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/DesignerPlugin.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/internal/core/DesignerPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. + * Copyright (c) 2011, 2026 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -418,6 +418,18 @@ public static boolean isSvgSupported() { return isSvgSupported; } + /** + * If {@code fileName} ends with {@code .svg}, the extension is changed to + * {@code .png} if not yet supported by SWT. + */ + public static String getEffectiveFileName(String fileName) { + // If the SWT version doesn't yet support SVGs, fall back to PNG + if (!isSvgSupported() && fileName.endsWith(".svg")) { //$NON-NLS-1$ + return fileName.replaceFirst("\\.svg$", ".png"); //$NON-NLS-1$ //$NON-NLS-2$ + } + return fileName; + } + //////////////////////////////////////////////////////////////////////////// // // Linux only