- 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:
parent
1085d26b7b
commit
af2cc005b0
|
@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta
|
||||||
- fixed the PDF Tool when importing as Gerber objects
|
- 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
|
- 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
|
- 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
|
17.05.2020
|
||||||
|
|
||||||
|
|
|
@ -4910,8 +4910,10 @@ class App(QtCore.QObject):
|
||||||
def on_workspace(self):
|
def on_workspace(self):
|
||||||
if self.ui.general_defaults_form.general_app_set_group.workspace_cb.get_value():
|
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.plotcanvas.draw_workspace(workspace_size=self.defaults['global_workspaceT'])
|
||||||
|
self.inform.emit(_("Workspace enabled."))
|
||||||
else:
|
else:
|
||||||
self.plotcanvas.delete_workspace()
|
self.plotcanvas.delete_workspace()
|
||||||
|
self.inform.emit(_("Workspace disabled."))
|
||||||
self.preferencesUiManager.defaults_read_form()
|
self.preferencesUiManager.defaults_read_form()
|
||||||
# self.save_defaults(silent=True)
|
# self.save_defaults(silent=True)
|
||||||
|
|
||||||
|
|
|
@ -2329,7 +2329,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||||
self.wplace_label = FCLabel("A4")
|
self.wplace_label = FCLabel("A4")
|
||||||
self.wplace_label.setMargin(2)
|
self.wplace_label.setMargin(2)
|
||||||
self.infobar.addWidget(self.wplace_label)
|
self.infobar.addWidget(self.wplace_label)
|
||||||
self.wplace_label.hide()
|
|
||||||
|
|
||||||
self.units_label = QtWidgets.QLabel("[mm]")
|
self.units_label = QtWidgets.QLabel("[mm]")
|
||||||
self.units_label.setMargin(2)
|
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.pref_open_button.clicked.connect(self.on_preferences_open_folder)
|
||||||
self.clear_btn.clicked.connect(self.on_gui_clear)
|
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
|
# to be used in the future
|
||||||
# self.plot_tab_area.tab_attached.connect(lambda x: print(x))
|
# self.plot_tab_area.tab_attached.connect(lambda x: print(x))
|
||||||
# self.plot_tab_area.tab_detached.connect(lambda x: print(x))
|
# self.plot_tab_area.tab_detached.connect(lambda x: print(x))
|
||||||
|
|
|
@ -245,14 +245,20 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
|
||||||
|
|
||||||
self.fcapp.ui.wplace_label.set_value(workspace_size[:3])
|
self.fcapp.ui.wplace_label.set_value(workspace_size[:3])
|
||||||
self.fcapp.ui.wplace_label.setToolTip(workspace_size)
|
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):
|
def delete_workspace(self):
|
||||||
try:
|
try:
|
||||||
self.workspace_line.parent = None
|
self.workspace_line.parent = None
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
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
|
# redraw the workspace lines on the plot by re adding them to the parent view.scene
|
||||||
def restore_workspace(self):
|
def restore_workspace(self):
|
||||||
|
|
|
@ -419,7 +419,13 @@ class PlotCanvasLegacy(QtCore.QObject):
|
||||||
|
|
||||||
self.app.ui.wplace_label.set_value(workspace_size[:3])
|
self.app.ui.wplace_label.set_value(workspace_size[:3])
|
||||||
self.app.ui.wplace_label.setToolTip(workspace_size)
|
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):
|
def delete_workspace(self):
|
||||||
try:
|
try:
|
||||||
|
@ -427,7 +433,7 @@ class PlotCanvasLegacy(QtCore.QObject):
|
||||||
self.canvas.draw()
|
self.canvas.draw()
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
self.app.ui.wplace_label.hide()
|
self.fcapp.ui.wplace_label.setStyleSheet("")
|
||||||
|
|
||||||
def graph_event_connect(self, event_name, callback):
|
def graph_event_connect(self, event_name, callback):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue