Created
March 15, 2015 17:52
-
-
Save matmr/72487a03da95b99db6ae to your computer and use it in GitHub Desktop.
pyqthraph dock label styling patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyqtgraph.dockarea.Dock import DockLabel | |
def updateStylePatched(self): | |
r = '3px' | |
if self.dim: | |
fg = '#b0b0b0' | |
bg = '#94f5bb' | |
border = '#94f5bb' | |
# border = '#7cf3ac' | |
else: | |
fg = '#fff' | |
bg = '#10b151' | |
border = '#10b151' | |
if self.orientation == 'vertical': | |
self.vStyle = """DockLabel { | |
background-color : %s; | |
color : %s; | |
border-top-right-radius: 0px; | |
border-top-left-radius: %s; | |
border-bottom-right-radius: 0px; | |
border-bottom-left-radius: %s; | |
border-width: 0px; | |
border-right: 2px solid %s; | |
padding-top: 3px; | |
padding-bottom: 3px; | |
font-size: 18px; | |
}""" % (bg, fg, r, r, border) | |
self.setStyleSheet(self.vStyle) | |
else: | |
self.hStyle = """DockLabel { | |
background-color : %s; | |
color : %s; | |
border-top-right-radius: %s; | |
border-top-left-radius: %s; | |
border-bottom-right-radius: 0px; | |
border-bottom-left-radius: 0px; | |
border-width: 0px; | |
border-bottom: 2px solid %s; | |
padding-left: 13px; | |
padding-right: 13px; | |
font-size: 18px | |
}""" % (bg, fg, r, r, border) | |
self.setStyleSheet(self.hStyle) | |
DockLabel.updateStyle = updateStylePatched |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment