From 7ec3fa73af6080670209da0489307045794efd98 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 13 May 2020 00:08:56 +0300 Subject: [PATCH] - the HUD display state is now persistent between app restarts --- CHANGELOG.md | 1 + flatcamGUI/PlotCanvas.py | 4 ++++ flatcamGUI/PlotCanvasLegacy.py | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc348275..42b396d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta - updated the Cncjob to use the 'endxy' parameter which dictates the x,y position at the end of the job - now the Tcl commands Drillcncjob and Cncjob can use the toolchangexy and endxy parameters with or without parenthesis (but no spaces allowed) - modified the Tcl command Paint "single" parameter. Now it's value is a tuple with the x,y coordinates of the single polygon to be painted. +- the HUD display state is now persistent between app restarts 11.05.2020 diff --git a/flatcamGUI/PlotCanvas.py b/flatcamGUI/PlotCanvas.py index acd342ca..86722c72 100644 --- a/flatcamGUI/PlotCanvas.py +++ b/flatcamGUI/PlotCanvas.py @@ -187,11 +187,15 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): self.hud_enabled = True self.rect_hud.parent = self.view self.text_hud.parent = self.view + + self.fcapp.defaults['global_hud'] = True else: self.hud_enabled = False self.rect_hud.parent = None self.text_hud.parent = None + self.fcapp.defaults['global_hud'] = False + def draw_workspace(self, workspace_size): """ Draw a rectangular shape on canvas to specify our valid workspace. diff --git a/flatcamGUI/PlotCanvasLegacy.py b/flatcamGUI/PlotCanvasLegacy.py index 0fabff1e..4bdc15b2 100644 --- a/flatcamGUI/PlotCanvasLegacy.py +++ b/flatcamGUI/PlotCanvasLegacy.py @@ -320,9 +320,14 @@ class PlotCanvasLegacy(QtCore.QObject): if state: self.hud_enabled = True self.text_hud.add_artist() + + self.app.defaults['global_hud'] = True else: self.hud_enabled = False self.text_hud.remove_artist() + + self.app.defaults['global_hud'] = False + self.canvas.draw() class Thud(QtCore.QObject):