From a5d9c6fa46c9957e6ba9db68f8e03adef43fd340 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 28 May 2025 01:34:38 -0400 Subject: [PATCH] Fix button images in toolmanager This was reported upstream in https://github.com/matplotlib/matplotlib/issues/30116. --- 0001-matplotlibrc-path-search-fix.patch | 84 ++++++++++++++++++- 0002-Unpin-NumPy-build-requirement.patch | 4 +- ...sion-to-2.13.1-and-update-tolerances.patch | 4 +- ...Unpin-meson-python-build-requirement.patch | 4 +- ...windows-implementation-on-32-bit-x86.patch | 4 +- 5 files changed, 88 insertions(+), 12 deletions(-) diff --git a/0001-matplotlibrc-path-search-fix.patch b/0001-matplotlibrc-path-search-fix.patch index a189044..5b84edf 100644 --- a/0001-matplotlibrc-path-search-fix.patch +++ b/0001-matplotlibrc-path-search-fix.patch @@ -1,12 +1,13 @@ -From fde31cca645d54c6f019d4882b6fe4e71a6dc946 Mon Sep 17 00:00:00 2001 +From d6ce8e5420b08b80203391f4172442249012087a Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 27 Sep 2017 19:35:59 -0400 Subject: [PATCH 1/5] matplotlibrc path search fix Signed-off-by: Elliott Sales de Andrade --- - lib/matplotlib/__init__.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + lib/matplotlib/__init__.py | 5 ++++- + lib/matplotlib/backend_tools.py | 16 ++++++++-------- + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index ad4676b11a..b925a4a703 100644 @@ -38,6 +39,81 @@ index ad4676b11a..b925a4a703 100644 yield os.path.join(get_data_path(), 'matplotlibrc') for fname in gen_candidates(): +diff --git a/lib/matplotlib/backend_tools.py b/lib/matplotlib/backend_tools.py +index 5076ae5635..e74c33678c 100644 +--- a/lib/matplotlib/backend_tools.py ++++ b/lib/matplotlib/backend_tools.py +@@ -605,7 +605,7 @@ class ToolHome(ViewsPositionsBase): + """Restore the original view limits.""" + + description = 'Reset original view' +- image = 'mpl-data/images/home' ++ image = '/usr/share/matplotlib/mpl-data/images/home' + default_keymap = property(lambda self: mpl.rcParams['keymap.home']) + _on_trigger = 'home' + +@@ -614,7 +614,7 @@ class ToolBack(ViewsPositionsBase): + """Move back up the view limits stack.""" + + description = 'Back to previous view' +- image = 'mpl-data/images/back' ++ image = '/usr/share/matplotlib/mpl-data/images/back' + default_keymap = property(lambda self: mpl.rcParams['keymap.back']) + _on_trigger = 'back' + +@@ -623,7 +623,7 @@ class ToolForward(ViewsPositionsBase): + """Move forward in the view lim stack.""" + + description = 'Forward to next view' +- image = 'mpl-data/images/forward' ++ image = '/usr/share/matplotlib/mpl-data/images/forward' + default_keymap = property(lambda self: mpl.rcParams['keymap.forward']) + _on_trigger = 'forward' + +@@ -632,14 +632,14 @@ class ConfigureSubplotsBase(ToolBase): + """Base tool for the configuration of subplots.""" + + description = 'Configure subplots' +- image = 'mpl-data/images/subplots' ++ image = '/usr/share/matplotlib/mpl-data/images/subplots' + + + class SaveFigureBase(ToolBase): + """Base tool for figure saving.""" + + description = 'Save the figure' +- image = 'mpl-data/images/filesave' ++ image = '/usr/share/matplotlib/mpl-data/images/filesave' + default_keymap = property(lambda self: mpl.rcParams['keymap.save']) + + +@@ -714,7 +714,7 @@ class ToolZoom(ZoomPanBase): + """A Tool for zooming using a rectangle selector.""" + + description = 'Zoom to rectangle' +- image = 'mpl-data/images/zoom_to_rect' ++ image = '/usr/share/matplotlib/mpl-data/images/zoom_to_rect' + default_keymap = property(lambda self: mpl.rcParams['keymap.zoom']) + cursor = cursors.SELECT_REGION + radio_group = 'default' +@@ -836,7 +836,7 @@ class ToolPan(ZoomPanBase): + + default_keymap = property(lambda self: mpl.rcParams['keymap.pan']) + description = 'Pan axes with left mouse, zoom with right' +- image = 'mpl-data/images/move' ++ image = '/usr/share/matplotlib/mpl-data/images/move' + cursor = cursors.MOVE + radio_group = 'default' + +@@ -900,7 +900,7 @@ class ToolPan(ZoomPanBase): + class ToolHelpBase(ToolBase): + description = 'Print tool list, shortcuts and description' + default_keymap = property(lambda self: mpl.rcParams['keymap.help']) +- image = 'mpl-data/images/help' ++ image = '/usr/share/matplotlib/mpl-data/images/help' + + @staticmethod + def format_shortcut(key_sequence): -- -2.47.0 +2.49.0 diff --git a/0002-Unpin-NumPy-build-requirement.patch b/0002-Unpin-NumPy-build-requirement.patch index d87498a..024d861 100644 --- a/0002-Unpin-NumPy-build-requirement.patch +++ b/0002-Unpin-NumPy-build-requirement.patch @@ -1,4 +1,4 @@ -From 9421754530479435e21a98d2f549330899ed8d85 Mon Sep 17 00:00:00 2001 +From 33d00a269895431919512d203ba3158abf67af08 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 11 Aug 2023 02:36:06 -0400 Subject: [PATCH 2/5] Unpin NumPy build requirement @@ -37,5 +37,5 @@ index aa6aa23506..1894bbf3cd 100644 [tool.meson-python.args] -- -2.47.0 +2.49.0 diff --git a/0003-Set-FreeType-version-to-2.13.1-and-update-tolerances.patch b/0003-Set-FreeType-version-to-2.13.1-and-update-tolerances.patch index 21d78dc..ebc0892 100644 --- a/0003-Set-FreeType-version-to-2.13.1-and-update-tolerances.patch +++ b/0003-Set-FreeType-version-to-2.13.1-and-update-tolerances.patch @@ -1,4 +1,4 @@ -From 283c5005dbbbea1147e539075032d6ec43c88166 Mon Sep 17 00:00:00 2001 +From a1fea1cd2a25652721553f8dc4c40faf663c76e1 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 14 Feb 2020 06:05:42 -0500 Subject: [PATCH 3/5] Set FreeType version to 2.13.1 and update tolerances @@ -167,5 +167,5 @@ index 9c654f4d1f..9678e34a80 100644 -- -2.47.0 +2.49.0 diff --git a/0004-Unpin-meson-python-build-requirement.patch b/0004-Unpin-meson-python-build-requirement.patch index b7135a0..64b06d4 100644 --- a/0004-Unpin-meson-python-build-requirement.patch +++ b/0004-Unpin-meson-python-build-requirement.patch @@ -1,4 +1,4 @@ -From b671c4141dc9692ce8745a4ddb9f6b0b14e5e70f Mon Sep 17 00:00:00 2001 +From 31e6b3d9271e2229c50b587023efaeb78cc2fa1e Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 13 Dec 2024 02:03:33 -0500 Subject: [PATCH 4/5] Unpin meson-python build requirement @@ -34,5 +34,5 @@ index 1894bbf3cd..bdf2119f1b 100644 "setuptools_scm>=7", "numpy", -- -2.47.0 +2.49.0 diff --git a/0005-Use-old-stride_windows-implementation-on-32-bit-x86.patch b/0005-Use-old-stride_windows-implementation-on-32-bit-x86.patch index 1c729f1..807aa65 100644 --- a/0005-Use-old-stride_windows-implementation-on-32-bit-x86.patch +++ b/0005-Use-old-stride_windows-implementation-on-32-bit-x86.patch @@ -1,4 +1,4 @@ -From f6ecac5a3c02b32d66acd0fff41e1732d0939f60 Mon Sep 17 00:00:00 2001 +From 6e8ee8e1b2c6e0207010f8f4078976ef80489cfb Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 22 Aug 2022 18:43:28 -0400 Subject: [PATCH 5/5] Use old stride_windows implementation on 32-bit x86 @@ -80,5 +80,5 @@ index e1f08c0da5..5c0d56c74d 100644 resultY = resultY * window.reshape((-1, 1)) resultY = np.fft.fft(resultY, n=pad_to, axis=0)[:numFreqs, :] -- -2.47.0 +2.49.0