diff options
Diffstat (limited to 'src/main/python/utils/tabs.py')
-rw-r--r-- | src/main/python/utils/tabs.py | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/main/python/utils/tabs.py b/src/main/python/utils/tabs.py index 5196557..1431db2 100644 --- a/src/main/python/utils/tabs.py +++ b/src/main/python/utils/tabs.py @@ -41,19 +41,9 @@ class customTabWidget(QTabWidget): self.plusButton = QPushButton('+', self) #create the new tab button #style the new tab button self.plusButton.setFlat(True) - self.plusButton.setStyleSheet(""" - QPushButton{ - background: rgba(230, 230, 227, 0%); - padding: 1px; - border: 0px solid #E6E6E3; - - } - QPushButton:hover{ - background: rgba(230, 230, 227, 60%); - }""") #and parent it to the widget to add it at 0, 0 - self.plusButton.setFixedSize(35, 25) #set dimensions + self.plusButton.setFixedSize(25, 25) #set dimensions self.plusButton.clicked.connect(self.plusClicked.emit) #emit signal on click #set flags self.setMovable(True) @@ -64,23 +54,17 @@ class customTabWidget(QTabWidget): self.tab.nameChanged.connect(self.changeWidgetName) #set custom stylesheet for the widget area - self.setStyleSheet("""QTabWidget::pane { - margin: 0px,1px,1px,1px; - border: 2px solid #E6E6E3; - border-radius: 7px; - padding: 1px; - background-color: #E6E6E3;}""") def movePlusButton(self): #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(), 0) #align with bottom of tabbar + h = max(self.tab.geometry().bottom() - self.plusButton.height()-10, -5) #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) else: - self.plusButton.move(size-3, h) + self.plusButton.move(size+5, h) def changeWidgetName(self, index, newName): self.widget(index).setObjectName(newName)
\ No newline at end of file |