- 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:
Marius Stanciu
2020-05-11 22:56:06 +03:00
committed by Marius
parent 3c0ee97c61
commit 40c52455e1
7 changed files with 24 additions and 106 deletions

View File

@@ -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)

View File

@@ -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,

View File

@@ -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"]))