Skip to main content

cosmic_applet_avestruz/views/components/
card.rs

1// SPDX-License-Identifier: MIT
2
3//! How something shown inside a note is set apart from the note: a quoted
4//! note, the preview of a web page. A thin rounded line around it, in the
5//! colour of the lines between rows.
6
7use cosmic::iced::Border;
8use cosmic::widget::container;
9
10/// The line around a card, and how round its corners are: as a note's
11/// images are.
12pub const CARD_BORDER: f32 = 1.0;
13pub const CARD_RADIUS: f32 = 6.0;
14
15/// The style of a container that is a card.
16pub fn card_style() -> cosmic::theme::Container<'static> {
17    cosmic::theme::Container::custom(|theme| container::Style {
18        border: Border { color: theme.cosmic().bg_divider().into(), width: CARD_BORDER, radius: CARD_RADIUS.into() },
19        ..container::Style::default()
20    })
21}