- made the workspace label in the status bar clickable and also added a status bar message on status toggle for workspace

This commit is contained in:
Marius Stanciu 2020-05-18 06:08:43 +03:00 committed by Marius
parent 1085d26b7b
commit af2cc005b0
5 changed files with 21 additions and 5 deletions

View File

@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta
- fixed the PDF Tool when importing as Gerber objects
- moved all the parsing out of the PDF Tool to a new file ParsePDF in the flatcamParsers folder
- trying to fix the pixmap load crash when running a FlatCAMScript
- made the workspace label in the status bar clickable and also added a status bar message on status toggle for workspace
17.05.2020

View File

@ -4910,8 +4910,10 @@ class App(QtCore.QObject):
def on_workspace(self):
if self.ui.general_defaults_form.general_app_set_group.workspace_cb.get_value():
self.plotcanvas.draw_workspace(workspace_size=self.defaults['global_workspaceT'])
self.inform.emit(_("Workspace enabled."))
else:
self.plotcanvas.delete_workspace()
self.inform.emit(_("Workspace disabled."))
self.preferencesUiManager.defaults_read_form()
# self.save_defaults(silent=True)

View File

@ -2329,7 +2329,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.wplace_label = FCLabel("A4")
self.wplace_label.setMargin(2)
self.infobar.addWidget(self.wplace_label)
self.wplace_label.hide()
self.units_label = QtWidgets.QLabel("[mm]")
self.units_label.setMargin(2)
@ -2449,6 +2448,8 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.pref_open_button.clicked.connect(self.on_preferences_open_folder)
self.clear_btn.clicked.connect(self.on_gui_clear)
self.wplace_label.clicked.connect(self.app.on_workspace_toggle)
# to be used in the future
# self.plot_tab_area.tab_attached.connect(lambda x: print(x))
# self.plot_tab_area.tab_detached.connect(lambda x: print(x))

View File

@ -245,14 +245,20 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
self.fcapp.ui.wplace_label.set_value(workspace_size[:3])
self.fcapp.ui.wplace_label.setToolTip(workspace_size)
self.fcapp.ui.wplace_label.show()
self.fcapp.ui.wplace_label.setStyleSheet("""
QLabel
{
color: black;
background-color: lightgreen;
}
""")
def delete_workspace(self):
try:
self.workspace_line.parent = None
except Exception:
pass
self.fcapp.ui.wplace_label.hide()
self.fcapp.ui.wplace_label.setStyleSheet("")
# redraw the workspace lines on the plot by re adding them to the parent view.scene
def restore_workspace(self):

View File

@ -419,7 +419,13 @@ class PlotCanvasLegacy(QtCore.QObject):
self.app.ui.wplace_label.set_value(workspace_size[:3])
self.app.ui.wplace_label.setToolTip(workspace_size)
self.app.ui.wplace_label.show()
self.fcapp.ui.wplace_label.setStyleSheet("""
QLabel
{
color: black;
background-color: lightgreen;
}
""")
def delete_workspace(self):
try:
@ -427,7 +433,7 @@ class PlotCanvasLegacy(QtCore.QObject):
self.canvas.draw()
except Exception:
pass
self.app.ui.wplace_label.hide()
self.fcapp.ui.wplace_label.setStyleSheet("")
def graph_event_connect(self, event_name, callback):
"""