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,19 @@
from PyQt5.QtWidgets import QWidget
class FixedAspectRatioWidget(QWidget):
space = 10
def __init__(self, parent = None):
super().__init__(parent)
self.labels = []
def resizeEvent(self, event):
h, w = self.height(), self.width()
h_lbl = h / 9 - self.space
w_lbl = 5 * h_lbl
if w_lbl > w:
w_lbl = w
h_lbl = h / 9 - self.space
for label in self.labels:
label.rescale(w_lbl, h_lbl)