Signed-off-by: falkTX <falktx@falktx.com>tags/v2.2.0-RC1
@@ -279,7 +279,7 @@ class CanvasBox(QGraphicsObject): | |||||
return | return | ||||
qCritical("PatchCanvas::CanvasBox.removeLineFromGroup(%i) - unable to find line to remove" % connection_id) | qCritical("PatchCanvas::CanvasBox.removeLineFromGroup(%i) - unable to find line to remove" % connection_id) | ||||
def checkItemPos(self, blockSignals): | |||||
def checkItemPos(self): | |||||
if canvas.size_rect.isNull(): | if canvas.size_rect.isNull(): | ||||
return | return | ||||
@@ -288,9 +288,6 @@ class CanvasBox(QGraphicsObject): | |||||
canvas.size_rect.contains(pos + QPointF(self.p_width, self.p_height))): | canvas.size_rect.contains(pos + QPointF(self.p_width, self.p_height))): | ||||
return | return | ||||
if blockSignals: | |||||
self.blockSignals(True) | |||||
if pos.x() < canvas.size_rect.x(): | if pos.x() < canvas.size_rect.x(): | ||||
self.setPos(canvas.size_rect.x(), pos.y()) | self.setPos(canvas.size_rect.x(), pos.y()) | ||||
elif pos.x() + self.p_width > canvas.size_rect.width(): | elif pos.x() + self.p_width > canvas.size_rect.width(): | ||||
@@ -302,9 +299,6 @@ class CanvasBox(QGraphicsObject): | |||||
elif pos.y() + self.p_height > canvas.size_rect.height(): | elif pos.y() + self.p_height > canvas.size_rect.height(): | ||||
self.setPos(pos.x(), canvas.size_rect.height() - self.p_height) | self.setPos(pos.x(), canvas.size_rect.height() - self.p_height) | ||||
if blockSignals: | |||||
self.blockSignals(False) | |||||
def removeIconFromScene(self): | def removeIconFromScene(self): | ||||
if self.icon_svg is None: | if self.icon_svg is None: | ||||
return | return | ||||
@@ -373,7 +373,7 @@ def addGroup(group_id, group_name, split=SPLIT_UNDEF, icon=ICON_APPLICATION): | |||||
if options.eyecandy == EYECANDY_FULL and not options.auto_hide_groups: | if options.eyecandy == EYECANDY_FULL and not options.auto_hide_groups: | ||||
CanvasItemFX(group_sbox, True, False) | CanvasItemFX(group_sbox, True, False) | ||||
group_sbox.checkItemPos(True) | |||||
group_sbox.checkItemPos() | |||||
else: | else: | ||||
group_box.setSplit(False) | group_box.setSplit(False) | ||||
@@ -387,7 +387,7 @@ def addGroup(group_id, group_name, split=SPLIT_UNDEF, icon=ICON_APPLICATION): | |||||
horizontal = bool(icon == ICON_HARDWARE or icon == ICON_LADISH_ROOM) | horizontal = bool(icon == ICON_HARDWARE or icon == ICON_LADISH_ROOM) | ||||
group_box.setPos(CanvasGetNewGroupPos(horizontal)) | group_box.setPos(CanvasGetNewGroupPos(horizontal)) | ||||
group_box.checkItemPos(True) | |||||
group_box.checkItemPos() | |||||
canvas.last_z_value += 1 | canvas.last_z_value += 1 | ||||
group_box.setZValue(canvas.last_z_value) | group_box.setZValue(canvas.last_z_value) | ||||
@@ -704,11 +704,13 @@ def setGroupPosFull(group_id, group_pos_x_o, group_pos_y_o, group_pos_x_i, group | |||||
if group.group_id == group_id: | if group.group_id == group_id: | ||||
group.widgets[0].blockSignals(True) | group.widgets[0].blockSignals(True) | ||||
group.widgets[0].setPos(group_pos_x_o, group_pos_y_o) | group.widgets[0].setPos(group_pos_x_o, group_pos_y_o) | ||||
group.widgets[0].checkItemPos() | |||||
group.widgets[0].blockSignals(False) | group.widgets[0].blockSignals(False) | ||||
if group.split and group.widgets[1]: | if group.split and group.widgets[1]: | ||||
group.widgets[1].blockSignals(True) | group.widgets[1].blockSignals(True) | ||||
group.widgets[1].setPos(group_pos_x_i, group_pos_y_i) | group.widgets[1].setPos(group_pos_x_i, group_pos_y_i) | ||||
group.widgets[1].checkItemPos() | |||||
group.widgets[1].blockSignals(False) | group.widgets[1].blockSignals(False) | ||||
QTimer.singleShot(0, canvas.scene.update) | QTimer.singleShot(0, canvas.scene.update) | ||||
@@ -366,7 +366,7 @@ class PatchScene(QGraphicsScene): | |||||
items_list = self.selectedItems() | items_list = self.selectedItems() | ||||
for item in items_list: | for item in items_list: | ||||
if item and item.isVisible() and item.type() == CanvasBoxType: | if item and item.isVisible() and item.type() == CanvasBoxType: | ||||
item.checkItemPos(False) | |||||
item.checkItemPos() | |||||
if len(items_list) > 1: | if len(items_list) > 1: | ||||
canvas.scene.update() | canvas.scene.update() | ||||