diff --git a/lib/ui/src/ui_flexbox_layout.c b/lib/ui/src/ui_flexbox_layout.c index 8758ab48..2bbc1d5d 100644 --- a/lib/ui/src/ui_flexbox_layout.c +++ b/lib/ui/src/ui_flexbox_layout.c @@ -1395,8 +1395,10 @@ static void ui_flexbox_resolve_cross_sizes(ui_flexbox_context_t *ctx) float cross_free_space; float cross_space; float line_max_cross_size; + float lines_cross_size; /* 合并交叉轴 hint(无论交叉尺寸是否固定都合并,保持旧行为)。 */ + lines_cross_size = ctx->cross_size; ctx->cross_size = y_max(ctx->cross_size, ctx->hint_cross_size); if (column) { cross_axis = s->padding_left; @@ -1413,7 +1415,14 @@ static void ui_flexbox_resolve_cross_sizes(ui_flexbox_context_t *ctx) } cross_free_space = ctx->widget->content_box.height; } - cross_free_space -= ctx->cross_size; + /* A definite cross size already gives the lines their full space; + * don't let the container's own text sizehint shrink that area. */ + if (column ? IS_CSS_FIXED_LENGTH(s, width) + : IS_CSS_FIXED_LENGTH(s, height)) { + cross_free_space -= lines_cross_size; + } else { + cross_free_space -= ctx->cross_size; + } cross_space = ctx->lines.length > 0 ? cross_free_space / ctx->lines.length : 0; diff --git a/src/styles/style-nova.css b/src/styles/style-nova.css index 2bbf7ad4..02eb2056 100644 --- a/src/styles/style-nova.css +++ b/src/styles/style-nova.css @@ -367,6 +367,12 @@ empty-media:icon { @apply flex h-8 w-8 items-center justify-center rounded-lg bg-muted text-foreground dark:bg-muted-dark dark:text-foreground-dark; } +empty-media:icon icon { + width: 16px; + height: 16px; + font-size: 16px; +} + empty-title { @apply block text-sm font-medium; } diff --git a/src/styles/style-nova.css.h b/src/styles/style-nova.css.h index e022fc63..9384dac9 100644 --- a/src/styles/style-nova.css.h +++ b/src/styles/style-nova.css.h @@ -626,6 +626,11 @@ static const struct { { " background-color: #262626;\r\n", 30 }, { " color: #fafafa;\n", 18 }, { "}\n", 2 }, + { "empty-media:icon icon {\r\n", 25 }, + { " width: 16px;\r\n", 16 }, + { " height: 16px;\r\n", 17 }, + { " font-size: 16px;\n", 19 }, + { "}\n", 2 }, { "empty-title {\r\n", 15 }, { " display: block;\r\n", 19 }, { " font-size: 14px;\r\n", 20 }, @@ -2555,7 +2560,7 @@ static const struct { { " background-color: rgb(250 250 250 / 0.6);\n", 44 }, { "}\n", 2 }, }; -static const size_t css_str_style_nova_total_length = 51394; +static const size_t css_str_style_nova_total_length = 51473; static inline void ui_load_css_string_style_nova_chunks(void) { size_t i;