From 843d6bc29f6057606230bf55d48b560862fe66b8 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Mon, 20 Feb 2023 00:07:41 +0530 Subject: Repositioning Line Grips and change color of Size Grip and Show Grips on hovering Size Grip --- src/main/python/shapes/shapes.py | 84 ++++++++++++++++++++++----------------- src/main/python/utils/graphics.py | 9 ++++- 2 files changed, 55 insertions(+), 38 deletions(-) diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 5446e98..20b17ad 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -121,22 +121,32 @@ class SizeGripItem(QGraphicsPathItem): else: return orientationEnum[self._direction] - def updatePath(self): + def updatePath(self,m_index): """updates path of size grip item """ width = height = 0 if self.direction is Qt.Horizontal: - height = self.parentItem().boundingRect().height() + height = self.parentItem().boundingRect().height()+30 + else: - width = self.parentItem().boundingRect().width() + width = self.parentItem().boundingRect().width()+35 path = QPainterPath() - path.addRect(QRectF(-width / 2, -height / 2, width, height)) + if(m_index == 0): + tempRect = QRectF((-width / 2),( -height / 2)-15, width, height) + if(m_index == 1): + tempRect = QRectF((-width / 2)-17.5,( -height / 2), width, height) + if(m_index == 2): + tempRect = QRectF((-width / 2),( -height / 2)+15, width, height) + if(m_index == 3): + tempRect = QRectF((-width / 2)+17.5,( -height / 2), width, height) + #print(tempRect) + path.addRect(tempRect) self.setPath(path) def updatePosition(self): """updates position of grip items """ - self.updatePath() + self.updatePath(self.m_index) pos = self.point(self.m_index) self.setEnabled(False) self.setPos(pos) @@ -206,7 +216,7 @@ class SizeGripItem(QGraphicsPathItem): def show(self): # make self visible - self.setPen(QPen(QColor("black"), 2)) + self.setPen(QPen(QColor(128, 128, 128,200), 2)) def hide(self): # hide self by setting pen to transparent @@ -427,7 +437,7 @@ class LineGripItem(QGraphicsPathItem): """ shows line grip item """ self.setPen(QPen(QColor("black"), 2)) - self.setBrush(QColor("cyan")) + self.setBrush(QColor(140,199,198,255)) def hide(self): """ hides line grip item @@ -813,9 +823,9 @@ class OilGasOrPulverizedFuelFurnace(NodeItem): self.grips = [ [58.27673386073162, 100, "top"], [0, 19.692723451106, "left"], - [17.2777337415748, 33.3944873323144, "left", 66.7889746646288], - [100, 33.3944873323144, "right", 66.7889746646288], - [57.9723659874, 0, "bottom", 81.389264491796] + [17.2777337415748-5, 33.3944873323144, "left", 66.7889746646288], + [100+5, 33.3944873323144, "right", 66.7889746646288], + [57.9723659874, 0-10, "bottom", 81.389264491796] ] @@ -824,9 +834,9 @@ class SolidFuelFurnace(NodeItem): super(SolidFuelFurnace, self).__init__("svg/Furnaces and Boilers/Solid Fuel Furnace") self.grips = [ [50, 100, "top"], - [0, 33.39352642259468, "left", 66.78705284518936], - [100, 33.39352642259468, "right", 66.78705284518936], - [50, 0, "bottom", 100] + [0-5, 33.39352642259468, "left", 66.78705284518936], + [100+5, 33.39352642259468, "right", 66.78705284518936], + [50, 0-10, "bottom", 100] ] @@ -865,10 +875,10 @@ class HorizontalVessel(NodeItem): def __init__(self): super(HorizontalVessel, self).__init__("svg/Process Vessels/Horizontal Vessel") self.grips = [ - [50, 100, "top", 87.08554680344], + [50, 100+10, "top", 87.08554680344], [0, 50, "left"], [100, 50, "right"], - [50, 0, "bottom", 87.08554680344] + [50, 0-10, "bottom", 87.08554680344] ] @@ -877,8 +887,8 @@ class PackedVessel(NodeItem): super(PackedVessel, self).__init__("svg/Process Vessels/Packed Vessel") self.grips = [ [50, 100, "top"], - [0, 50, "left", 86.703566201060], - [100, 50, "right", 86.703566201060], + [0-10, 50, "left", 86.703566201060], + [100+10, 50, "right", 86.703566201060], [50, 0, "bottom"] ] @@ -895,8 +905,8 @@ class VerticalVessel(NodeItem): super(VerticalVessel, self).__init__("svg/Process Vessels/Vertical Vessel") self.grips = [ [50, 100, "top"], - [0, 50, "left", 86.703566201060], - [100, 50, "right", 86.703566201060], + [0-10, 50, "left", 86.703566201060], + [100+10, 50, "right", 86.703566201060], [50, 0, "bottom"] ] @@ -917,9 +927,9 @@ class FixedRoofTank(NodeItem): super(FixedRoofTank, self).__init__("svg/Storage Vessels Tanks/Fixed Roof Tank") self.grips = [ [50, 100, "top"], - [0, 50, "left", 100], - [100, 50, "right", 100], - [50, 0, "bottom", 100] + [0-6, 50, "left", 100], + [100+7, 50, "right", 100], + [50, 0-10, "bottom", 100] ] @@ -927,9 +937,9 @@ class FloatingRoofTank(NodeItem): def __init__(self): super(FloatingRoofTank, self).__init__("svg/Storage Vessels Tanks/Floating Roof Tank") self.grips = [ - [0, 50, "left", 100], - [100, 50, "right", 100], - [50, 0, "bottom", 100] + [0-7, 50, "left", 100], + [100+7, 50, "right", 100], + [50, 0-10, "bottom", 100] ] @@ -937,10 +947,10 @@ class SeparatorsForLiquidsDecanter(NodeItem): def __init__(self): super(SeparatorsForLiquidsDecanter, self).__init__("svg/Separators/Separators for Liquids, Decanter") self.grips = [ - [50, 100, "top", 100], - [0, 50, "left", 100], - [100, 50, "right", 100], - [50, 0, "bottom", 100] + [50, 100+10, "top", 100], + [0-10, 50, "left", 100], + [100+10, 50, "right", 100], + [50, 0-10, "bottom", 100] ] class GateValve(NodeItem): @@ -965,11 +975,11 @@ class OneCellFiredHeaterFurnace(NodeItem): super(OneCellFiredHeaterFurnace, self).__init__("svg/Furnaces and Boilers/One Cell Fired Heater, Furnace") self.grips = [ [50, 100, "top"], - [0, 25, "left", 50], + [0-7, 25, "left", 50], [25, 87.5, "left", 25], - [100, 25, "right", 50], + [100+7, 25, "right", 50], [75, 87.5, "right", 25], - [50, 0, "bottom", 100] + [50, 0-10, "bottom", 100] ] @@ -978,12 +988,12 @@ class TwoCellFiredHeaterFurnace(NodeItem): super(TwoCellFiredHeaterFurnace, self).__init__("svg/Furnaces and Boilers/Two Cell Fired Heater, Furnace") self.grips = [ [50, 100, "top"], - [0, 33.33, "left", 66.66], + [0-5, 33.33, "left", 66.66], [33.33, 91.66, "left", 16.66], - [100, 33.33, "right", 66.66], + [100+5, 33.33, "right", 66.66], [66.66, 91.66, "right", 16.66], - [16.67, 0, "bottom", 33.33], - [83.33, 0, "bottom", 33.33] + [16.67, 0-10, "bottom", 33.33], + [83.33, 0-10, "bottom", 33.33] ] @@ -1011,7 +1021,7 @@ class ContinuousDryer(NodeItem): self.grips = [ [8.13, 35.2, "top"], [98.9, 28, "bottom"], - [50, 100, "top", 60.13] + [50, 100+10, "top", 60.13] ] diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index 5a44400..7398a2d 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -1,5 +1,5 @@ from PyQt5.QtCore import Qt, QPointF, pyqtSignal -from PyQt5.QtGui import QPen, QKeySequence +from PyQt5.QtGui import QPen, QKeySequence, QTransform, QCursor from PyQt5.QtWidgets import QGraphicsView, QGraphicsScene, QGraphicsProxyWidget, QGraphicsItem, QUndoStack, QAction, QUndoView from .undo import * @@ -147,6 +147,13 @@ class CustomScene(QGraphicsScene): self.movingItem = None #clear movingitem reference return super(CustomScene, self).mouseReleaseEvent(event) + def mouseMoveEvent(self, mouseEvent): + item = self.itemAt(mouseEvent.scenePos().x(), mouseEvent.scenePos().y(), + QTransform()) + if isinstance(item,shapes.SizeGripItem): + item.parentItem().showGripItem() + super(CustomScene,self).mouseMoveEvent(mouseEvent) + def reInsertLines(self): currentIndex = self.undoStack.index() i = 2 -- cgit From f188f7d75a73a1cda3c9e65505fffdd0f8c063e2 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Mon, 20 Feb 2023 13:16:51 +0530 Subject: Reattaching Node Line to Node Item --- src/main/python/shapes/line.py | 37 ++++++++++++++++++++++++++++++++++ src/main/python/shapes/rLGPlus.txt | 41 ++++++++++++++++++++++++++++++++++++++ src/main/python/shapes/shapes.py | 38 +++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 src/main/python/shapes/rLGPlus.txt diff --git a/src/main/python/shapes/line.py b/src/main/python/shapes/line.py index 856869d..4e5271a 100644 --- a/src/main/python/shapes/line.py +++ b/src/main/python/shapes/line.py @@ -5,6 +5,18 @@ from PyQt5.QtCore import Qt, QPointF, QRectF, QLineF, pyqtSignal from collections import defaultdict +#For extending Lines for repositioned Rectangular Line Grips +rLGPlus = {} +f = open('./shapes/rLGPlus.txt','r') +dataRead = f.readlines()[1:] +for line in dataRead: + + if not line.__contains__(',') : + rLGPlus[line.strip()] = [] + else: + grips = line.strip().split(',') + rLGPlus[list(rLGPlus.keys())[-1]].append(grips) + class Grabber(QGraphicsPathItem): """ Extends QGraphicsPathItem to create grabber for line for moving a particular segment @@ -796,6 +808,31 @@ class Line(QGraphicsPathItem): def updatePath(self): """ update path when svg item moves """ + #Adjusting line for repositioned retangular grips + if self.startGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[self.startGripItem.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if self.startGripItem.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.startPoint.setX(self.startPoint.x()+tempx) + self.startPoint.setY(self.startPoint.y()+tempy) + else: + if self.startGripItem.m_location == tgrip[0] and self.startGripItem.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.startPoint.setX(self.startPoint.x()+tempx) + self.startPoint.setY(self.startPoint.y()+tempy) + if self.endGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[self.endGripItem.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if self.endGripItem.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.endPoint.setX(self.endPoint.x()+tempx) + self.endPoint.setY(self.endPoint.y()+tempy) + else: + if self.endGripItem.m_location == tgrip[0] and self.endGripItems.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.endPoint.setX(self.endPoint.x()+tempx) + self.endPoint.setY(self.endPoint.y()+tempy) path = QPainterPath(self.startPoint) self.updatePoints() diff --git a/src/main/python/shapes/rLGPlus.txt b/src/main/python/shapes/rLGPlus.txt new file mode 100644 index 0000000..4cf8534 --- /dev/null +++ b/src/main/python/shapes/rLGPlus.txt @@ -0,0 +1,41 @@ +#Contains data of the distance rectangular line grips were extended className:direction,x,y,width +OilGasOrPulverizedFuelFurnace +left,5,0,0 +right,-5,0,0 +bottom,0,-10,0 +SolidFuelFurnace +left,5,0,0 +right,-5,0,0 +bottom,0,-10,0 +HorizontalVessel +top,0,10,0 +bottom,0,-10,0 +PackedVessel +left,10,0,0 +right,-10,0,0 +VerticalVessel +left,10,0,0 +right,-10,0,0 +FixedRoofTank +left,6,0,0 +right,-7,0,0 +bottom,0,-10,0 +FloatingRoofTank +left,7,0,0 +right,-7,0,0 +bottom,0,-10,0 +SeparatorsForLiquidsDecanter +top,0,10,0 +left,10,0,0 +right,-10,0,0 +bottom,0,-10,0 +OneCellFiredHeaterFurnace +left,7,0,50 +right,-7,0,50 +bottom,0,-10,0 +TwoCellFiredHeaterFurnace +left,5,0,66.66 +right,-5,0,66.66 +bottom,0,-10,33.33 +ContinuousDryer +top,0,10,0 \ No newline at end of file diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 20b17ad..20ca4a8 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -26,6 +26,18 @@ orientationEnum = [ Qt.Vertical ] +#For extending Lines for repositioned Rectangular Line Grips +rLGPlus = {} +f = open('./shapes/rLGPlus.txt','r') +dataRead = f.readlines()[1:] +for line in dataRead: + + if not line.__contains__(',') : + rLGPlus[line.strip()] = [] + else: + grips = line.strip().split(',') + rLGPlus[list(rLGPlus.keys())[-1]].append(grips) + class ItemLabel(QGraphicsTextItem): """Extends PyQt5's QGraphicsPathItem to create text label for svg item """ @@ -409,6 +421,32 @@ class LineGripItem(QGraphicsPathItem): if self.tempLine.startGripItem.parentItem() != self.tempLine.endGripItem.parentItem(): # update line with end point so it sets final path self.tempLine.updateLine(endPoint=endPoint) + #Adjusting line for repositioned retangular grips + if self.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[self.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if self.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.tempLine.startPoint.setX(self.tempLine.startPoint.x()+tempx) + self.tempLine.startPoint.setY(self.tempLine.startPoint.y()+tempy) + else: + if self.m_location == tgrip[0] and self.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.tempLine.startPoint.setX(self.tempLine.startPoint.x()+tempx) + self.tempLine.startPoint.setY(self.tempLine.startPoint.y()+tempy) + if item.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[item.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if item.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.tempLine.endPoint.setX(self.tempLine.endPoint.x()+tempx) + self.tempLine.endPoint.setY(self.tempLine.endPoint.y()+tempy) + else: + if item.m_location == tgrip[0] and item.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.tempLine.endPoint.setX(self.tempLine.endPoint.x()+tempx) + self.tempLine.endPoint.setY(self.tempLine.endPoint.y()+tempy) + self.lines.append(self.tempLine) item.lines.append(self.tempLine) tag = 1 -- cgit From e816c10f23eda7f8727ee691d89921b7f8f462b6 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Mon, 20 Feb 2023 15:19:50 +0530 Subject: Thicker and bigger size grip --- src/main/python/shapes/shapes.py | 8 ++++---- src/main/python/utils/graphics.py | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 20ca4a8..afd25b8 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -138,17 +138,17 @@ class SizeGripItem(QGraphicsPathItem): """ width = height = 0 if self.direction is Qt.Horizontal: - height = self.parentItem().boundingRect().height()+30 + height = self.parentItem().boundingRect().height()+40 else: width = self.parentItem().boundingRect().width()+35 path = QPainterPath() if(m_index == 0): - tempRect = QRectF((-width / 2),( -height / 2)-15, width, height) + tempRect = QRectF((-width / 2),( -height / 2)-20, width, height) if(m_index == 1): tempRect = QRectF((-width / 2)-17.5,( -height / 2), width, height) if(m_index == 2): - tempRect = QRectF((-width / 2),( -height / 2)+15, width, height) + tempRect = QRectF((-width / 2),( -height / 2)+20, width, height) if(m_index == 3): tempRect = QRectF((-width / 2)+17.5,( -height / 2), width, height) #print(tempRect) @@ -228,7 +228,7 @@ class SizeGripItem(QGraphicsPathItem): def show(self): # make self visible - self.setPen(QPen(QColor(128, 128, 128,200), 2)) + self.setPen(QPen(QColor(128, 128, 128,150), 4)) def hide(self): # hide self by setting pen to transparent diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index 7398a2d..b66e68b 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -115,8 +115,7 @@ class CustomScene(QGraphicsScene): for j in i.lines: self.count+=1 self.undoStack.push(deleteCommand(j, self)) - if itemToDelete.__class__ != shapes.line.Grabber: - self.undoStack.push(deleteCommand(itemToDelete, self)) + self.undoStack.push(deleteCommand(itemToDelete, self)) def itemMoved(self, movedItem, lastPos): #item move event, checks if item is moved -- cgit From 0812086cb71a6c1e714c8bf0d115868b8d1f81d7 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Mon, 20 Feb 2023 16:30:27 +0530 Subject: Reattaching Node Line to Node Item(Revised) --- src/main/python/shapes/line.py | 51 +++++++++++++++++---------------- src/main/python/shapes/rLGPlus.txt | 58 +++++++++++++++++++------------------- src/main/python/shapes/shapes.py | 2 +- 3 files changed, 56 insertions(+), 55 deletions(-) diff --git a/src/main/python/shapes/line.py b/src/main/python/shapes/line.py index 4e5271a..ba0c564 100644 --- a/src/main/python/shapes/line.py +++ b/src/main/python/shapes/line.py @@ -808,31 +808,6 @@ class Line(QGraphicsPathItem): def updatePath(self): """ update path when svg item moves """ - #Adjusting line for repositioned retangular grips - if self.startGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): - for tgrip in rLGPlus[self.startGripItem.parentItem().__class__.__name__]: - if(float(tgrip[3]) == 0): - if self.startGripItem.m_location == tgrip[0]: - tempx,tempy = int(tgrip[1]),int(tgrip[2]) - self.startPoint.setX(self.startPoint.x()+tempx) - self.startPoint.setY(self.startPoint.y()+tempy) - else: - if self.startGripItem.m_location == tgrip[0] and self.startGripItem.size == float(tgrip[3]): - tempx,tempy = int(tgrip[1]),int(tgrip[2]) - self.startPoint.setX(self.startPoint.x()+tempx) - self.startPoint.setY(self.startPoint.y()+tempy) - if self.endGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): - for tgrip in rLGPlus[self.endGripItem.parentItem().__class__.__name__]: - if(float(tgrip[3]) == 0): - if self.endGripItem.m_location == tgrip[0]: - tempx,tempy = int(tgrip[1]),int(tgrip[2]) - self.endPoint.setX(self.endPoint.x()+tempx) - self.endPoint.setY(self.endPoint.y()+tempy) - else: - if self.endGripItem.m_location == tgrip[0] and self.endGripItems.size == float(tgrip[3]): - tempx,tempy = int(tgrip[1]),int(tgrip[2]) - self.endPoint.setX(self.endPoint.x()+tempx) - self.endPoint.setY(self.endPoint.y()+tempy) path = QPainterPath(self.startPoint) self.updatePoints() @@ -973,6 +948,19 @@ class Line(QGraphicsPathItem): startPoint.setY( startPoint.y() - self.startGap * item.boundingRect().height()) self.startPoint = startPoint + #Adjusting line for repositioned retangular grips + if self.startGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[self.startGripItem.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if self.startGripItem.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.startPoint.setX(self.startPoint.x()+tempx) + self.startPoint.setY(self.startPoint.y()+tempy) + else: + if self.startGripItem.m_location == tgrip[0] and self.startGripItem.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.startPoint.setX(self.startPoint.x()+tempx) + self.startPoint.setY(self.startPoint.y()+tempy) # end point on line if self.endGripItem: item = self.endGripItem @@ -985,6 +973,19 @@ class Line(QGraphicsPathItem): endPoint.setY( endPoint.y() - self.endGap * item.boundingRect().height()) self.endPoint = endPoint + #Adjusting line for repositioned retangular grips + if self.endGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[self.endGripItem.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if self.endGripItem.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.endPoint.setX(self.endPoint.x()+tempx) + self.endPoint.setY(self.endPoint.y()+tempy) + else: + if self.endGripItem.m_location == tgrip[0] and self.endGripItem.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.endPoint.setX(self.endPoint.x()+tempx) + self.endPoint.setY(self.endPoint.y()+tempy) self.updatePath() # end point on other line elif self.refLine: diff --git a/src/main/python/shapes/rLGPlus.txt b/src/main/python/shapes/rLGPlus.txt index 4cf8534..0cd2e86 100644 --- a/src/main/python/shapes/rLGPlus.txt +++ b/src/main/python/shapes/rLGPlus.txt @@ -1,41 +1,41 @@ #Contains data of the distance rectangular line grips were extended className:direction,x,y,width OilGasOrPulverizedFuelFurnace -left,5,0,0 -right,-5,0,0 -bottom,0,-10,0 +left,4,0,0 +right,-4,0,0 +bottom,0,-8,0 SolidFuelFurnace -left,5,0,0 -right,-5,0,0 -bottom,0,-10,0 +left,4,0,0 +right,-4,0,0 +bottom,0,-8,0 HorizontalVessel -top,0,10,0 -bottom,0,-10,0 +top,0,6,0 +bottom,0,-6,0 PackedVessel -left,10,0,0 -right,-10,0,0 +left,6,0,0 +right,-6,0,0 VerticalVessel -left,10,0,0 -right,-10,0,0 -FixedRoofTank left,6,0,0 -right,-7,0,0 -bottom,0,-10,0 +right,-6,0,0 +FixedRoofTank +left,5,0,0 +right,-6,0,0 +bottom,0,-8,0 FloatingRoofTank -left,7,0,0 -right,-7,0,0 -bottom,0,-10,0 +left,6,0,0 +right,-6,0,0 +bottom,0,-8,0 SeparatorsForLiquidsDecanter -top,0,10,0 -left,10,0,0 -right,-10,0,0 -bottom,0,-10,0 +top,0,8,0 +left,8,0,0 +right,-8,0,0 +bottom,0,-8,0 OneCellFiredHeaterFurnace -left,7,0,50 -right,-7,0,50 -bottom,0,-10,0 +left,5,0,50 +right,-5,0,50 +bottom,0,-8,0 TwoCellFiredHeaterFurnace -left,5,0,66.66 -right,-5,0,66.66 -bottom,0,-10,33.33 +left,3,0,66.66 +right,-3,0,66.66 +bottom,0,-8,33.33 ContinuousDryer -top,0,10,0 \ No newline at end of file +top,0,8,0 \ No newline at end of file diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index afd25b8..d14eee6 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -474,7 +474,7 @@ class LineGripItem(QGraphicsPathItem): def show(self): """ shows line grip item """ - self.setPen(QPen(QColor("black"), 2)) + self.setPen(QPen(QColor(0,0,0,150), 1.5)) self.setBrush(QColor(140,199,198,255)) def hide(self): -- cgit From ace3fdf49db84e65c78a98a7cb81986bfbff3816 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Mon, 20 Feb 2023 17:23:35 +0530 Subject: Make Size Grip Hover Area larger --- src/main/python/shapes/shapes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index d14eee6..f579b1e 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -144,13 +144,13 @@ class SizeGripItem(QGraphicsPathItem): width = self.parentItem().boundingRect().width()+35 path = QPainterPath() if(m_index == 0): - tempRect = QRectF((-width / 2),( -height / 2)-20, width, height) + tempRect = QRectF((-width / 2),( -height / 2)-20, width, height+10) if(m_index == 1): - tempRect = QRectF((-width / 2)-17.5,( -height / 2), width, height) + tempRect = QRectF((-width / 2)-17.5,( -height / 2), width+8.75, height) if(m_index == 2): - tempRect = QRectF((-width / 2),( -height / 2)+20, width, height) + tempRect = QRectF((-width / 2),( -height / 2)+20, width, height-10) if(m_index == 3): - tempRect = QRectF((-width / 2)+17.5,( -height / 2), width, height) + tempRect = QRectF((-width / 2)+17.5,( -height / 2), width-8.75, height) #print(tempRect) path.addRect(tempRect) self.setPath(path) @@ -228,7 +228,7 @@ class SizeGripItem(QGraphicsPathItem): def show(self): # make self visible - self.setPen(QPen(QColor(128, 128, 128,150), 4)) + self.setPen(QPen(QColor(128, 128, 128,150), 2)) def hide(self): # hide self by setting pen to transparent -- cgit From 2fd33c0f594531aa473664f5ddf71d3af1c9f427 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 21 Feb 2023 13:04:53 +0530 Subject: Fix #32 Select all and delete working --- src/main/python/utils/graphics.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index b66e68b..c4e1843 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -105,17 +105,15 @@ class CustomScene(QGraphicsScene): # (slot) used to delete all selected items, and add undo action for each of them if self.selectedItems(): for item in self.selectedItems(): - if(issubclass(item.__class__,shapes.LineGripItem) or issubclass(item.__class__,shapes.SizeGripItem) ): - itemToDelete = item.parentItem() - else: - itemToDelete = item - self.count = 0 - if(issubclass(itemToDelete.__class__,shapes.NodeItem)): - for i in itemToDelete.lineGripItems: - for j in i.lines: - self.count+=1 - self.undoStack.push(deleteCommand(j, self)) - self.undoStack.push(deleteCommand(itemToDelete, self)) + if issubclass(item.__class__,shapes.NodeItem) or isinstance(item,shapes.Line): + itemToDelete = item + self.count = 0 + if(issubclass(itemToDelete.__class__,shapes.NodeItem)): + for i in itemToDelete.lineGripItems: + for j in i.lines: + self.count+=1 + self.undoStack.push(deleteCommand(j, self)) + self.undoStack.push(deleteCommand(itemToDelete, self)) def itemMoved(self, movedItem, lastPos): #item move event, checks if item is moved -- cgit From a6814bfd4c6a9eb228a8939d1dee0dd0b5d16786 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 21 Feb 2023 14:07:35 +0530 Subject: Fix #33 Restrict Movable area of Node Items --- src/main/python/shapes/shapes.py | 17 ++++++++++++++++- src/main/python/utils/graphics.py | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index f579b1e..e0d6617 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -625,6 +625,7 @@ class NodeItem(QGraphicsSvgItem): def itemChange(self, change, value): """Overloads and extends QGraphicsSvgItem to also update grip items """ + newPos = value # check if item selected is changed if change == QGraphicsItem.ItemSelectedHasChanged: # show grips if selected @@ -642,7 +643,21 @@ class NodeItem(QGraphicsSvgItem): # update grips self.updateLineGripItem() self.updateSizeGripItem() - return + + #restrict movable area of Node Item + + if self.parent() is not None: + rect = self.parent().sceneRect() + width = self.boundingRect().width() + height = self.boundingRect().height() + eWH1 = QPointF(newPos.x()+width,newPos.y()+height) + eWH2 = QPointF(newPos.x()-width,newPos.y()-height) + if not rect.__contains__(eWH1) or not rect.__contains__(eWH2) : + newPos.setX(min(rect.right()-width+40, max(newPos.x(), rect.left()+90))) + newPos.setY(min(rect.bottom()-height, max(newPos.y(), rect.top()+70))) + self.setPos(newPos) + return super(NodeItem,self).itemChange(change, newPos) + # check if item is add on scene if change == QGraphicsItem.ItemSceneHasChanged and self.scene(): # add grips and update them diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index c4e1843..1b797d5 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -44,6 +44,7 @@ class CustomView(QGraphicsView): graphic = getattr(shapes, obj[0])(*map(lambda x: int(x) if x.isdigit() else x, obj[1:])) graphic.setPos(QDropEvent.pos().x(), QDropEvent.pos().y()) self.scene().addItemPlus(graphic) + graphic.setParent(self) QDropEvent.acceptProposedAction() def wheelEvent(self, QWheelEvent): -- cgit From 4b9b56ae9372f5b0582c9f3e9958f5deeb8cad17 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 21 Feb 2023 18:08:43 +0530 Subject: Size Grip Design(Revised) --- src/main/python/shapes/shapes.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index e0d6617..8fb37d6 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -138,19 +138,18 @@ class SizeGripItem(QGraphicsPathItem): """ width = height = 0 if self.direction is Qt.Horizontal: - height = self.parentItem().boundingRect().height()+40 - + height = self.parentItem().boundingRect().height()+20 else: - width = self.parentItem().boundingRect().width()+35 + width = self.parentItem().boundingRect().width()+20 path = QPainterPath() if(m_index == 0): - tempRect = QRectF((-width / 2),( -height / 2)-20, width, height+10) + tempRect = QRectF((-width / 2),( -height / 2)-10, width, height) if(m_index == 1): - tempRect = QRectF((-width / 2)-17.5,( -height / 2), width+8.75, height) + tempRect = QRectF((-width / 2)-10,( -height / 2), width, height) if(m_index == 2): - tempRect = QRectF((-width / 2),( -height / 2)+20, width, height-10) + tempRect = QRectF((-width / 2),( -height / 2)+10, width, height) if(m_index == 3): - tempRect = QRectF((-width / 2)+17.5,( -height / 2), width-8.75, height) + tempRect = QRectF((-width / 2)+10,( -height / 2), width, height) #print(tempRect) path.addRect(tempRect) self.setPath(path) @@ -228,7 +227,7 @@ class SizeGripItem(QGraphicsPathItem): def show(self): # make self visible - self.setPen(QPen(QColor(128, 128, 128,150), 2)) + self.setPen(QPen(QColor(128, 128, 128,150), 4)) def hide(self): # hide self by setting pen to transparent @@ -350,7 +349,7 @@ class LineGripItem(QGraphicsPathItem): return # initialize a line and add on scene # restrict circle grip to one line - if self.size is None and len(self.lines) > 0: + if self.size is None and len(self.lines) < 0: pass else: startPoint = self.parentItem().mapToScene(self.pos()) # first point of line -- cgit From 8be2ab46dbd5ee6f443b3efdddd580e544ef3096 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 21 Feb 2023 20:30:44 +0530 Subject: Triangular Size Grip --- src/main/python/shapes/shapes.py | 46 ++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 8fb37d6..f53e5bd 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -136,22 +136,36 @@ class SizeGripItem(QGraphicsPathItem): def updatePath(self,m_index): """updates path of size grip item """ - width = height = 0 - if self.direction is Qt.Horizontal: - height = self.parentItem().boundingRect().height()+20 - else: - width = self.parentItem().boundingRect().width()+20 + bx = self.parentItem().boundingRect().x() + by = self.parentItem().boundingRect().y() + height = self.parentItem().boundingRect().height() + width = self.parentItem().boundingRect().width() + path = QPainterPath() - if(m_index == 0): - tempRect = QRectF((-width / 2),( -height / 2)-10, width, height) - if(m_index == 1): - tempRect = QRectF((-width / 2)-10,( -height / 2), width, height) - if(m_index == 2): - tempRect = QRectF((-width / 2),( -height / 2)+10, width, height) - if(m_index == 3): - tempRect = QRectF((-width / 2)+10,( -height / 2), width, height) - #print(tempRect) - path.addRect(tempRect) + if(m_index == 0):#top + by = by+10 + path.moveTo(bx+(width/2)-10,by) + path.lineTo(bx+(width/2)+10,by) + path.lineTo(bx+(width/2),by-20) + path.lineTo(bx+(width/2)-10,by) + if(m_index == 1):#left + bx = bx+10 + path.moveTo(bx,by+(height/2)-10) + path.lineTo(bx,by+(height/2)+10) + path.lineTo(bx-20,by+(height/2)) + path.lineTo(bx,by+(height/2)-10) + if(m_index == 2):#bottom + by = by-10 + path.moveTo(bx+(width/2)-10,by+height) + path.lineTo (bx+(width/2)+10,by+height) + path.lineTo (bx+(width/2),by+height+20) + path.lineTo (bx+(width/2)-10,by+height) + if(m_index == 3):#right + bx = bx-10 + path.moveTo(bx+width,by+(height/2)-10) + path.lineTo(bx+width,by+(height/2)+10) + path.lineTo(bx+width+20,by+(height/2)) + path.lineTo(bx+width,by+(height/2)-10) self.setPath(path) def updatePosition(self): @@ -227,7 +241,7 @@ class SizeGripItem(QGraphicsPathItem): def show(self): # make self visible - self.setPen(QPen(QColor(128, 128, 128,150), 4)) + self.setPen(QPen(QColor(128, 128, 128,150), 2)) def hide(self): # hide self by setting pen to transparent -- cgit From 02644569419711f7a69154055817d8507761b517 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 21 Feb 2023 22:07:06 +0530 Subject: Size Grip Activated on double click --- src/main/python/shapes/shapes.py | 50 ++++++++++++++++++++++++++++----------- src/main/python/utils/graphics.py | 2 +- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index f53e5bd..aa6bd06 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -113,7 +113,7 @@ class SizeGripItem(QGraphicsPathItem): self.setFlag(QGraphicsItem.ItemIsMovable, True) self.setFlag(QGraphicsItem.ItemSendsGeometryChanges, True) self.setAcceptHoverEvents(True) - self.setPen(QPen(QColor("black"), 0)) + self.setPen(QPen(Qt.NoPen)) self.setZValue(2) # property direction self._direction = (orientationEnum.index(direction) + self.parentItem().rotation) % 4 @@ -246,7 +246,7 @@ class SizeGripItem(QGraphicsPathItem): def hide(self): # hide self by setting pen to transparent if not self.parentItem().isSelected(): - self.setPen(QPen(Qt.transparent)) + self.setPen(QPen(Qt.NoPen)) self.setBrush(Qt.transparent) @@ -396,12 +396,13 @@ class LineGripItem(QGraphicsPathItem): # hide grip of previous hovered item if self.previousHoveredItem and item != self.previousHoveredItem and \ item not in self.previousHoveredItem.lineGripItems: - self.previousHoveredItem.hideGripItem() + self.previousHoveredItem.hideLineGripItem() + self.previousHoveredItem.hideSizeGripItem() super().mouseMoveEvent(mouseEvent) # show grip of current hoverde item if isinstance(item, NodeItem): self.previousHoveredItem = item - item.showGripItem() + item.showLineGripItem() def mouseReleaseEvent(self, mouseEvent): """Handle all mouse release for this item""" @@ -523,6 +524,7 @@ class NodeItem(QGraphicsSvgItem): self.label = None self._rotation = 0 self.flipState = [False, False] + self.activateGrip = False @property def flipH(self): @@ -643,9 +645,11 @@ class NodeItem(QGraphicsSvgItem): if change == QGraphicsItem.ItemSelectedHasChanged: # show grips if selected if value is True: - self.showGripItem() + self.showLineGripItem() + self.showSizeGripItem() else: - self.hideGripItem() + self.hideLineGripItem() + self.hideSizeGripItem() return # check if transform changed if change == QGraphicsItem.ItemTransformHasChanged: @@ -683,28 +687,46 @@ class NodeItem(QGraphicsSvgItem): def hoverEnterEvent(self, event): """defines shape highlighting on Mouse Over """ - self.showGripItem() + self.showLineGripItem() super(NodeItem, self).hoverEnterEvent(event) def hoverLeaveEvent(self, event): """defines shape highlighting on Mouse Leave """ - self.hideGripItem() + self.hideLineGripItem() + self.hideSizeGripItem() super(NodeItem, self).hoverLeaveEvent(event) + + def mouseDoubleClickEvent(self, event): + self.activateGrip = not self.activateGrip + if self.activateGrip == False: + self.hideSizeGripItem() + else: + self.showSizeGripItem() + super(NodeItem,self).mouseDoubleClickEvent(event) - def showGripItem(self): - """shows grip items of svg item + def showLineGripItem(self): + """shows line grip items of svg item """ for item in self.lineGripItems: item.show() - for item in self.sizeGripItems: - item.show() - def hideGripItem(self): - """hide grip items of svg item + def hideLineGripItem(self): + """hide line grip items of svg item """ for item in self.lineGripItems: item.hide() + + def showSizeGripItem(self): + """shows size grip items of svg item + """ + for item in self.sizeGripItems: + item.show() + + def hideSizeGripItem(self): + """hide size grip items of svg item + """ + self.activateGrip = False for item in self.sizeGripItems: item.hide() diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index 1b797d5..80eb5e7 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -149,7 +149,7 @@ class CustomScene(QGraphicsScene): item = self.itemAt(mouseEvent.scenePos().x(), mouseEvent.scenePos().y(), QTransform()) if isinstance(item,shapes.SizeGripItem): - item.parentItem().showGripItem() + item.parentItem().showLineGripItem() super(CustomScene,self).mouseMoveEvent(mouseEvent) def reInsertLines(self): -- cgit From 01131bf76cbe184f2ddc10a5e6ce668a2f5de6d2 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Wed, 22 Feb 2023 19:33:41 +0530 Subject: Remove Selection border for Size Grip --- src/main/python/shapes/shapes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index aa6bd06..acedf46 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -109,7 +109,7 @@ class SizeGripItem(QGraphicsPathItem): def __init__(self, index, direction=Qt.Horizontal, parent=None): super(SizeGripItem, self).__init__(parent=parent) # set graphical setting - self.setFlag(QGraphicsItem.ItemIsSelectable, True) + #self.setFlag(QGraphicsItem.ItemIsSelectable, True) self.setFlag(QGraphicsItem.ItemIsMovable, True) self.setFlag(QGraphicsItem.ItemSendsGeometryChanges, True) self.setAcceptHoverEvents(True) -- cgit From 7cc33e72b9cd08f41eb8d13a29f013238ca85577 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 28 Feb 2023 13:32:16 +0530 Subject: Toolbar Color Change and Close Button Added for Project Title Bar --- src/main/python/main.py | 4 ++-- src/main/python/utils/toolbar.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/python/main.py b/src/main/python/main.py index 3aa8e6a..bf94a5b 100644 --- a/src/main/python/main.py +++ b/src/main/python/main.py @@ -108,7 +108,7 @@ class appWindow(QMainWindow): if not project.tabList: # important when unpickling a file instead project.newDiagram() #create a new tab in the new file project.fileCloseEvent.connect(self.fileClosed) #closed file signal to switch to sub window view - if self.count > 1: #switch to tab view if needed + if self.count > 0: #switch to tab view if needed self.mdi.setViewMode(QMdiArea.TabbedView) project.show() @@ -170,7 +170,7 @@ class appWindow(QMainWindow): def fileClosed(self, index): #checks if the file tab menu needs to be removed - if self.count <= 2 : + if self.count <= 1 : self.mdi.setViewMode(QMdiArea.SubWindowView) def writeSettings(self): diff --git a/src/main/python/utils/toolbar.py b/src/main/python/utils/toolbar.py index dbfff22..69618f0 100644 --- a/src/main/python/utils/toolbar.py +++ b/src/main/python/utils/toolbar.py @@ -31,6 +31,7 @@ class toolbar(QDockWidget): self.setWindowFlags(Qt.FramelessWindowHint) self.searchBox = QLineEdit(self.widget) #search box to search through componenets + self.searchBox.setStyleSheet("QLineEdit {background-color: white;color: black}") #set color of searchBox #connect signal to filter slot, add searchbar to toolbar self.searchBox.textChanged.connect(self.searchQuery) -- cgit From 8aac54fa34d3f4916cf7da2bedefa56cb91d55be Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 28 Feb 2023 14:07:53 +0530 Subject: Remove Project Title Bar --- src/main/python/main.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/python/main.py b/src/main/python/main.py index bf94a5b..5af252d 100644 --- a/src/main/python/main.py +++ b/src/main/python/main.py @@ -104,12 +104,12 @@ class appWindow(QMainWindow): #call to create a new file inside mdi area project = FileWindow(self.mdi) project.setObjectName("New Project") + project.setWindowFlags(Qt.FramelessWindowHint) self.mdi.addSubWindow(project) if not project.tabList: # important when unpickling a file instead project.newDiagram() #create a new tab in the new file project.fileCloseEvent.connect(self.fileClosed) #closed file signal to switch to sub window view - if self.count > 0: #switch to tab view if needed - self.mdi.setViewMode(QMdiArea.TabbedView) + self.mdi.setViewMode(QMdiArea.TabbedView) project.show() def openProject(self): @@ -126,9 +126,7 @@ class appWindow(QMainWindow): project.resizeHandler() project.fileCloseEvent.connect(self.fileClosed) project.show() - if self.count > 1: - # self.tabSpace.setVisible(True) - self.mdi.setViewMode(QMdiArea.TabbedView) + self.mdi.setViewMode(QMdiArea.TabbedView) def saveProject(self): #serialize all files in mdi area @@ -169,9 +167,10 @@ class appWindow(QMainWindow): self.writeSettings() def fileClosed(self, index): + pass #checks if the file tab menu needs to be removed - if self.count <= 1 : - self.mdi.setViewMode(QMdiArea.SubWindowView) + # if self.count <= 1 : + # self.mdi.setViewMode(QMdiArea.SubWindowView) def writeSettings(self): # write window state on window close -- cgit From 664397ab13a991be7d49346344c113ae949f2f2c Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 28 Feb 2023 14:46:52 +0530 Subject: Size Grip Activation and Deactivation --- src/main/python/shapes/shapes.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index acedf46..a67e8dc 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -242,12 +242,13 @@ class SizeGripItem(QGraphicsPathItem): def show(self): # make self visible self.setPen(QPen(QColor(128, 128, 128,150), 2)) + super(SizeGripItem,self).show() def hide(self): # hide self by setting pen to transparent - if not self.parentItem().isSelected(): - self.setPen(QPen(Qt.NoPen)) - self.setBrush(Qt.transparent) + self.setPen(QPen(Qt.NoPen)) + self.setBrush(Qt.transparent) + super(SizeGripItem,self).hide() class LineGripItem(QGraphicsPathItem): @@ -397,7 +398,7 @@ class LineGripItem(QGraphicsPathItem): if self.previousHoveredItem and item != self.previousHoveredItem and \ item not in self.previousHoveredItem.lineGripItems: self.previousHoveredItem.hideLineGripItem() - self.previousHoveredItem.hideSizeGripItem() + #self.previousHoveredItem.hideSizeGripItem() super().mouseMoveEvent(mouseEvent) # show grip of current hoverde item if isinstance(item, NodeItem): @@ -649,7 +650,8 @@ class NodeItem(QGraphicsSvgItem): self.showSizeGripItem() else: self.hideLineGripItem() - self.hideSizeGripItem() + if not self.activateGrip: + self.hideSizeGripItem() return # check if transform changed if change == QGraphicsItem.ItemTransformHasChanged: @@ -694,13 +696,14 @@ class NodeItem(QGraphicsSvgItem): """defines shape highlighting on Mouse Leave """ self.hideLineGripItem() - self.hideSizeGripItem() + #self.hideSizeGripItem() super(NodeItem, self).hoverLeaveEvent(event) def mouseDoubleClickEvent(self, event): self.activateGrip = not self.activateGrip if self.activateGrip == False: self.hideSizeGripItem() + self.parent().update() else: self.showSizeGripItem() super(NodeItem,self).mouseDoubleClickEvent(event) -- cgit From 7c896bf85270c717d9c257629d0f76333f43fa0c Mon Sep 17 00:00:00 2001 From: brenda-br Date: Mon, 13 Mar 2023 18:03:20 +0530 Subject: Tool Bar Color --- .gitignore | 1 + src/main/resources/base/app.qss | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 0e61b94..aea1fd6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ src/main/python/experimental/* .vscode/*.jsons .idea/* target/* +src/main/python/PFD-Tool.exe diff --git a/src/main/resources/base/app.qss b/src/main/resources/base/app.qss index cd11034..471cfc7 100644 --- a/src/main/resources/base/app.qss +++ b/src/main/resources/base/app.qss @@ -37,6 +37,11 @@ QLineEdit { QLineEdit:focus{ border-color: #7cabf9; } + +QTabBar::tab:selected { + background: #dcdcdc; +} + TabBarPlus { qproperty-drawBase: 0; left: 5px; -- cgit