Skip to content

Commit

Permalink
Changed default increase and decrease to one and updated tool tip.
Browse files Browse the repository at this point in the history
- Added constant for increase and decrease step in font size
- Updated up and down arrow buttons tool tip
  • Loading branch information
GuiMacielPereira committed Nov 2, 2023
1 parent 37c7167 commit 56cd64d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/mslice/plotting/plot_window/cut_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
5 changes: 3 additions & 2 deletions src/mslice/plotting/plot_window/slice_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

DEFAULT_LABEL_SIZE = 10
DEFAULT_TITLE_SIZE = 12
DEFAULT_FONT_SIZE_STEP = 1


class SlicePlot(IPlot):
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions src/mslice/presenters/plot_options_presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 56cd64d

Please sign in to comment.