From ff1515b449328501fcb9bc1dbe57f716b3786299 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Thu, 2 Oct 2014 08:11:56 +0200 Subject: [PATCH 1/2] Icon for font awesome 3.2.1 and 4 Should fix https://github.com/matplotlib/matplotlib/issues/3606 --- lib/matplotlib/backends/backend_nbagg.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/backends/backend_nbagg.py b/lib/matplotlib/backends/backend_nbagg.py index bea523622454..91ede55f57d6 100644 --- a/lib/matplotlib/backends/backend_nbagg.py +++ b/lib/matplotlib/backends/backend_nbagg.py @@ -81,14 +81,17 @@ def connection_info(): return '\n'.join(result) -# Note: Version 3.2 icons, not the later 4.0 ones. +# Note: Version 3.2 and 4.x icons # http://fontawesome.io/3.2.1/icons/ +# http://fontawesome.io/ +# the `fa fa-xxx` part targets font-awesome 4, (IPython 3.x) +# the icon-xxx targets font awesome 3.21 (IPython 2.x) _FONT_AWESOME_CLASSES = { - 'home': 'icon-home', - 'back': 'icon-arrow-left', - 'forward': 'icon-arrow-right', - 'zoom_to_rect': 'icon-check-empty', - 'move': 'icon-move', + 'home': 'fa fa-home icon-home', + 'back': 'fa fa-arrow-left icon-arrow-left', + 'forward': 'fa fa--arrow-right icon-arrow-right', + 'zoom_to_rect': 'fa fa-square-o icon-check-empty', + 'move': 'fa fa-arrows icon-move', None: None } From 09045556294d2002871955d377b10e06603199f2 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Thu, 2 Oct 2014 17:28:37 +0100 Subject: [PATCH 2/2] Updated icons for nbagg backend to work with IPython 3.0 --- lib/matplotlib/backends/backend_nbagg.py | 2 +- lib/matplotlib/backends/backend_webagg_core.py | 2 +- lib/matplotlib/backends/web_backend/nbagg_mpl.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/backends/backend_nbagg.py b/lib/matplotlib/backends/backend_nbagg.py index 91ede55f57d6..ab3f8267cb44 100644 --- a/lib/matplotlib/backends/backend_nbagg.py +++ b/lib/matplotlib/backends/backend_nbagg.py @@ -89,7 +89,7 @@ def connection_info(): _FONT_AWESOME_CLASSES = { 'home': 'fa fa-home icon-home', 'back': 'fa fa-arrow-left icon-arrow-left', - 'forward': 'fa fa--arrow-right icon-arrow-right', + 'forward': 'fa fa-arrow-right icon-arrow-right', 'zoom_to_rect': 'fa fa-square-o icon-check-empty', 'move': 'fa fa-arrows icon-move', None: None diff --git a/lib/matplotlib/backends/backend_webagg_core.py b/lib/matplotlib/backends/backend_webagg_core.py index dfd77ec450c8..6cf0a592fc8c 100644 --- a/lib/matplotlib/backends/backend_webagg_core.py +++ b/lib/matplotlib/backends/backend_webagg_core.py @@ -315,7 +315,7 @@ def draw_rubberband(self, event, x0, y0, x1, y1): "rubberband", x0=x0, y0=y0, x1=x1, y1=y1) def release_zoom(self, event): - super(NavigationToolbar2WebAgg, self).release_zoom(event) + backend_bases.NavigationToolbar2.release_zoom(self, event) self.canvas.send_event( "rubberband", x0=-1, y0=-1, x1=-1, y1=-1) diff --git a/lib/matplotlib/backends/web_backend/nbagg_mpl.js b/lib/matplotlib/backends/web_backend/nbagg_mpl.js index 82c020aa8264..71c52f9478b9 100644 --- a/lib/matplotlib/backends/web_backend/nbagg_mpl.js +++ b/lib/matplotlib/backends/web_backend/nbagg_mpl.js @@ -115,7 +115,7 @@ mpl.figure.prototype._init_toolbar = function() { // Add the close button to the window. var buttongrp = $('
'); - var button = $(''); + var button = $(''); button.click(function (evt) { fig.handle_close(fig, {}); } ); button.mouseover('Close figure', toolbar_mouse_event); buttongrp.append(button);