From 56cd64dc1d40c5f1cf5440a5481dd22438c52d57 Mon Sep 17 00:00:00 2001 From: GuiMacielPereira Date: Thu, 2 Nov 2023 09:02:22 +0000 Subject: [PATCH] Changed default increase and decrease to one and updated tool tip. - Added constant for increase and decrease step in font size - Updated up and down arrow buttons tool tip --- src/mslice/plotting/plot_window/cut_plot.py | 5 +++-- src/mslice/plotting/plot_window/slice_plot.py | 5 +++-- src/mslice/presenters/plot_options_presenter.py | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mslice/plotting/plot_window/cut_plot.py b/src/mslice/plotting/plot_window/cut_plot.py index 72ba4cc6..dc78cddd 100644 --- a/src/mslice/plotting/plot_window/cut_plot.py +++ b/src/mslice/plotting/plot_window/cut_plot.py @@ -29,6 +29,7 @@ DEFAULT_LABEL_SIZE = 10 DEFAULT_TITLE_SIZE = 12 +DEFAULT_FONT_SIZE_STEP = 1 def get_min(data, absolute_minimum=-np.inf): @@ -852,8 +853,8 @@ def all_fonts_size(self, values: dict): def increase_all_fonts(self): for p in self.plot_fonts_properties: - setattr(self, p, getattr(self, p) + 0.5) + setattr(self, p, getattr(self, p) + DEFAULT_FONT_SIZE_STEP) def decrease_all_fonts(self): for p in self.plot_fonts_properties: - setattr(self, p, getattr(self, p) - 0.5) + setattr(self, p, getattr(self, p) - DEFAULT_FONT_SIZE_STEP) diff --git a/src/mslice/plotting/plot_window/slice_plot.py b/src/mslice/plotting/plot_window/slice_plot.py index 8770e872..4b67bfab 100644 --- a/src/mslice/plotting/plot_window/slice_plot.py +++ b/src/mslice/plotting/plot_window/slice_plot.py @@ -27,6 +27,7 @@ DEFAULT_LABEL_SIZE = 10 DEFAULT_TITLE_SIZE = 12 +DEFAULT_FONT_SIZE_STEP = 1 class SlicePlot(IPlot): @@ -650,8 +651,8 @@ def all_fonts_size(self, values: dict): def increase_all_fonts(self): for p in self.plot_fonts_properties: - setattr(self, p, getattr(self, p) + 0.5) + setattr(self, p, getattr(self, p) + DEFAULT_FONT_SIZE_STEP) def decrease_all_fonts(self): for p in self.plot_fonts_properties: - setattr(self, p, getattr(self, p) - 0.5) + setattr(self, p, getattr(self, p) - DEFAULT_FONT_SIZE_STEP) diff --git a/src/mslice/presenters/plot_options_presenter.py b/src/mslice/presenters/plot_options_presenter.py index 36b7222f..fe1aa4aa 100644 --- a/src/mslice/presenters/plot_options_presenter.py +++ b/src/mslice/presenters/plot_options_presenter.py @@ -49,8 +49,8 @@ def _set_all_plot_fonts(self): def _set_font_sizes_tooltip(self): tip = self._convert_font_config_to_tooltip() self._view.allFntSz.setToolTip(tip) - self._view.sclUpFntSz.setToolTip(tip) - self._view.sclDownFntSz.setToolTip(tip) + self._view.sclUpFntSz.setToolTip("Increase font sizes\n\n" + tip) + self._view.sclDownFntSz.setToolTip("Decrease font sizes\n\n" + tip) def _convert_font_config_to_tooltip(self): font_size_dict = self._model.all_fonts_size.copy()