aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/weather.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/widgets/weather.lua b/widgets/weather.lua
index 9431b0c..4882a4c 100644
--- a/widgets/weather.lua
+++ b/widgets/weather.lua
@@ -116,13 +116,18 @@ function M.draw(cr, rect, colors)
-- Type sizes scale with the card, within limits that keep them legible on a
-- small cell and stop them ballooning on a tall one.
+ -- Sizes scale off the WIDTH, not the height: the widget sits in a 1x1 cell
+ -- whose height changes with the grid, and scaling off height made the type
+ -- shrink to a whisper beside the clock's numerals when the cell got shorter.
+ -- Width is the stable dimension here, and it is what constrains the text
+ -- anyway, since the stat rows run edge to edge.
local function clamp(v, lo, hi) return math.max(lo, math.min(hi, v)) end
- local temp_size = clamp(inner.h * 0.075, 34, 60)
- local glyph_size = clamp(temp_size * 0.80, 26, 46)
- local label_size = clamp(inner.h * 0.014, 10, 14)
- local desc_size = clamp(inner.h * 0.017, 12, 17)
- local row_size = clamp(inner.h * 0.016, 11, 15)
- local row_step = row_size * 1.9
+ local temp_size = clamp(inner.w * 0.135, 40, 84)
+ local glyph_size = clamp(temp_size * 0.74, 30, 60)
+ local label_size = clamp(inner.w * 0.030, 12, 19)
+ local desc_size = clamp(inner.w * 0.038, 15, 24)
+ local row_size = clamp(inner.w * 0.032, 13, 20)
+ local row_step = row_size * 2.0
-- Header: condition glyph, then the temperature with the city beneath it.
local glyph = weather.icon(w.id, now, w.sunrise, w.sunset)
@@ -186,7 +191,7 @@ function M.draw(cr, rect, colors)
-- this widget a cell sized to its content, so the drawing should end where
-- the content does.
local bottom = inner.y + inner.h
- local arc_h = clamp(inner.h * 0.30, 90, 190)
+ local arc_h = clamp(inner.h * 0.34, 110, 240)
local arc_y = math.min(sy + row_step * 0.6, bottom - arc_h)
-- Rule above the arc, riding with it rather than with the stats: it reads as