Fix bug in download_window.py. Set fixed aspect ratio for forecast images.

This commit is contained in:
alessandro90
2019-04-13 15:17:11 +02:00
parent 40ce9057f4
commit 7625016b56
7 changed files with 435 additions and 288 deletions

View File

@@ -0,0 +1,14 @@
from PyQt5.QtWidgets import QLabel
from PyQt5.QtCore import QSize, 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))
if self.pixmap:
self.setPixmap(
self.pixmap.scaled(
self.size(), Qt.IgnoreAspectRatio, Qt.SmoothTransformation))