diff options
author | pravindalve | 2020-06-11 10:12:14 +0530 |
---|---|---|
committer | GitHub | 2020-06-11 10:12:14 +0530 |
commit | ced055b07a31720d12a7efce1f7c5c0c388d03a5 (patch) | |
tree | 5fde7b957c48647edbe0b6400a9699e27c0a6f02 /src/main/python/utils/tabs.py | |
parent | 150b7bb892ed82521a5b00372e6a9f3eefce243f (diff) | |
parent | 3784ed1902d6eeb24d69d44d9158153065b850bb (diff) | |
download | Chemical-PFD-ced055b07a31720d12a7efce1f7c5c0c388d03a5.tar.gz Chemical-PFD-ced055b07a31720d12a7efce1f7c5c0c388d03a5.tar.bz2 Chemical-PFD-ced055b07a31720d12a7efce1f7c5c0c388d03a5.zip |
Merge pull request #14 from Blakeinstein/master
UI update with qss file.
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 |