Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/matplotlib/backends/_backend_gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import gi
# The GTK3/GTK4 backends will have already called `gi.require_version` to set
# the desired GTK.
from gi.repository import Gdk, Gio, GLib, Gtk
from gi.repository import Gdk, Gio, GLib, Gtk, GdkPixbuf


try:
Expand Down Expand Up @@ -144,8 +144,11 @@ def __init__(self, canvas, num):

if gtk_ver == 3:
icon_ext = "png" if sys.platform == "win32" else "svg"
self.window.set_icon_from_file(
small_icon = GdkPixbuf.Pixbuf.new_from_file(
str(cbook._get_data_path(f"images/matplotlib_small.{icon_ext}")))
large_icon = GdkPixbuf.Pixbuf.new_from_file(
str(cbook._get_data_path(f"images/matplotlib.{icon_ext}")))
self.window.set_icon_list([small_icon, large_icon])

self.vbox = Gtk.Box()
self.vbox.set_property("orientation", Gtk.Orientation.VERTICAL)
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/backends/_backend_tk.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,11 @@ def create_with_canvas(cls, canvas_class, figure, num):
# supported Tk version is increased to 8.6, as Tk 8.6+ natively
# supports PNG images.
icon_fname = str(cbook._get_data_path(
'images/matplotlib.png'))
'images/matplotlib_small.png'))
icon_img = ImageTk.PhotoImage(file=icon_fname, master=window)

icon_fname_large = str(cbook._get_data_path(
'images/matplotlib_large.png'))
'images/matplotlib.png'))
icon_img_large = ImageTk.PhotoImage(
file=icon_fname_large, master=window)

Expand Down
18 changes: 10 additions & 8 deletions lib/matplotlib/backends/backend_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@
}


def _create_WindowIcon():
icon = QtGui.QIcon()
icon.addFile(str(cbook._get_data_path('images/matplotlib_small.svg')))
icon.addFile(str(cbook._get_data_path('images/matplotlib.svg')))
return icon


# lru_cache keeps a reference to the QApplication instance, keeping it from
# being GC'd.
@functools.lru_cache(1)
Expand Down Expand Up @@ -136,9 +143,7 @@ def _create_qApp():
pass
app = QtWidgets.QApplication(["matplotlib"])
if sys.platform == "darwin":
image = str(cbook._get_data_path('images/matplotlib.svg'))
icon = QtGui.QIcon(image)
app.setWindowIcon(icon)
app.setWindowIcon(_create_WindowIcon())
app.setQuitOnLastWindowClosed(True)
cbook._setup_new_guiapp()
if qt_version == 5:
Expand Down Expand Up @@ -590,9 +595,7 @@ def __init__(self, canvas, num):
self.window.closing.connect(self._widgetclosed)

if sys.platform != "darwin":
image = str(cbook._get_data_path('images/matplotlib.svg'))
icon = QtGui.QIcon(image)
self.window.setWindowIcon(icon)
self.window.setWindowIcon(_create_WindowIcon())

self.window._destroying = False

Expand Down Expand Up @@ -983,8 +986,7 @@ def set_history_buttons(self):
class SubplotToolQt(QtWidgets.QDialog):
def __init__(self, targetfig, parent):
super().__init__(parent)
self.setWindowIcon(QtGui.QIcon(
str(cbook._get_data_path("images/matplotlib.png"))))
self.setWindowIcon(_create_WindowIcon())
self.setObjectName("SubplotTool")
self._spinboxes = {}
main_layout = QtWidgets.QHBoxLayout()
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ def _load_bitmap(filename):

def _set_frame_icon(frame):
bundle = wx.IconBundle()
for image in ('matplotlib.png', 'matplotlib_large.png'):
for image in ('matplotlib_small.png', 'matplotlib.png'):
icon = wx.Icon(_load_bitmap(image))
if not icon.IsOk():
return
Expand Down
Binary file modified lib/matplotlib/mpl-data/images/back.pdf
Binary file not shown.
Binary file modified lib/matplotlib/mpl-data/images/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 6 additions & 45 deletions lib/matplotlib/mpl-data/images/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/mpl-data/images/back_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/mpl-data/images/filesave.pdf
Binary file not shown.
Binary file modified lib/matplotlib/mpl-data/images/filesave.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 5 additions & 67 deletions lib/matplotlib/mpl-data/images/filesave.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/mpl-data/images/filesave_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/mpl-data/images/forward.pdf
Binary file not shown.
Binary file modified lib/matplotlib/mpl-data/images/forward.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 6 additions & 45 deletions lib/matplotlib/mpl-data/images/forward.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/mpl-data/images/forward_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/mpl-data/images/help.pdf
Binary file not shown.
Binary file modified lib/matplotlib/mpl-data/images/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 6 additions & 51 deletions lib/matplotlib/mpl-data/images/help.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/mpl-data/images/help_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/mpl-data/images/home.pdf
Binary file not shown.
Binary file modified lib/matplotlib/mpl-data/images/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 6 additions & 58 deletions lib/matplotlib/mpl-data/images/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/mpl-data/images/home_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/mpl-data/images/matplotlib.pdf
Binary file not shown.
Binary file modified lib/matplotlib/mpl-data/images/matplotlib.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading