Files
cartridges/cartridges/ui/cover.blp
2026-01-10 01:38:55 +01:00

56 lines
1.2 KiB
Plaintext

using Gtk 4.0;
using Adw 1;
template $Cover: Adw.Bin {
child: Adw.Clamp {
orientation: vertical;
unit: px;
maximum-size: bind template.height;
tightening-threshold: bind template.height;
child: Adw.Clamp {
unit: px;
maximum-size: bind template.width;
tightening-threshold: bind template.width;
child: Adw.ViewStack {
name: "cover";
visible-child-name: bind $if_else(template.paintable, "cover", "icon") as <string>;
overflow: hidden;
enable-transitions: true;
Adw.ViewStackPage {
name: "cover";
child: Picture {
paintable: bind template.paintable;
width-request: bind template.width;
height-request: bind template.height;
content-fit: cover;
};
}
Adw.ViewStackPage {
name: "icon";
child: Image {
icon-name: bind $concat(
template.root as <Window>.application as <Application>.application-id,
"-symbolic"
) as <string>;
pixel-size: 80;
styles [
"dimmed",
]
};
}
styles [
"card",
]
};
};
};
}