- in the Grid Toolbar, the Grid Y entry is now by default hidden and shown only when there is a need (grid gap link is disabled) in order to maximize the status bar space availability

This commit is contained in:
Marius Stanciu
2022-03-11 14:48:22 +02:00
committed by Marius
parent 1a0769c532
commit a3a8fbf8d5
3 changed files with 24 additions and 8 deletions

View File

@@ -3706,19 +3706,30 @@ class OptionalHideInputSection:
self.cb.stateChanged.connect(self.on_cb_change)
def on_cb_change(self):
if self.cb.checkState() is Qt.CheckState.Checked:
for widget in self.optinputs:
if self.logic is True:
widget.show()
try:
widget.setVisible(True)
except Exception:
widget.show()
else:
widget.hide()
try:
widget.setVisible(False)
except Exception:
widget.hide()
else:
for widget in self.optinputs:
if self.logic is True:
widget.hide()
try:
widget.setVisible(False)
except Exception:
widget.hide()
else:
widget.show()
try:
widget.setVisible(True)
except Exception:
widget.show()
class FCTable(QtWidgets.QTableWidget):

View File

@@ -1326,11 +1326,15 @@ class MainGUI(QtWidgets.QMainWindow):
self.grid_gap_y_entry = FCEntry2()
self.grid_gap_y_entry.setMaximumWidth(70)
self.grid_gap_y_entry.setToolTip(_("Grid Y snapping distance"))
self.grid_toolbar.addWidget(self.grid_gap_y_entry)
self.grid_gap_y_entry.setVisible(False)
self.gridy_entry_action = self.grid_toolbar.addWidget(self.grid_gap_y_entry)
self.grid_toolbar.addWidget(FCLabel(" "))
self.ois_grid = OptionalInputSection(self.grid_gap_link_cb, [self.grid_gap_y_entry], logic=False)
# self.ois_grid = OptionalInputSection(self.grid_gap_link_cb, [self.grid_gap_y_entry], logic=False)
self.grid_gap_link_cb.clicked.connect(
lambda x: self.gridy_entry_action.setVisible(False) if x else self.gridy_entry_action.setVisible(True))
self.corner_snap_btn = self.grid_toolbar.addAction(
QtGui.QIcon(self.app.resource_location + '/corner32.png'), _('Snap to corner'))