use makepad_widgets::*; live_design! { import makepad_draw::shader::std::*; import makepad_widgets::base::*; import makepad_widgets::theme_desktop_dark::*; import crate::shared::styles::*; import crate::shared::clickable_view::ClickableView CatalogItem = { width: Fill height: Fit show_bg: false container = { width: Fill height: Fit flow: Down align: {x: 0.5, y: 0.0} spacing: 2.0 draw_bg: { color: #fff, radius: 8. } image = { width: Fill, height: 166 source: (CATALOG_FLIP_FLOPS_IMG) // Override to have the upper corners rounded draw_bg: { instance radius: 8. fn pixel(self) -> vec4 { let sdf = Sdf2d::viewport(self.pos * self.rect_size); sdf.box( 1, 1, self.rect_size.x - 2.0, // This calculation is to make sure the bottom part is not rounded self.rect_size.y + self.radius * 2.0, max(1.0, self.radius) ) sdf.fill_keep(self.get_color()) sdf.stroke(#fff, 1); return sdf.result } } } info = { width: Fill height: Fit flow: Down padding: 5. spacing: 3. title =