summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBlaine2020-05-05 11:42:14 +0530
committerBlaine2020-05-05 11:42:14 +0530
commit700edf250bdcc90638fd3aed21ccb67ef60f086b (patch)
tree4cdfbe337f8fcf53cd908ec0d8f948a625c586ee /src
parente7ca3971e9412d41076a6c36b7fb829447ef0b3b (diff)
downloadChemical-PFD-700edf250bdcc90638fd3aed21ccb67ef60f086b.tar.gz
Chemical-PFD-700edf250bdcc90638fd3aed21ccb67ef60f086b.tar.bz2
Chemical-PFD-700edf250bdcc90638fd3aed21ccb67ef60f086b.zip
transparent backgroun
Diffstat (limited to 'src')
-rw-r--r--src/main/python/utils/tabs.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/python/utils/tabs.py b/src/main/python/utils/tabs.py
index 1049ce5..d42a8c9 100644
--- a/src/main/python/utils/tabs.py
+++ b/src/main/python/utils/tabs.py
@@ -28,6 +28,15 @@ class customTabWidget(QTabWidget):
self.setTabBar(self.tab) #set tabBar to our custom tabBarPlus
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%);
+ }
+ QPushButton:Hover{
+ background: rgba(230, 230, 227, 40%);
+ }""")
+
#and parent it to the widget to add it at 0, 0
self.plusButton.setFixedSize(35, 25) #set dimensions
self.plusButton.clicked.connect(self.plusClicked.emit) #emit signal on click
@@ -50,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() - 25, 0) #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)