diff options
Diffstat (limited to 'src/main/python/utils')
-rw-r--r-- | src/main/python/utils/canvas.py | 4 | ||||
-rw-r--r-- | src/main/python/utils/fileWindow.py | 2 | ||||
-rw-r--r-- | src/main/python/utils/layout.py | 2 | ||||
-rw-r--r-- | src/main/python/utils/tabs.py | 2 | ||||
-rw-r--r-- | src/main/python/utils/toolbar.py | 6 |
5 files changed, 10 insertions, 6 deletions
diff --git a/src/main/python/utils/canvas.py b/src/main/python/utils/canvas.py index c860bbb..f37d1f8 100644 --- a/src/main/python/utils/canvas.py +++ b/src/main/python/utils/canvas.py @@ -69,8 +69,8 @@ class canvas(QWidget): #if view is visible use half of available width factor = 2 if self.parentFileWindow.sideViewTab is not None else 1 #use minimum width required to fit the view - width = min((prect.width() - 40)//factor, width) - height = min(prect.height() - 80, height) + width = min((prect.width() - 60)//factor, width) + height = min(prect.height() - 120, height) #set view dims self.view.setFixedWidth(width) self.view.setFixedHeight(height) diff --git a/src/main/python/utils/fileWindow.py b/src/main/python/utils/fileWindow.py index a5ed535..28a576e 100644 --- a/src/main/python/utils/fileWindow.py +++ b/src/main/python/utils/fileWindow.py @@ -53,6 +53,7 @@ class fileWindow(QMdiSubWindow): self.setWindowFlag(Qt.CustomizeWindowHint, True) self.setWindowFlag(Qt.WindowMinimizeButtonHint, False) self.setWindowFlag(Qt.WindowMaximizeButtonHint, False) + self.setWindowFlag(Qt.WindowCloseButtonHint, True) def createSideViewArea(self): #creates the side view widgets and sets them to invisible @@ -60,6 +61,7 @@ class fileWindow(QMdiSubWindow): self.sideView = customView(parent = self) self.sideView.setInteractive(False) self.sideViewCloseButton = QPushButton('×', self.sideView) + self.sideViewCloseButton.setObjectName("sideViewCloseButton") self.sideViewCloseButton.setFlat(True) self.sideViewCloseButton.setFixedSize(20, 20) self.moveSideViewCloseButton() 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/tabs.py b/src/main/python/utils/tabs.py index 1431db2..1186191 100644 --- a/src/main/python/utils/tabs.py +++ b/src/main/python/utils/tabs.py @@ -59,7 +59,7 @@ class customTabWidget(QTabWidget): #move the new tab button to correct location size = sum([self.tab.tabRect(i).width() for i in range(self.tab.count())]) # calculate width of all tabs - h = max(self.tab.geometry().bottom() - self.plusButton.height()-10, -5) #align with bottom of tabbar + h = max(self.tab.geometry().bottom() - self.plusButton.height(), 0) #align with bottom of tabbar w = self.tab.width() if size > w: #if all the tabs do not overflow the tab bar, add at the end self.plusButton.move(w-self.plusButton.width(), h) 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 |