From da81fb89b8d67cb21f6219c73f115a8057101585 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 18 May 2020 23:35:33 +0300 Subject: [PATCH] - added icon in status bar for HUD; clicking on it will toggle the HUD (heads up display) --- AppGUI/MainGUI.py | 6 ++++++ AppGUI/PlotCanvas.py | 8 ++++++++ AppGUI/PlotCanvasLegacy.py | 8 ++++++++ CHANGELOG.md | 1 + 4 files changed, 23 insertions(+) diff --git a/AppGUI/MainGUI.py b/AppGUI/MainGUI.py index a5b6a285..46761cb8 100644 --- a/AppGUI/MainGUI.py +++ b/AppGUI/MainGUI.py @@ -1519,6 +1519,11 @@ class MainGUI(QtWidgets.QMainWindow): self.snap_toolbar.setMaximumHeight(24) self.infobar.addWidget(self.snap_toolbar) + self.hud_label = FCLabel("H") + self.hud_label.setToolTip(_("HUD (Heads up display)")) + self.hud_label.setMargin(2) + self.infobar.addWidget(self.hud_label) + self.wplace_label = FCLabel("A4") self.wplace_label.setMargin(2) self.infobar.addWidget(self.wplace_label) @@ -1642,6 +1647,7 @@ class MainGUI(QtWidgets.QMainWindow): self.clear_btn.clicked.connect(self.on_gui_clear) self.wplace_label.clicked.connect(self.app.on_workspace_toggle) + self.hud_label.clicked.connect(self.app.on_toggle_hud) # to be used in the future # self.plot_tab_area.tab_attached.connect(lambda x: print(x)) diff --git a/AppGUI/PlotCanvas.py b/AppGUI/PlotCanvas.py index 572ef50b..62fa8d2d 100644 --- a/AppGUI/PlotCanvas.py +++ b/AppGUI/PlotCanvas.py @@ -208,12 +208,20 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): self.text_hud.parent = self.view self.fcapp.defaults['global_hud'] = True + self.fcapp.ui.hud_label.setStyleSheet(""" + QLabel + { + color: black; + background-color: lightblue; + } + """) else: self.hud_enabled = False self.rect_hud.parent = None self.text_hud.parent = None self.fcapp.defaults['global_hud'] = False + self.fcapp.ui.hud_label.setStyleSheet("") def draw_workspace(self, workspace_size): """ diff --git a/AppGUI/PlotCanvasLegacy.py b/AppGUI/PlotCanvasLegacy.py index 752d1546..b65cc18b 100644 --- a/AppGUI/PlotCanvasLegacy.py +++ b/AppGUI/PlotCanvasLegacy.py @@ -324,11 +324,19 @@ class PlotCanvasLegacy(QtCore.QObject): self.text_hud.add_artist() self.app.defaults['global_hud'] = True + self.fcapp.ui.hud_label.setStyleSheet(""" + QLabel + { + color: black; + background-color: lightblue; + } + """) else: self.hud_enabled = False self.text_hud.remove_artist() self.app.defaults['global_hud'] = False + self.fcapp.ui.hud_label.setStyleSheet("") self.canvas.draw() diff --git a/CHANGELOG.md b/CHANGELOG.md index 07982cdd..c73d5c5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ CHANGELOG for FlatCAM beta - working on a new Tool: Etch Compensation Tool -> installed the tool and created the GUI and class template - moved more methods out of App_Main class - added confirmation messages for toggle of HUD, Grid, Grid Snap, Axis +- added icon in status bar for HUD; clicking on it will toggle the HUD (heads up display) 17.05.2020