Tools2InvertPrefGroupUI.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. from PyQt5 import QtWidgets
  2. from flatcamGUI.GUIElements import FCDoubleSpinner, RadioSet
  3. from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
  4. class Tools2InvertPrefGroupUI(OptionsGroupUI):
  5. def __init__(self, decimals=4, parent=None):
  6. super(Tools2InvertPrefGroupUI, self).__init__(self)
  7. self.setTitle(str(_("Invert Gerber Tool Options")))
  8. self.decimals = decimals
  9. # ## Subtractor Tool Parameters
  10. self.sublabel = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
  11. self.sublabel.setToolTip(
  12. _("A tool to invert Gerber geometry from positive to negative\n"
  13. "and in revers.")
  14. )
  15. self.layout.addWidget(self.sublabel)
  16. # Grid Layout
  17. grid0 = QtWidgets.QGridLayout()
  18. grid0.setColumnStretch(0, 0)
  19. grid0.setColumnStretch(1, 1)
  20. self.layout.addLayout(grid0)
  21. # Margin
  22. self.margin_label = QtWidgets.QLabel('%s:' % _('Margin'))
  23. self.margin_label.setToolTip(
  24. _("Distance by which to avoid\n"
  25. "the edges of the Gerber object.")
  26. )
  27. self.margin_entry = FCDoubleSpinner()
  28. self.margin_entry.set_precision(self.decimals)
  29. self.margin_entry.set_range(0.0000, 9999.9999)
  30. self.margin_entry.setObjectName(_("Margin"))
  31. grid0.addWidget(self.margin_label, 2, 0, 1, 2)
  32. grid0.addWidget(self.margin_entry, 3, 0, 1, 2)
  33. self.join_label = QtWidgets.QLabel('%s:' % _("Lines Join Style"))
  34. self.join_label.setToolTip(
  35. _("The way that the lines in the object outline will be joined.\n"
  36. "Can be:\n"
  37. "- rounded -> an arc is added between two joining lines\n"
  38. "- square -> the lines meet in 90 degrees angle\n"
  39. "- bevel -> the lines are joined by a third line")
  40. )
  41. self.join_radio = RadioSet([
  42. {'label': 'Rounded', 'value': 'r'},
  43. {'label': 'Square', 'value': 's'},
  44. {'label': 'Bevel', 'value': 'b'}
  45. ], orientation='vertical', stretch=False)
  46. grid0.addWidget(self.join_label, 5, 0, 1, 2)
  47. grid0.addWidget(self.join_radio, 7, 0, 1, 2)
  48. self.layout.addStretch()