diff options
| -rw-r--r-- | dashboard.lua | 4 | ||||
| -rw-r--r-- | lib/card.lua | 7 | ||||
| -rw-r--r-- | widgets/details.lua | 3 |
3 files changed, 8 insertions, 6 deletions
diff --git a/dashboard.lua b/dashboard.lua index d29479f..925fe4a 100644 --- a/dashboard.lua +++ b/dashboard.lua @@ -32,8 +32,8 @@ local layout = { -- The forecast set, in the right side the quickshell moves left open. { widget = 'hourly', col = 10, row = 1, w = 7, h = 3 }, { widget = 'week', col = 10, row = 4, w = 3.5, h = 5.5 }, - { widget = 'details', col = 13.5, row = 4, w = 3.5, h = 4.25 }, - { widget = 'sky', col = 13.5, row = 8.25, w = 3.5, h = 4.75 }, + { widget = 'details', col = 13.5, row = 4, w = 3.5, h = 3.75 }, + { widget = 'sky', col = 13.5, row = 7.75, w = 3.5, h = 5.25 }, } -- ========================================================================== diff --git a/lib/card.lua b/lib/card.lua index 4163aae..3dd4b12 100644 --- a/lib/card.lua +++ b/lib/card.lua @@ -348,10 +348,13 @@ function M.standard(cr, inner, colors, spec) groups[#groups + 1] = { { r[1], M.FONT_MONO, ROW_F }, { r[2] == nil and '--' or tostring(r[2]), M.FONT_MONO, ROW_F } } end - -- Height in units of S: the header line, the gap under it, a step per row. + -- Height in units of S: the header line, a little air, a 0.64 step per row + -- (the first row's baseline sits 0.512 under the header, the last row's + -- descent takes about 0.1, so this leaves a few percent of slack and no + -- empty strip under the rows). local head_f = (big or not spec.title) and BIG_F or LABEL_F * 1.2 local budget = inner.h * (spec.share or 1) - local S = clamp(math.min(budget * 0.94 / (head_f + 0.5 + #rows * 0.66), + local S = clamp(math.min(budget / (head_f + 0.2 + #rows * 0.64), M.fit_unit(cr, inner.w * 0.96, groups, 100)), 10, 72) local label_size, row_size = S * LABEL_F, S * ROW_F diff --git a/widgets/details.lua b/widgets/details.lua index 36ce016..f5f23ad 100644 --- a/widgets/details.lua +++ b/widgets/details.lua @@ -79,8 +79,7 @@ function M.draw(cr, rect, colors) card.standard(cr, inner, colors, { icon = card.ICON.details, title = 'DETAILS', rows = rows, big = function(cr, right, top, size) - -- 1.2x the slot: the first row starts lower than the big text ends. - draw_compass(cr, right, top, size * 1.2, colors, c.wind_deg) + draw_compass(cr, right, top, size, colors, c.wind_deg) end, }) end |
