diff options
Diffstat (limited to 'src/main/python/utils')
-rw-r--r-- | src/main/python/utils/layout.py | 2 | ||||
-rw-r--r-- | src/main/python/utils/toolbar.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/python/utils/layout.py b/src/main/python/utils/layout.py index ac37358..b977a68 100644 --- a/src/main/python/utils/layout.py +++ b/src/main/python/utils/layout.py @@ -72,7 +72,7 @@ class flowLayout(QLayout): spaceX = self.spacing() + wid.style().layoutSpacing(QSizePolicy.ToolButton, QSizePolicy.ToolButton, Qt.Horizontal) spaceY = self.spacing() + wid.style().layoutSpacing(QSizePolicy.ToolButton, QSizePolicy.ToolButton, Qt.Vertical) nextX = x + item.sizeHint().width() + spaceX - if nextX - spaceX > rect.right() and lineHeight > 0: + if nextX + spaceX > rect.right() and lineHeight > 0: x = rect.x() y = y + lineHeight + spaceY nextX = x + item.sizeHint().width() + spaceX diff --git a/src/main/python/utils/toolbar.py b/src/main/python/utils/toolbar.py index 220504b..a175aff 100644 --- a/src/main/python/utils/toolbar.py +++ b/src/main/python/utils/toolbar.py @@ -28,8 +28,9 @@ class toolbar(QDockWidget): self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea | Qt.NoDockWidgetArea) #declare main widget and layout self.widget = QWidget(self) + self.widget.setObjectName("ToolbarWidget") self.layout = QBoxLayout(QBoxLayout.TopToBottom, self.widget) - self.setAllowedAreas(Qt.AllDockWidgetAreas) + self.setWindowFlags(Qt.FramelessWindowHint) self.searchBox = QLineEdit(self.widget) #search box to search through componenets @@ -44,10 +45,11 @@ class toolbar(QDockWidget): self.diagArea.setWidgetResizable(True) self.layout.addWidget(self.diagArea, stretch=1) self.diagAreaWidget = QWidget(self.diagArea) #inner widget for scroll area + self.diagAreaWidget.setObjectName("ToolbarScrollWidget") #custom layout for inner widget self.diagAreaLayout = flowLayout(self.diagAreaWidget) self.diagAreaLayout.setSizeConstraint(flowLayout.SetMinimumSize) - self.setWidget(self.widget) #set main widget to dockwidget + self.setWidget(self.widget) #set main widget to dockwidget def clearLayout(self): # used to clear all items from toolbar, by parenting it to the toolbar instead |