Handle Custom panel size in libcosmic
The logic here is set up to mimic the current text sizes for the hardcoded panel sizes. Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
This commit is contained in:
parent
a55ed23ba8
commit
b73532f62f
1 changed files with 11 additions and 0 deletions
|
|
@ -431,6 +431,17 @@ impl Context {
|
|||
Size::PanelSize(PanelSize::M) => crate::widget::text::title4,
|
||||
Size::PanelSize(PanelSize::S) => crate::widget::text::body,
|
||||
Size::PanelSize(PanelSize::XS) => crate::widget::text::body,
|
||||
Size::PanelSize(PanelSize::Custom(s)) => {
|
||||
if s >= 80 {
|
||||
crate::widget::text::title2
|
||||
} else if s >= 64 {
|
||||
crate::widget::text::title3
|
||||
} else if s >= 48 {
|
||||
crate::widget::text::title4
|
||||
} else {
|
||||
crate::widget::text::body
|
||||
}
|
||||
}
|
||||
Size::Hardcoded(_) => crate::widget::text,
|
||||
};
|
||||
t(msg).font(crate::font::default())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue