From f5d14a5d6685857a30e5d35df56b7b977dcb5689 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Fri, 2 Aug 2024 02:51:26 +0000 Subject: [PATCH] plug-ins: Convert custom GFig icons to vectors As in f9df9805, adds SVG versions of GFig custom icons and conditionally uses them if have_vector_icons is enabled. If not, we fall back to the original PNG icons. Also resolves #10012 by adding white outlines around the thin dark lines to make them more visible in dark mode. --- plug-ins/gfig/gfig-dialog.c | 2 +- plug-ins/gfig/gfig-icons.h | 1 - plug-ins/gfig/images/gfig-bezier.svg | 61 +++++ plug-ins/gfig/images/gfig-circle.svg | 70 ++++++ plug-ins/gfig/images/gfig-copy-object.svg | 160 +++++++++++++ plug-ins/gfig/images/gfig-curve.svg | 81 +++++++ plug-ins/gfig/images/gfig-delete-object.svg | 111 +++++++++ plug-ins/gfig/images/gfig-ellipse.svg | 70 ++++++ ... => gfig-icon-legacy-images.gresource.xml} | 1 - .../gfig-icon-scalable-images.gresource.xml | 20 ++ plug-ins/gfig/images/gfig-line.svg | 68 ++++++ plug-ins/gfig/images/gfig-move-object.svg | 173 ++++++++++++++ plug-ins/gfig/images/gfig-move-point.svg | 142 +++++++++++ plug-ins/gfig/images/gfig-polygon.svg | 66 ++++++ plug-ins/gfig/images/gfig-rectangle.svg | 71 ++++++ plug-ins/gfig/images/gfig-select-object.png | Bin 552 -> 0 bytes plug-ins/gfig/images/gfig-show-all.svg | 221 ++++++++++++++++++ plug-ins/gfig/images/gfig-spiral.svg | 71 ++++++ plug-ins/gfig/images/gfig-star.svg | 79 +++++++ plug-ins/gfig/images/meson.build | 39 ++-- 20 files changed, 1488 insertions(+), 19 deletions(-) create mode 100644 plug-ins/gfig/images/gfig-bezier.svg create mode 100644 plug-ins/gfig/images/gfig-circle.svg create mode 100644 plug-ins/gfig/images/gfig-copy-object.svg create mode 100644 plug-ins/gfig/images/gfig-curve.svg create mode 100644 plug-ins/gfig/images/gfig-delete-object.svg create mode 100644 plug-ins/gfig/images/gfig-ellipse.svg rename plug-ins/gfig/images/{gfig-icon-images.gresource.xml => gfig-icon-legacy-images.gresource.xml} (93%) create mode 100644 plug-ins/gfig/images/gfig-icon-scalable-images.gresource.xml create mode 100644 plug-ins/gfig/images/gfig-line.svg create mode 100644 plug-ins/gfig/images/gfig-move-object.svg create mode 100644 plug-ins/gfig/images/gfig-move-point.svg create mode 100644 plug-ins/gfig/images/gfig-polygon.svg create mode 100644 plug-ins/gfig/images/gfig-rectangle.svg delete mode 100644 plug-ins/gfig/images/gfig-select-object.png create mode 100644 plug-ins/gfig/images/gfig-show-all.svg create mode 100644 plug-ins/gfig/images/gfig-spiral.svg create mode 100644 plug-ins/gfig/images/gfig-star.svg diff --git a/plug-ins/gfig/gfig-dialog.c b/plug-ins/gfig/gfig-dialog.c index 7a923a526d..94666cc0e8 100644 --- a/plug-ins/gfig/gfig-dialog.c +++ b/plug-ins/gfig/gfig-dialog.c @@ -408,7 +408,7 @@ gfig_dialog (GimpGfig *gfig) _("Copy"), _("Copy an object")); add_toggle_button (toolbar, "app.shape::delete", GFIG_ICON_DELETE_OBJECT, _("Delete"), _("Delete an object")); - add_toggle_button (toolbar, "app.shape::select", GFIG_ICON_SELECT_OBJECT, + add_toggle_button (toolbar, "app.shape::select", GIMP_ICON_CURSOR, _("Select"), _("Select an object")); add_tool_separator (toolbar, FALSE); add_tool_button (toolbar, "app.raise", GIMP_ICON_GO_UP, diff --git a/plug-ins/gfig/gfig-icons.h b/plug-ins/gfig/gfig-icons.h index 4022a33e84..ac6bde0d38 100644 --- a/plug-ins/gfig/gfig-icons.h +++ b/plug-ins/gfig/gfig-icons.h @@ -36,7 +36,6 @@ #define GFIG_ICON_MOVE_POINT "gfig-move-point" #define GFIG_ICON_POLYGON "gfig-polygon" #define GFIG_ICON_RECTANGLE "gfig-rectangle" -#define GFIG_ICON_SELECT_OBJECT "gfig-select-object" #define GFIG_ICON_SHOW_ALL "gfig-show-all" #define GFIG_ICON_SPIRAL "gfig-spiral" #define GFIG_ICON_STAR "gfig-star" diff --git a/plug-ins/gfig/images/gfig-bezier.svg b/plug-ins/gfig/images/gfig-bezier.svg new file mode 100644 index 0000000000..24cbfa50f3 --- /dev/null +++ b/plug-ins/gfig/images/gfig-bezier.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-circle.svg b/plug-ins/gfig/images/gfig-circle.svg new file mode 100644 index 0000000000..bf148b6774 --- /dev/null +++ b/plug-ins/gfig/images/gfig-circle.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-copy-object.svg b/plug-ins/gfig/images/gfig-copy-object.svg new file mode 100644 index 0000000000..0dd61541ee --- /dev/null +++ b/plug-ins/gfig/images/gfig-copy-object.svg @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-curve.svg b/plug-ins/gfig/images/gfig-curve.svg new file mode 100644 index 0000000000..980ea73ce8 --- /dev/null +++ b/plug-ins/gfig/images/gfig-curve.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-delete-object.svg b/plug-ins/gfig/images/gfig-delete-object.svg new file mode 100644 index 0000000000..ce1e5d1fe5 --- /dev/null +++ b/plug-ins/gfig/images/gfig-delete-object.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-ellipse.svg b/plug-ins/gfig/images/gfig-ellipse.svg new file mode 100644 index 0000000000..29742be593 --- /dev/null +++ b/plug-ins/gfig/images/gfig-ellipse.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-icon-images.gresource.xml b/plug-ins/gfig/images/gfig-icon-legacy-images.gresource.xml similarity index 93% rename from plug-ins/gfig/images/gfig-icon-images.gresource.xml rename to plug-ins/gfig/images/gfig-icon-legacy-images.gresource.xml index eef7739c69..4c3f8f636c 100644 --- a/plug-ins/gfig/images/gfig-icon-images.gresource.xml +++ b/plug-ins/gfig/images/gfig-icon-legacy-images.gresource.xml @@ -12,7 +12,6 @@ gfig-move-point.png gfig-polygon.png gfig-rectangle.png - gfig-select-object.png gfig-show-all.png gfig-spiral.png gfig-star.png diff --git a/plug-ins/gfig/images/gfig-icon-scalable-images.gresource.xml b/plug-ins/gfig/images/gfig-icon-scalable-images.gresource.xml new file mode 100644 index 0000000000..bdca46a671 --- /dev/null +++ b/plug-ins/gfig/images/gfig-icon-scalable-images.gresource.xml @@ -0,0 +1,20 @@ + + + + gfig-bezier.svg + gfig-circle.svg + gfig-copy-object.svg + gfig-curve.svg + gfig-delete-object.svg + gfig-ellipse.svg + gfig-line.svg + gfig-move-object.svg + gfig-move-point.svg + gfig-polygon.svg + gfig-rectangle.svg + gfig-show-all.svg + gfig-spiral.svg + gfig-star.svg + gfig-logo.png + + diff --git a/plug-ins/gfig/images/gfig-line.svg b/plug-ins/gfig/images/gfig-line.svg new file mode 100644 index 0000000000..e3128a9a11 --- /dev/null +++ b/plug-ins/gfig/images/gfig-line.svg @@ -0,0 +1,68 @@ + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-move-object.svg b/plug-ins/gfig/images/gfig-move-object.svg new file mode 100644 index 0000000000..1fe41176a6 --- /dev/null +++ b/plug-ins/gfig/images/gfig-move-object.svg @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-move-point.svg b/plug-ins/gfig/images/gfig-move-point.svg new file mode 100644 index 0000000000..431bce109c --- /dev/null +++ b/plug-ins/gfig/images/gfig-move-point.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-polygon.svg b/plug-ins/gfig/images/gfig-polygon.svg new file mode 100644 index 0000000000..108c2ce4d4 --- /dev/null +++ b/plug-ins/gfig/images/gfig-polygon.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-rectangle.svg b/plug-ins/gfig/images/gfig-rectangle.svg new file mode 100644 index 0000000000..182207fd11 --- /dev/null +++ b/plug-ins/gfig/images/gfig-rectangle.svg @@ -0,0 +1,71 @@ + + diff --git a/plug-ins/gfig/images/gfig-select-object.png b/plug-ins/gfig/images/gfig-select-object.png deleted file mode 100644 index 3ac980b6bf43eb8fb5be0fb45190ec4c1c46c751..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 552 zcmV+@0@wYCP)XJxKkosGIlWWk?}!naYs?kbc&#}*6FO@PD?2+I z6Knqg{s9vI1xjiNhCm3bgk~!X6B}e#et2UukF2nA`|hrBlgVb^%g*P0XJ%&>{`bpl zSs=UR1z0YZGM~>Sj$@fjCerP8y&$L3 zjWK^&xm>2x=>UArlK9N>9Kc#jrBb2YZfAm6U*}0BtyU`u*#ipeKD|S<4y)B_4sr{) zqCU;~*XpGr3`4>&q*|@I?YHW@u-<;W6j*Dq*3xJ+obz|UYv2p;Q+t(om8poxcs!PR zy)J+RK_F2Sxl;WAya1kPh%RT%>k80pHk~s8YJkLXEd74ptsMi8fgPW!T=gQgkH9P7 zB_PA$P^QzV+j|e}>w$7UbD{{8fTzGS;0QPX-lV8F0`8}rjd)WHqlVTy|9 zz#~1B@llc2#1-{)1r5b + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-spiral.svg b/plug-ins/gfig/images/gfig-spiral.svg new file mode 100644 index 0000000000..76f67b0a30 --- /dev/null +++ b/plug-ins/gfig/images/gfig-spiral.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/gfig-star.svg b/plug-ins/gfig/images/gfig-star.svg new file mode 100644 index 0000000000..e68854465a --- /dev/null +++ b/plug-ins/gfig/images/gfig-star.svg @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + diff --git a/plug-ins/gfig/images/meson.build b/plug-ins/gfig/images/meson.build index 4131d683cb..2539f7064c 100644 --- a/plug-ins/gfig/images/meson.build +++ b/plug-ins/gfig/images/meson.build @@ -1,24 +1,31 @@ +icon_type = 'scalable' +icon_format = 'svg' + +if not have_vector_icons + icon_type = 'legacy' + icon_format = 'png' +endif + stock_icons = [ - 'gfig-bezier.png', - 'gfig-circle.png', - 'gfig-copy-object.png', - 'gfig-curve.png', - 'gfig-delete-object.png', - 'gfig-ellipse.png', - 'gfig-line.png', + 'gfig-bezier.' + icon_format, + 'gfig-circle.' + icon_format, + 'gfig-copy-object.' + icon_format, + 'gfig-curve.' + icon_format, + 'gfig-delete-object.' + icon_format, + 'gfig-ellipse.' + icon_format, + 'gfig-line.' + icon_format, 'gfig-logo.png', - 'gfig-move-object.png', - 'gfig-move-point.png', - 'gfig-polygon.png', - 'gfig-rectangle.png', - 'gfig-select-object.png', - 'gfig-show-all.png', - 'gfig-spiral.png', - 'gfig-star.png', + 'gfig-move-object.' + icon_format, + 'gfig-move-point.' + icon_format, + 'gfig-polygon.' + icon_format, + 'gfig-rectangle.' + icon_format, + 'gfig-show-all.' + icon_format, + 'gfig-spiral.' + icon_format, + 'gfig-star.' + icon_format, ] gfig_icon_sources = gnome.compile_resources( 'gfig-icon-images', - 'gfig-icon-images.gresource.xml', + 'gfig-icon-' + icon_type + '-images.gresource.xml', # source_dir: meson.current_source_directory(), )