mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
Add Frame::canvas - bright in bright mode, dark in dark mode (#1362)
and use it in the demo app
This commit is contained in:
@@ -80,16 +80,27 @@ impl Frame {
|
||||
}
|
||||
}
|
||||
|
||||
/// dark canvas to draw on
|
||||
pub fn dark_canvas(style: &Style) -> Self {
|
||||
/// A canvas to draw on.
|
||||
///
|
||||
/// In bright mode this will be very bright,
|
||||
/// and in dark mode this will be very dark.
|
||||
pub fn canvas(style: &Style) -> Self {
|
||||
Self {
|
||||
margin: Margin::symmetric(10.0, 10.0),
|
||||
rounding: style.visuals.widgets.noninteractive.rounding,
|
||||
fill: Color32::from_black_alpha(250),
|
||||
fill: style.visuals.extreme_bg_color,
|
||||
stroke: style.visuals.window_stroke(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
/// A dark canvas to draw on.
|
||||
pub fn dark_canvas(style: &Style) -> Self {
|
||||
Self {
|
||||
fill: Color32::from_black_alpha(250),
|
||||
..Self::canvas(style)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Frame {
|
||||
|
||||
Reference in New Issue
Block a user