From 36f941131c6c9045abb1b3dbc7ad5751a6e7f1cb Mon Sep 17 00:00:00 2001 From: alessandro90 Date: Sun, 5 May 2019 11:45:53 +0200 Subject: [PATCH] Fix details in fixed aspect ratio labels. --- artemis.py | 18 +- artemis.ui | 512 +++++++++++++++++++---------------- constants.py | 18 -- fixed_aspect_ratio_label.py | 12 +- fixed_aspect_ratio_widget.py | 8 +- threads.py | 1 - 6 files changed, 306 insertions(+), 263 deletions(-) diff --git a/artemis.py b/artemis.py index 012d820..3ffe1c1 100644 --- a/artemis.py +++ b/artemis.py @@ -32,8 +32,7 @@ from constants import (Constants, Database, ChecksumWhat, Messages, - Signal, - Months) + Signal,) from themesmanager import ThemeManager from utilities import (checksum_ok, uncheck_and_emit, @@ -157,6 +156,17 @@ class Artemis(QMainWindow, Ui_MainWindow): lab.set_default_stylesheet() self.space_weather_label_container.labels = self.space_weather_labels + self.space_weather_label_name_container.labels = [ + self.eme_lbl, + self.ms_lbl, + self.muf_lbl, + self.hi_lbl, + self.eu50_lbl, + self.eu70_lbl, + self.eu144_lbl, + self.na_lbl, + self.aurora_lbl + ] self.theme_manager = ThemeManager(self) # Manage frequency filters. @@ -455,7 +465,7 @@ class Artemis(QMainWindow, Ui_MainWindow): ) self.apply_remove_acf_filter_btn.clicked.connect(self.display_signals) self.reset_acf_filters_btn.clicked.connect(self.reset_acf_filters) - self.acf_info_btn.clicked.connect(lambda : webbrowser.open(Constants.ACF_DOCS)) + self.acf_info_btn.clicked.connect(lambda: webbrowser.open(Constants.ACF_DOCS)) connect_events_to_func( events_to_connect=[self.acf_spinbox.valueChanged, @@ -561,7 +571,7 @@ class Artemis(QMainWindow, Ui_MainWindow): self.update_now_bar.set_idle() if status_ok: xray_long = float(self.space_weather_data.xray[-1][7]) - format_text = lambda letter, power : letter + f"{xray_long * 10**power:.1f}" + format_text = lambda letter, power: letter + f"{xray_long * 10**power:.1f}" if xray_long < 1e-8 and xray_long != -1.00e+05: self.peak_flux_lbl.setText(format_text("= 1e-8 and xray_long < 1e-7: diff --git a/artemis.ui b/artemis.ui index 5524ce9..cd446a5 100644 --- a/artemis.ui +++ b/artemis.ui @@ -6,8 +6,8 @@ 0 0 - 1387 - 761 + 1458 + 795 @@ -17,7 +17,7 @@ - ARTEMIS3 + ARTΣMIS 3.0 @@ -6150,239 +6150,281 @@ background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,sto 0 - - - 9 - - - 0 - - - + + + 0 0 - - - 13 - false - + + Qt::LeftToRight - - E.M.E.→ - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 15 + + + + + + + + 0 + 0 + + + + + 13 + false + + + + Qt::LeftToRight + + + E.M.E.→ + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 15 + + + + + + + + 0 + 0 + + + + + 13 + false + + + + Qt::LeftToRight + + + Meteor Scatter→ + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 15 + + + + + + + + 0 + 0 + + + + + 13 + false + + + + Qt::LeftToRight + + + M.U.F.→ + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 15 + + + + + + + + 0 + 0 + + + + + 13 + false + + + + Qt::LeftToRight + + + Hystorical Index→ + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 15 + + + + + + + + 0 + 0 + + + + + 13 + false + + + + Qt::LeftToRight + + + QFrame::NoFrame + + + 50 MHz E-skip in EU→ + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 15 + + + + + + + + 0 + 0 + + + + + 13 + false + + + + Qt::LeftToRight + + + 70 MHz E-skip in EU→ + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 15 + + + + + + + + 0 + 0 + + + + + 13 + false + + + + Qt::LeftToRight + + + 144 MHz E-skip in EU→ + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 15 + + + + + + + + 0 + 0 + + + + + 13 + false + + + + Qt::LeftToRight + + + 144 MHz E-skip in NA→ + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 15 + + + + + + + + 0 + 0 + + + + + 13 + false + + + + Qt::LeftToRight + + + VHF Aurora→ + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 15 + + + + - - - - - 0 - 0 - - - - - 13 - false - - - - 50 MHz E-skip in EU→ - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 15 - - - - - - - - 0 - 0 - - - - - 13 - false - - - - VHF Aurora→ - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 15 - - - - - - - - 0 - 0 - - - - - 13 - false - - - - Hystorical Index→ - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 15 - - - - - - - - 0 - 0 - - - - - 13 - false - - - - 144 MHz E-skip in EU→ - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 15 - - - - - - - - 0 - 0 - - - - - 13 - false - - - - M.U.F.→ - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 15 - - - - - - - - 0 - 0 - - - - - 13 - false - - - - Meteor Scatter→ - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 15 - - - - - - - - 0 - 0 - - - - - 13 - false - - - - 144 MHz E-skip in NA→ - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 15 - - - - - - - - 0 - 0 - - - - - 13 - false - - - - 70 MHz E-skip in EU→ - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 15 - - - - + @@ -6834,7 +6876,7 @@ background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,sto 1 - -1 + 0 Qt::AlignCenter @@ -6842,6 +6884,9 @@ background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,sto true + + false + %p% @@ -7708,14 +7753,23 @@ background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,sto 0 + + + 75 + true + + 1 0 + + Qt::AlignCenter + - false + true @@ -8175,7 +8229,7 @@ QSlider::handle:horizontal { 0 0 - 1387 + 1458 21 diff --git a/constants.py b/constants.py index 0870dd3..a4aab83 100644 --- a/constants.py +++ b/constants.py @@ -82,24 +82,6 @@ class ForecastColors: KP5_COLOR = "#BEE3FE" -class Months: - MONTS = [ - "0", - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" - ] - - class Constants: CLICK_TO_UPDATE_STR = "Click to update" SIGIDWIKI = "https://www.sigidwiki.com/wiki/Signal_Identification_Guide" diff --git a/fixed_aspect_ratio_label.py b/fixed_aspect_ratio_label.py index 8f13adc..a8a5d18 100644 --- a/fixed_aspect_ratio_label.py +++ b/fixed_aspect_ratio_label.py @@ -8,16 +8,14 @@ class FixedAspectRatioLabel(QLabel): self.pixmap = None def set_default_stylesheet(self): - self.setStyleSheet("border: 3px;") - # self.setStyleSheet(""" - # color: #ffffff; - # background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #304352 ,stop: 1 #d7d2cc); - # """) + self.setStyleSheet("""border-width: 1px; + border-style: solid; + border-color: black;""" + ) def make_transparent(self): self.setText('') - self.setStyleSheet("border: 0px;") - # self.setStyleSheet("background-color: transparent;") + self.setStyleSheet("border-width: 0px;") def apply_pixmap(self): if self.pixmap: diff --git a/fixed_aspect_ratio_widget.py b/fixed_aspect_ratio_widget.py index bcf381e..297166f 100644 --- a/fixed_aspect_ratio_widget.py +++ b/fixed_aspect_ratio_widget.py @@ -12,10 +12,10 @@ class FixedAspectRatioWidget(QWidget): 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 + w_pad = w - 10 + if w_lbl > w_pad: + w_lbl = w_pad + h_lbl = w_pad / 5 for label in self.labels: label.rescale(QSize(w_lbl, h_lbl)) diff --git a/threads.py b/threads.py index 13d49a0..17c1027 100644 --- a/threads.py +++ b/threads.py @@ -27,7 +27,6 @@ class _BaseDownloadThread(QThread): def __del__(self): self.terminate() self.wait() - super().__del__() class DownloadThread(_BaseDownloadThread):