- made the Grid icon in the status bar clickable and it will toggle the snap to grid function
This commit is contained in:
@@ -2268,7 +2268,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
self.fcinfo = FlatCAMInfoBar(app=self.app)
|
||||
self.infobar.addWidget(self.fcinfo, stretch=1)
|
||||
|
||||
self.snap_infobar_label = QtWidgets.QLabel()
|
||||
self.snap_infobar_label = FCLabel()
|
||||
self.snap_infobar_label.setPixmap(QtGui.QPixmap(self.app.resource_location + '/snap_16.png'))
|
||||
self.infobar.addWidget(self.snap_infobar_label)
|
||||
|
||||
|
||||
@@ -1417,9 +1417,19 @@ class FCButton(QtWidgets.QPushButton):
|
||||
|
||||
|
||||
class FCLabel(QtWidgets.QLabel):
|
||||
|
||||
clicked = QtCore.pyqtSignal(bool)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super(FCLabel, self).__init__(parent)
|
||||
|
||||
# for the usage of this label as a clickable label, to know that current state
|
||||
self.clicked_state = False
|
||||
|
||||
def mousePressEvent(self, ev: QtGui.QMouseEvent) -> None:
|
||||
self.clicked_state = not self.clicked_state
|
||||
self.clicked.emit(self.clicked_state)
|
||||
|
||||
def get_value(self):
|
||||
return self.text()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user