2013-12-15 20:29:39 +01:00
|
|
|
from PyQt5.QtWidgets import QTabWidget
|
2014-01-19 16:56:33 +01:00
|
|
|
from PyQt5.QtCore import Qt
|
2013-12-15 20:29:39 +01:00
|
|
|
|
|
|
|
class TabWidget(QTabWidget):
|
2014-01-20 15:58:49 +01:00
|
|
|
"""The tabwidget used for TabbedBrowser"""
|
2013-12-15 20:29:39 +01:00
|
|
|
|
2014-01-21 10:47:22 +01:00
|
|
|
_stylesheet = """
|
|
|
|
QTabWidget::pane {
|
|
|
|
position: absolute;
|
|
|
|
top: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
QTabBar {
|
|
|
|
font-family: Monospace, Courier;
|
|
|
|
font-size: 8pt;
|
|
|
|
}
|
2013-12-15 20:29:39 +01:00
|
|
|
|
2014-01-21 10:47:22 +01:00
|
|
|
QTabBar::tab {
|
|
|
|
background-color: grey;
|
|
|
|
color: white;
|
|
|
|
padding-left: 5px;
|
|
|
|
padding-right: 5px;
|
|
|
|
padding-top: 0px;
|
|
|
|
padding-bottom: 0px;
|
|
|
|
}
|
2013-12-15 20:29:39 +01:00
|
|
|
|
2014-01-21 10:47:22 +01:00
|
|
|
QTabBar::tab:selected {
|
|
|
|
background-color: black;
|
|
|
|
}
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self, parent):
|
|
|
|
super().__init__(parent)
|
|
|
|
self.setStyleSheet(self._stylesheet.strip())
|
2013-12-15 20:29:39 +01:00
|
|
|
self.setDocumentMode(True)
|
2014-01-19 16:56:33 +01:00
|
|
|
self.setElideMode(Qt.ElideRight)
|