Fix bug in reset of mode filters. Make forecast labels theme-dependent.

This commit is contained in:
alessandro90
2019-04-14 15:57:18 +02:00
parent 7625016b56
commit 91bfcde7cc
10 changed files with 771 additions and 703 deletions

View File

@@ -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()