diff options
author | Blaine | 2020-04-25 09:20:40 +0530 |
---|---|---|
committer | Blaine | 2020-04-25 09:20:40 +0530 |
commit | 5860a05ba2f804815c704f0a14ea74fe11b20771 (patch) | |
tree | 53d7dc315cb4654d366934c980a9b643397ac06d /src/main | |
parent | 2d5481919e2030ad66183b0bea8f9702d5f8a2db (diff) | |
download | Chemical-PFD-5860a05ba2f804815c704f0a14ea74fe11b20771.tar.gz Chemical-PFD-5860a05ba2f804815c704f0a14ea74fe11b20771.tar.bz2 Chemical-PFD-5860a05ba2f804815c704f0a14ea74fe11b20771.zip |
streamline new tab button
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/python/utils/tabs.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/python/utils/tabs.py b/src/main/python/utils/tabs.py index 634a4ff..085c37f 100644 --- a/src/main/python/utils/tabs.py +++ b/src/main/python/utils/tabs.py @@ -21,21 +21,19 @@ class customTabWidget(QTabWidget): self.setTabBar(self.tab) self.plusButton = QPushButton('+', self) - self.plusButton.setFixedSize(20, 20) + self.plusButton.setFixedSize(35, 25) self.plusButton.clicked.connect(self.plusClicked.emit) self.setMovable(True) self.setTabsClosable(True) self.tab.layoutChanged.connect(self.movePlusButton) - # self.tab.tabMoved.connect(self.moveTab) - # self.tabCloseRequested.connect(self.removeTab) def movePlusButton(self): size = sum([self.tab.tabRect(i).width() for i in range(self.tab.count())]) - h = max(self.tab.geometry().bottom() - 20, 0) + h = max(self.tab.geometry().bottom() - 24, 0) w = self.tab.width() print(size, w, h) if size > w: self.plusButton.move(w-self.plusButton.width(), h) else: - self.plusButton.move(size, h)
\ No newline at end of file + self.plusButton.move(size-3, h)
\ No newline at end of file |