Fix bug in reset of mode filters. Make forecast labels theme-dependent.
This commit is contained in:
@@ -1,14 +1,27 @@
|
||||
from PyQt5.QtWidgets import QLabel
|
||||
from PyQt5.QtCore import QSize, Qt
|
||||
from PyQt5.QtCore import Qt
|
||||
|
||||
class FixedAspectRatioLabel(QLabel):
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(parent)
|
||||
self.pixmap = None
|
||||
|
||||
def rescale(self, w, h):
|
||||
self.resize(QSize(w, h))
|
||||
def set_default_stylesheet(self):
|
||||
self.setStyleSheet("""
|
||||
color: #ffffff;
|
||||
background-color: #666666;
|
||||
""")
|
||||
|
||||
def make_transparent(self):
|
||||
self.setText('')
|
||||
self.setStyleSheet("background-color: transparent;")
|
||||
|
||||
def apply_pixmap(self):
|
||||
if self.pixmap:
|
||||
self.setPixmap(
|
||||
self.pixmap.scaled(
|
||||
self.size(), Qt.IgnoreAspectRatio, Qt.SmoothTransformation))
|
||||
|
||||
def rescale(self, size):
|
||||
self.resize(size)
|
||||
self.apply_pixmap()
|
||||
|
||||
Reference in New Issue
Block a user