Parcourir la source

- added icon in status bar for HUD; clicking on it will toggle the HUD (heads up display)

Marius Stanciu il y a 5 ans
Parent
commit
da81fb89b8
4 fichiers modifiés avec 23 ajouts et 0 suppressions
  1. 6 0
      AppGUI/MainGUI.py
  2. 8 0
      AppGUI/PlotCanvas.py
  3. 8 0
      AppGUI/PlotCanvasLegacy.py
  4. 1 0
      CHANGELOG.md

+ 6 - 0
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))

+ 8 - 0
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):
         """

+ 8 - 0
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()
 

+ 1 - 0
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