Add version to crate name list in the licenses default view.

This commit is contained in:
Samuel Guerra 2024-04-14 00:21:45 -03:00
parent 2090cd50b1
commit 858f1fdbd1
2 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# Unpublished
* Fix docs.rs build for `zng` and `zng-wgt-material-icons`.
* Add AVIF support in the prebuilt.
* Add AVIF support in prebuilt view.
* Implement prebuilt compression, prebuilt now depends on `tar`.
* Implement `PartialOrd, Ord` for `Txt`.
* Add crate `zng-tp-licenses` for collecting and bundling licenses.

View File

@ -244,8 +244,13 @@ fn default_view() -> impl UiNode {
}
fn default_item_view(item: UserLicense) -> impl UiNode {
let txt = if item.user.version.is_empty() {
item.user.name.clone()
} else {
formatx!("{} - {}", item.user.name, item.user.version)
};
Toggle! {
child = Text!(item.user.name.clone());
child = Text!(txt);
value = item;
child_align = layout::Align::START;
widget::corner_radius = 0;