- made sure that the corner snap buttons are shown only in Editors
- changed the HUD color when using Dark theme
This commit is contained in:
parent
3c0ee97c61
commit
40c52455e1
|
@ -16,6 +16,8 @@ CHANGELOG for FlatCAM beta
|
|||
- Snap Toolbar is now visible in Fullscreen
|
||||
- in Fullscreen now the Notebook is available but it will be hidden on Fullscreen launch
|
||||
- fixed some minor issues (in the HUD added a separating line, missing an icon in toolbars on first launch)
|
||||
- made sure that the corner snap buttons are shown only in Editors
|
||||
- changed the HUD color when using Dark theme
|
||||
|
||||
10.05.2020
|
||||
|
||||
|
|
|
@ -2819,10 +2819,8 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||
self.tool_shape.enabled = True
|
||||
# self.app.app_cursor.enabled = True
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(True)
|
||||
self.app.ui.corner_snap_btn.setEnabled(True)
|
||||
self.app.ui.snap_magnet.setVisible(True)
|
||||
self.app.ui.corner_snap_btn.setVisible(True)
|
||||
self.app.ui.snap_magnet.setVisible(True)
|
||||
|
||||
self.app.ui.exc_editor_menu.setDisabled(False)
|
||||
self.app.ui.exc_editor_menu.menuAction().setVisible(True)
|
||||
|
@ -2868,30 +2866,8 @@ class FlatCAMExcEditor(QtCore.QObject):
|
|||
self.clear()
|
||||
self.app.ui.exc_edit_toolbar.setDisabled(True)
|
||||
|
||||
settings = QSettings("Open Source", "FlatCAM")
|
||||
if settings.contains("layout"):
|
||||
layout = settings.value('layout', type=str)
|
||||
if layout == 'standard':
|
||||
# self.app.ui.exc_edit_toolbar.setVisible(False)
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(False)
|
||||
self.app.ui.corner_snap_btn.setEnabled(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
else:
|
||||
# self.app.ui.exc_edit_toolbar.setVisible(True)
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(False)
|
||||
self.app.ui.corner_snap_btn.setEnabled(False)
|
||||
self.app.ui.snap_magnet.setVisible(True)
|
||||
self.app.ui.corner_snap_btn.setVisible(True)
|
||||
else:
|
||||
# self.app.ui.exc_edit_toolbar.setVisible(False)
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(False)
|
||||
self.app.ui.corner_snap_btn.setEnabled(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
|
||||
# set the Editor Toolbar visibility to what was before entering in the Editor
|
||||
self.app.ui.exc_edit_toolbar.setVisible(False) if self.toolbar_old_state is False \
|
||||
|
|
|
@ -3654,10 +3654,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||
self.tool_shape.enabled = True
|
||||
self.app.app_cursor.enabled = True
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(True)
|
||||
self.app.ui.corner_snap_btn.setEnabled(True)
|
||||
self.app.ui.snap_magnet.setVisible(True)
|
||||
self.app.ui.corner_snap_btn.setVisible(True)
|
||||
self.app.ui.snap_magnet.setVisible(True)
|
||||
|
||||
self.app.ui.geo_editor_menu.setDisabled(False)
|
||||
self.app.ui.geo_editor_menu.menuAction().setVisible(True)
|
||||
|
@ -3713,27 +3711,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
|||
self.app.ui.geo_edit_toolbar.setDisabled(True)
|
||||
|
||||
settings = QSettings("Open Source", "FlatCAM")
|
||||
if settings.contains("layout"):
|
||||
layout = settings.value('layout', type=str)
|
||||
if layout == 'standard':
|
||||
# self.app.ui.geo_edit_toolbar.setVisible(False)
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(False)
|
||||
self.app.ui.corner_snap_btn.setEnabled(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
else:
|
||||
# self.app.ui.geo_edit_toolbar.setVisible(True)
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(False)
|
||||
self.app.ui.corner_snap_btn.setEnabled(False)
|
||||
else:
|
||||
# self.app.ui.geo_edit_toolbar.setVisible(False)
|
||||
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(False)
|
||||
self.app.ui.corner_snap_btn.setEnabled(False)
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
|
||||
# set the Editor Toolbar visibility to what was before entering in the Editor
|
||||
self.app.ui.geo_edit_toolbar.setVisible(False) if self.toolbar_old_state is False \
|
||||
|
|
|
@ -3685,10 +3685,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||
self.shapes.enabled = True
|
||||
self.tool_shape.enabled = True
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(True)
|
||||
self.app.ui.corner_snap_btn.setEnabled(True)
|
||||
self.app.ui.snap_magnet.setVisible(True)
|
||||
self.app.ui.corner_snap_btn.setVisible(True)
|
||||
self.app.ui.snap_magnet.setVisible(True)
|
||||
|
||||
self.app.ui.grb_editor_menu.setDisabled(False)
|
||||
self.app.ui.grb_editor_menu.menuAction().setVisible(True)
|
||||
|
@ -3735,29 +3733,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
|||
self.app.ui.grb_edit_toolbar.setDisabled(True)
|
||||
|
||||
settings = QSettings("Open Source", "FlatCAM")
|
||||
if settings.contains("layout"):
|
||||
layout = settings.value('layout', type=str)
|
||||
if layout == 'standard':
|
||||
# self.app.ui.exc_edit_toolbar.setVisible(False)
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(False)
|
||||
self.app.ui.corner_snap_btn.setEnabled(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
else:
|
||||
# self.app.ui.exc_edit_toolbar.setVisible(True)
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(False)
|
||||
self.app.ui.corner_snap_btn.setEnabled(False)
|
||||
self.app.ui.snap_magnet.setVisible(True)
|
||||
self.app.ui.corner_snap_btn.setVisible(True)
|
||||
else:
|
||||
# self.app.ui.exc_edit_toolbar.setVisible(False)
|
||||
|
||||
self.app.ui.snap_max_dist_entry.setEnabled(False)
|
||||
self.app.ui.corner_snap_btn.setEnabled(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
|
||||
# set the Editor Toolbar visibility to what was before entering in the Editor
|
||||
self.app.ui.grb_edit_toolbar.setVisible(False) if self.toolbar_old_state is False \
|
||||
|
|
|
@ -1110,6 +1110,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||
self.snap_max_dist_entry.setToolTip(_("Max. magnet distance"))
|
||||
self.snap_magnet = self.snap_toolbar.addWidget(self.snap_max_dist_entry)
|
||||
|
||||
self.corner_snap_btn.setVisible(False)
|
||||
self.snap_magnet.setVisible(False)
|
||||
|
||||
# ########################################################################
|
||||
# ########################## Notebook # ##################################
|
||||
# ########################################################################
|
||||
|
@ -2384,29 +2387,21 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||
self.restoreState(saved_gui_state)
|
||||
log.debug("FlatCAMGUI.__init__() --> UI state restored from QSettings.")
|
||||
|
||||
self.corner_snap_btn.setVisible(False)
|
||||
self.snap_magnet.setVisible(False)
|
||||
|
||||
if flat_settings.contains("layout"):
|
||||
layout = flat_settings.value('layout', type=str)
|
||||
self.exc_edit_toolbar.setDisabled(True)
|
||||
self.geo_edit_toolbar.setDisabled(True)
|
||||
self.grb_edit_toolbar.setDisabled(True)
|
||||
|
||||
if layout == 'standard':
|
||||
self.corner_snap_btn.setVisible(False)
|
||||
self.snap_magnet.setVisible(False)
|
||||
else:
|
||||
self.snap_magnet.setVisible(True)
|
||||
self.corner_snap_btn.setVisible(True)
|
||||
self.snap_magnet.setDisabled(True)
|
||||
self.corner_snap_btn.setDisabled(True)
|
||||
log.debug("FlatCAMGUI.__init__() --> UI layout restored from QSettings. Layout = %s" % str(layout))
|
||||
else:
|
||||
self.exc_edit_toolbar.setDisabled(True)
|
||||
self.geo_edit_toolbar.setDisabled(True)
|
||||
self.grb_edit_toolbar.setDisabled(True)
|
||||
|
||||
self.corner_snap_btn.setVisible(False)
|
||||
self.snap_magnet.setVisible(False)
|
||||
|
||||
flat_settings.setValue('layout', "standard")
|
||||
# This will write the setting to the platform specific storage.
|
||||
del flat_settings
|
||||
|
@ -2759,19 +2754,13 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||
self.aperture_move_btn = self.grb_edit_toolbar.addAction(
|
||||
QtGui.QIcon(self.app.resource_location + '/move32.png'), _("Move"))
|
||||
|
||||
self.corner_snap_btn.setVisible(False)
|
||||
self.snap_magnet.setVisible(False)
|
||||
|
||||
qsettings = QSettings("Open Source", "FlatCAM")
|
||||
if qsettings.contains("layout"):
|
||||
layout = qsettings.value('layout', type=str)
|
||||
|
||||
if layout == 'standard' or layout == 'minimal':
|
||||
self.corner_snap_btn.setVisible(False)
|
||||
self.snap_magnet.setVisible(False)
|
||||
else:
|
||||
self.corner_snap_btn.setVisible(True)
|
||||
self.snap_magnet.setVisible(True)
|
||||
self.corner_snap_btn.setDisabled(True)
|
||||
self.snap_magnet.setDisabled(True)
|
||||
|
||||
# on 'minimal' layout only some toolbars are active
|
||||
if layout != 'minimal':
|
||||
self.exc_edit_toolbar.setVisible(True)
|
||||
|
|
|
@ -58,7 +58,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
|
|||
self.text_hud_color = 'black'
|
||||
else:
|
||||
self.line_color = (0.4, 0.4, 0.4, 1.0)
|
||||
self.rect_hud_color = Color('#0000FF10')
|
||||
self.rect_hud_color = Color('#80808040')
|
||||
self.text_hud_color = 'white'
|
||||
|
||||
# workspace lines; I didn't use the rectangle because I didn't want to add another VisPy Node,
|
||||
|
|
|
@ -696,8 +696,6 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
|||
self.app.ui.exc_edit_toolbar.setObjectName('ExcEditor_TB')
|
||||
self.app.ui.addToolBar(Qt.RightToolBarArea, self.app.ui.exc_edit_toolbar)
|
||||
|
||||
self.app.ui.corner_snap_btn.setVisible(True)
|
||||
self.app.ui.snap_magnet.setVisible(True)
|
||||
else:
|
||||
# ## TOOLBAR INSTALLATION # ##
|
||||
self.app.ui.toolbarfile = QtWidgets.QToolBar('File Toolbar')
|
||||
|
@ -737,9 +735,6 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
|||
self.app.ui.grb_edit_toolbar.setObjectName('GrbEditor_TB')
|
||||
self.app.ui.addToolBar(self.app.ui.grb_edit_toolbar)
|
||||
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
|
||||
if current_layout == 'minimal':
|
||||
self.app.ui.toolbarview.setVisible(False)
|
||||
self.app.ui.toolbarshell.setVisible(False)
|
||||
|
@ -748,9 +743,6 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
|||
self.app.ui.exc_edit_toolbar.setVisible(False)
|
||||
self.app.ui.lock_toolbar(lock=True)
|
||||
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
|
||||
# add all the actions to the toolbars
|
||||
self.app.ui.populate_toolbars()
|
||||
|
||||
|
@ -759,6 +751,9 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
|||
|
||||
self.app.ui.grid_snap_btn.setChecked(True)
|
||||
|
||||
self.app.ui.corner_snap_btn.setVisible(False)
|
||||
self.app.ui.snap_magnet.setVisible(False)
|
||||
|
||||
self.app.ui.grid_gap_x_entry.setText(str(self.app.defaults["global_gridx"]))
|
||||
self.app.ui.grid_gap_y_entry.setText(str(self.app.defaults["global_gridy"]))
|
||||
self.app.ui.snap_max_dist_entry.setText(str(self.app.defaults["global_snap_max"]))
|
||||
|
|
Loading…
Reference in New Issue