From 805d930df149179060a3d13cc5dc82bf85e58c99 Mon Sep 17 00:00:00 2001 From: TheMightyRaider Date: Sat, 28 Dec 2024 03:35:12 +0530 Subject: [PATCH] fix: improved sideview and linearview plot titling process --- mslib/msui/linearview.py | 1 - mslib/msui/sideview.py | 1 - mslib/msui/viewwindows.py | 4 ++++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mslib/msui/linearview.py b/mslib/msui/linearview.py index 0221e1689..2d413a7d1 100644 --- a/mslib/msui/linearview.py +++ b/mslib/msui/linearview.py @@ -97,7 +97,6 @@ def __init__(self, parent=None, mainwindow=None, model=None, _id=None, config_se self.setupUi(self) self.setWindowIcon(QtGui.QIcon(icons('64x64'))) - self.mpl.canvas.plotter.fig.suptitle(f"{model.name}") # Dock windows [WMS]: self.cbTools.clear() diff --git a/mslib/msui/sideview.py b/mslib/msui/sideview.py index 62d287cc5..54778c70d 100644 --- a/mslib/msui/sideview.py +++ b/mslib/msui/sideview.py @@ -298,7 +298,6 @@ def __init__(self, parent=None, mainwindow=None, model=None, _id=None, config_se super().__init__(parent, model, _id) self.tutorial_mode = tutorial_mode self.setupUi(self) - self.mpl.canvas.plotter.fig.suptitle(f"{model.name}") self.setWindowIcon(QtGui.QIcon(icons('64x64'))) self.settings_tag = "sideview" # Dock windows [WMS]: diff --git a/mslib/msui/viewwindows.py b/mslib/msui/viewwindows.py index 5a50b4613..da378f46e 100644 --- a/mslib/msui/viewwindows.py +++ b/mslib/msui/viewwindows.py @@ -278,6 +278,10 @@ def setFlightTrackModel(self, model): self.mpl.canvas.map.update_info_text(name=model.name) self.mpl.canvas.map.ax.figure.canvas.draw() + if hasattr(self.mpl.canvas,'plotter'): + self.mpl.canvas.plotter.fig.suptitle(f"{model.name}", x=0.95, ha='right') + self.mpl.canvas.plotter.fig.canvas.draw() + def getView(self): """ Return the MplCanvas instance of the window.