Additional fixes for KDE Plasma 6 support

This commit is contained in:
Lina Rusakova committed 2026-11-11 13:59:10 +03:00
1 parent efa05921fc
commit 723493a93e
7 files changed
+460 -22

No files matched your search

+7 -2
View File
@@ -71,6 +71,10 @@ def prob(p: Period) -> str:
return f"{num(p.prob)} %" + (" ☔" if p.prob >= 50 else "")
def wind_short(p: Period) -> str:
return f"{num(p.wind)} м/с" if p.wind is not None else ""
def temp_short(p: Period) -> str:
return f"{round(p.temp)}°" if p.temp is not None else ""
@@ -133,13 +137,14 @@ def build_view(snap: Optional[Snapshot], cfg: Config) -> View:
periods = (fc.periods if fc else [])[: max(0, cfg.forecast_rows)]
if periods:
parts.append(f'<div style="color:{DIM}; margin-top:8px;">Осадки по прогнозу</div>')
parts.append(f'<div style="color:{DIM}; margin-top:8px;">Прогноз</div>')
parts.append('<table cellspacing="0" cellpadding="1">')
for p in periods:
parts.append(
f'<tr><td style="color:{col}; padding-right:12px;">{e(p.label)}</td>'
f'<td align="right" style="color:{col}; padding-right:10px;">{e(prob(p))}</td>'
f'<td align="right" style="color:{col}; padding-right:10px;">{e(temp_short(p))}</td>'
f'<td align="right" style="color:{DIM}; padding-right:12px;">{e(wind_short(p))}</td>'
f'<td style="color:{DIM};">{e(p.cond)}</td></tr>'
)
parts.append("</table>")
@@ -162,7 +167,7 @@ def build_view(snap: Optional[Snapshot], cfg: Config) -> View:
f"Влажность: {humidity(o)}",
f"Давление: {num(o.pressure) + ' мм рт. ст.' if o.pressure is not None else '—'}",
])
tray_text = str(round(o.temperature))
tray_text = f"{round(o.temperature)} °C" # без « °C» цифры получаются ещё крупнее
cold = o.temperature <= 0
else:
tooltip = "Погода Гидрометцентра\n" + ("\n".join(errors(snap)) or "Загрузка…")