[refactor] rename fill_color to just fill

This commit is contained in:
Emil Ernerfeldt 2020-05-23 14:17:40 +02:00
parent c7a59b57d2
commit d214574c97
16 changed files with 70 additions and 70 deletions

View file

@ -86,7 +86,7 @@ impl State {
ui.add_paint_cmd(PaintCmd::Path { ui.add_paint_cmd(PaintCmd::Path {
path: Path::from_point_loop(&points), path: Path::from_point_loop(&points),
closed: true, closed: true,
fill_color: None, fill: None,
outline: Some(LineStyle::new(stroke_width, stroke_color)), outline: Some(LineStyle::new(stroke_width, stroke_color)),
}); });
} }
@ -230,7 +230,7 @@ impl CollapsingHeader {
where_to_put_background, where_to_put_background,
PaintCmd::Rect { PaintCmd::Rect {
corner_radius: ui.style().interact(&interact).corner_radius, corner_radius: ui.style().interact(&interact).corner_radius,
fill_color: ui.style().interact(&interact).bg_fill_color, fill: ui.style().interact(&interact).bg_fill,
outline: None, outline: None,
rect: interact.rect, rect: interact.rect,
}, },

View file

@ -7,7 +7,7 @@ pub struct Frame {
// On each side // On each side
pub margin: Vec2, pub margin: Vec2,
pub corner_radius: f32, pub corner_radius: f32,
pub fill_color: Option<Color>, pub fill: Option<Color>,
pub outline: Option<LineStyle>, pub outline: Option<LineStyle>,
} }
@ -16,7 +16,7 @@ impl Frame {
Self { Self {
margin: style.window_padding, margin: style.window_padding,
corner_radius: style.window.corner_radius, corner_radius: style.window.corner_radius,
fill_color: Some(style.background_fill_color), fill: Some(style.background_fill),
outline: style.interact.inactive.rect_outline, // becauce we can resize windows outline: style.interact.inactive.rect_outline, // becauce we can resize windows
} }
} }
@ -25,7 +25,7 @@ impl Frame {
Self { Self {
margin: Vec2::splat(1.0), margin: Vec2::splat(1.0),
corner_radius: 0.0, corner_radius: 0.0,
fill_color: None, fill: None,
outline: Some(LineStyle::new(0.5, color::white(128))), outline: Some(LineStyle::new(0.5, color::white(128))),
} }
} }
@ -34,7 +34,7 @@ impl Frame {
Self { Self {
margin: Vec2::splat(1.0), margin: Vec2::splat(1.0),
corner_radius: 2.0, corner_radius: 2.0,
fill_color: Some(style.background_fill_color), fill: Some(style.background_fill),
outline: Some(LineStyle::new(1.0, color::white(128))), outline: Some(LineStyle::new(1.0, color::white(128))),
} }
} }
@ -43,13 +43,13 @@ impl Frame {
Self { Self {
margin: style.window_padding, margin: style.window_padding,
corner_radius: 5.0, corner_radius: 5.0,
fill_color: Some(style.background_fill_color), fill: Some(style.background_fill),
outline: Some(LineStyle::new(1.0, color::white(128))), outline: Some(LineStyle::new(1.0, color::white(128))),
} }
} }
pub fn fill_color(mut self, fill_color: Option<Color>) -> Self { pub fn fill(mut self, fill: Option<Color>) -> Self {
self.fill_color = fill_color; self.fill = fill;
self self
} }
@ -109,7 +109,7 @@ impl Prepared {
where_to_put_background, where_to_put_background,
PaintCmd::Rect { PaintCmd::Rect {
corner_radius: frame.corner_radius, corner_radius: frame.corner_radius,
fill_color: frame.fill_color, fill: frame.fill,
outline: frame.outline, outline: frame.outline,
rect: outer_rect, rect: outer_rect,
}, },

View file

@ -25,11 +25,11 @@ pub fn bar<R>(ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R) -> (R, Rect)
Frame::menu_bar(ui.style()).show(ui, |ui| { Frame::menu_bar(ui.style()).show(ui, |ui| {
let mut style = ui.style().clone(); let mut style = ui.style().clone();
style.button_padding = vec2(2.0, 0.0); style.button_padding = vec2(2.0, 0.0);
// style.interact.active.bg_fill_color = None; // style.interact.active.bg_fill = None;
style.interact.active.rect_outline = None; style.interact.active.rect_outline = None;
// style.interact.hovered.bg_fill_color = None; // style.interact.hovered.bg_fill = None;
style.interact.hovered.rect_outline = None; style.interact.hovered.rect_outline = None;
style.interact.inactive.bg_fill_color = None; style.interact.inactive.bg_fill = None;
style.interact.inactive.rect_outline = None; style.interact.inactive.rect_outline = None;
ui.set_style(style); ui.set_style(style);
@ -66,7 +66,7 @@ fn menu_impl<'c>(
let mut button = Button::new(title); let mut button = Button::new(title);
if bar_state.open_menu == Some(menu_id) { if bar_state.open_menu == Some(menu_id) {
button = button.fill_color(Some(ui.style().interact.active.fill_color)); button = button.fill(Some(ui.style().interact.active.fill));
} }
let button_interact = ui.add(button); let button_interact = ui.add(button);
@ -86,11 +86,11 @@ fn menu_impl<'c>(
resize.show(ui, |ui| { resize.show(ui, |ui| {
let mut style = ui.style().clone(); let mut style = ui.style().clone();
style.button_padding = vec2(2.0, 0.0); style.button_padding = vec2(2.0, 0.0);
// style.interact.active.bg_fill_color = None; // style.interact.active.bg_fill = None;
style.interact.active.rect_outline = None; style.interact.active.rect_outline = None;
// style.interact.hovered.bg_fill_color = None; // style.interact.hovered.bg_fill = None;
style.interact.hovered.rect_outline = None; style.interact.hovered.rect_outline = None;
style.interact.inactive.bg_fill_color = None; style.interact.inactive.bg_fill = None;
style.interact.inactive.rect_outline = None; style.interact.inactive.rect_outline = None;
ui.set_style(style); ui.set_style(style);
ui.set_layout(Layout::justified(Direction::Vertical)); ui.set_layout(Layout::justified(Direction::Vertical));

View file

@ -314,7 +314,7 @@ impl Resize {
ui.add_paint_cmd(paint::PaintCmd::Rect { ui.add_paint_cmd(paint::PaintCmd::Rect {
rect, rect,
corner_radius: 3.0, corner_radius: 3.0,
fill_color: None, fill: None,
outline: Some(ui.style().thin_outline), outline: Some(ui.style().thin_outline),
}); });
} }

View file

@ -214,20 +214,20 @@ impl Prepared {
); );
let style = ui.style(); let style = ui.style();
let handle_fill_color = style.interact(&interact).fill_color; let handle_fill = style.interact(&interact).fill;
let handle_outline = style.interact(&interact).rect_outline; let handle_outline = style.interact(&interact).rect_outline;
ui.add_paint_cmd(paint::PaintCmd::Rect { ui.add_paint_cmd(paint::PaintCmd::Rect {
rect: outer_scroll_rect, rect: outer_scroll_rect,
corner_radius, corner_radius,
fill_color: Some(ui.style().dark_bg_color), fill: Some(ui.style().dark_bg_color),
outline: None, outline: None,
}); });
ui.add_paint_cmd(paint::PaintCmd::Rect { ui.add_paint_cmd(paint::PaintCmd::Rect {
rect: handle_rect.expand(-2.0), rect: handle_rect.expand(-2.0),
corner_radius, corner_radius,
fill_color: Some(handle_fill_color), fill: Some(handle_fill),
outline: handle_outline, outline: handle_outline,
}); });
} }

View file

@ -63,7 +63,7 @@ impl<'open> Window<'open> {
self self
} }
/// Usage: `Winmdow::new(...).frame(|f| f.fill_color(Some(BLUE)))` /// Usage: `Winmdow::new(...).frame(|f| f.fill(Some(BLUE)))`
/// Not sure this is a good interface for this. /// Not sure this is a good interface for this.
pub fn frame(mut self, frame: Frame) -> Self { pub fn frame(mut self, frame: Frame) -> Self {
self.frame = Some(frame); self.frame = Some(frame);
@ -505,7 +505,7 @@ fn paint_frame_interaction(
ui.add_paint_cmd(PaintCmd::Path { ui.add_paint_cmd(PaintCmd::Path {
path, path,
closed: false, closed: false,
fill_color: None, fill: None,
outline: style.rect_outline, outline: style.rect_outline,
}); });
} }

View file

@ -362,7 +362,7 @@ impl Context {
layer, layer,
PaintCmd::Rect { PaintCmd::Rect {
corner_radius: 0.0, corner_radius: 0.0,
fill_color: Some(color::gray(0, 240)), fill: Some(color::gray(0, 240)),
outline: Some(LineStyle::new(1.0, color::RED)), outline: Some(LineStyle::new(1.0, color::RED)),
rect: rect.expand(2.0), rect: rect.expand(2.0),
}, },
@ -391,7 +391,7 @@ impl Context {
layer, layer,
PaintCmd::Rect { PaintCmd::Rect {
corner_radius: 0.0, corner_radius: 0.0,
fill_color: None, fill: None,
outline: Some(LineStyle::new(1.0, color::RED)), outline: Some(LineStyle::new(1.0, color::RED)),
rect, rect,
}, },

View file

@ -401,7 +401,7 @@ impl BoxPainting {
for i in 0..self.num_boxes { for i in 0..self.num_boxes {
cmds.push(PaintCmd::Rect { cmds.push(PaintCmd::Rect {
corner_radius: self.corner_radius, corner_radius: self.corner_radius,
fill_color: Some(gray(136, 255)), fill: Some(gray(136, 255)),
rect: Rect::from_min_size( rect: Rect::from_min_size(
pos2(10.0 + pos.x + (i as f32) * (self.size.x * 1.1), pos.y), pos2(10.0 + pos.x + (i as f32) * (self.size.x * 1.1), pos.y),
self.size, self.size,
@ -463,7 +463,7 @@ impl Painting {
path: Path::from_open_points(&points), path: Path::from_open_points(&points),
closed: false, closed: false,
outline: Some(LineStyle::new(2.0, LIGHT_GRAY)), outline: Some(LineStyle::new(2.0, LIGHT_GRAY)),
fill_color: None, fill: None,
}); });
} }
} }

View file

@ -39,7 +39,7 @@ impl FractalClock {
.default_rect(ctx.rect().expand(-40.0)) .default_rect(ctx.rect().expand(-40.0))
.scroll(false) .scroll(false)
// Dark background frame to make it pop: // Dark background frame to make it pop:
.frame(Frame::window(&ctx.style()).fill_color(Some(color::black(250)))) .frame(Frame::window(&ctx.style()).fill(Some(color::black(250))))
.show(ctx, |ui| self.ui(ui)); .show(ctx, |ui| self.ui(ui));
} }
@ -54,7 +54,7 @@ impl FractalClock {
self.fractal_ui(ui); self.fractal_ui(ui);
let frame = Frame::popup(ui.style()) let frame = Frame::popup(ui.style())
.fill_color(Some(color::gray(34, 160))) .fill(Some(color::gray(34, 160)))
.outline(None); .outline(None);
frame.show(&mut ui.left_column(320.0), |ui| { frame.show(&mut ui.left_column(320.0), |ui| {

View file

@ -10,7 +10,7 @@ use serde_derive::{Deserialize, Serialize};
pub enum PaintCmd { pub enum PaintCmd {
Circle { Circle {
center: Pos2, center: Pos2,
fill_color: Option<Color>, fill: Option<Color>,
outline: Option<LineStyle>, outline: Option<LineStyle>,
radius: f32, radius: f32,
}, },
@ -22,13 +22,13 @@ pub enum PaintCmd {
Path { Path {
path: Path, path: Path,
closed: bool, closed: bool,
fill_color: Option<Color>, fill: Option<Color>,
outline: Option<LineStyle>, outline: Option<LineStyle>,
}, },
Rect { Rect {
rect: Rect, rect: Rect,
corner_radius: f32, corner_radius: f32,
fill_color: Option<Color>, fill: Option<Color>,
outline: Option<LineStyle>, outline: Option<LineStyle>,
}, },
Text { Text {

View file

@ -554,13 +554,13 @@ pub fn paint_command_into_triangles(
match command { match command {
PaintCmd::Circle { PaintCmd::Circle {
center, center,
fill_color, fill,
outline, outline,
radius, radius,
} => { } => {
path.add_circle(center, radius); path.add_circle(center, radius);
if let Some(color) = fill_color { if let Some(fill) = fill {
fill_closed_path(out, options, &path.0, color); fill_closed_path(out, options, &path.0, fill);
} }
if let Some(outline) = outline { if let Some(outline) = outline {
paint_path_outline(out, options, Closed, &path.0, outline.color, outline.width); paint_path_outline(out, options, Closed, &path.0, outline.color, outline.width);
@ -580,16 +580,16 @@ pub fn paint_command_into_triangles(
PaintCmd::Path { PaintCmd::Path {
path, path,
closed, closed,
fill_color, fill,
outline, outline,
} => { } => {
if path.len() >= 2 { if path.len() >= 2 {
if let Some(fill_color) = fill_color { if let Some(fill) = fill {
debug_assert!( debug_assert!(
closed, closed,
"You asked to fill a path that is not closed. That makes no sense." "You asked to fill a path that is not closed. That makes no sense."
); );
fill_closed_path(out, options, &path.0, fill_color); fill_closed_path(out, options, &path.0, fill);
} }
if let Some(outline) = outline { if let Some(outline) = outline {
let typ = if closed { Closed } else { Open }; let typ = if closed { Closed } else { Open };
@ -599,7 +599,7 @@ pub fn paint_command_into_triangles(
} }
PaintCmd::Rect { PaintCmd::Rect {
corner_radius, corner_radius,
fill_color, fill,
outline, outline,
mut rect, mut rect,
} => { } => {
@ -609,8 +609,8 @@ pub fn paint_command_into_triangles(
rect.max = rect.max.min(pos2(1e7, 1e7)); rect.max = rect.max.min(pos2(1e7, 1e7));
path.add_rounded_rectangle(rect, corner_radius); path.add_rounded_rectangle(rect, corner_radius);
if let Some(fill_color) = fill_color { if let Some(fill) = fill {
fill_closed_path(out, options, &path.0, fill_color); fill_closed_path(out, options, &path.0, fill);
} }
if let Some(outline) = outline { if let Some(outline) = outline {
paint_path_outline(out, options, Closed, &path.0, outline.color, outline.width); paint_path_outline(out, options, Closed, &path.0, outline.color, outline.width);
@ -686,7 +686,7 @@ pub fn paint_commands_into_triangles(
PaintCmd::Rect { PaintCmd::Rect {
rect: *clip_rect, rect: *clip_rect,
corner_radius: 0.0, corner_radius: 0.0,
fill_color: None, fill: None,
outline: Some(LineStyle::new(2.0, srgba(150, 255, 150, 255))), outline: Some(LineStyle::new(2.0, srgba(150, 255, 150, 255))),
}, },
triangles, triangles,

View file

@ -39,7 +39,7 @@ pub struct Style {
pub thin_outline: LineStyle, pub thin_outline: LineStyle,
/// e.g. the background of windows /// e.g. the background of windows
pub background_fill_color: Color, pub background_fill: Color,
/// e.g. the background of the slider or text edit /// e.g. the background of the slider or text edit
pub dark_bg_color: Color, pub dark_bg_color: Color,
@ -76,7 +76,7 @@ impl Default for Style {
text_color: gray(160, 255), text_color: gray(160, 255),
line_width: 1.0, line_width: 1.0,
thin_outline: LineStyle::new(0.5, GRAY), thin_outline: LineStyle::new(0.5, GRAY),
background_fill_color: gray(32, 250), background_fill: gray(32, 250),
dark_bg_color: gray(0, 140), dark_bg_color: gray(0, 140),
cursor_blink_hz: 1.0, cursor_blink_hz: 1.0,
text_cursor_width: 2.0, text_cursor_width: 2.0,
@ -100,24 +100,24 @@ impl Default for Interact {
fn default() -> Self { fn default() -> Self {
Self { Self {
active: WidgetStyle { active: WidgetStyle {
bg_fill_color: Some(gray(0, 128)), bg_fill: Some(gray(0, 128)),
fill_color: srgba(120, 120, 200, 255), fill: srgba(120, 120, 200, 255),
stroke_color: WHITE, stroke_color: WHITE,
stroke_width: 2.0, stroke_width: 2.0,
rect_outline: Some(LineStyle::new(2.0, WHITE)), rect_outline: Some(LineStyle::new(2.0, WHITE)),
corner_radius: 5.0, corner_radius: 5.0,
}, },
hovered: WidgetStyle { hovered: WidgetStyle {
bg_fill_color: None, bg_fill: None,
fill_color: srgba(100, 100, 150, 255), fill: srgba(100, 100, 150, 255),
stroke_color: gray(240, 255), stroke_color: gray(240, 255),
stroke_width: 1.5, stroke_width: 1.5,
rect_outline: Some(LineStyle::new(1.0, WHITE)), rect_outline: Some(LineStyle::new(1.0, WHITE)),
corner_radius: 5.0, corner_radius: 5.0,
}, },
inactive: WidgetStyle { inactive: WidgetStyle {
bg_fill_color: None, bg_fill: None,
fill_color: srgba(60, 60, 80, 255), fill: srgba(60, 60, 80, 255),
stroke_color: gray(210, 255), // Mustn't look grayed out! stroke_color: gray(210, 255), // Mustn't look grayed out!
stroke_width: 1.0, stroke_width: 1.0,
rect_outline: Some(LineStyle::new(1.0, white(128))), rect_outline: Some(LineStyle::new(1.0, white(128))),
@ -142,11 +142,11 @@ impl Interact {
#[derive(Clone, Copy, Debug, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub struct WidgetStyle { pub struct WidgetStyle {
/// Background color of widget /// Background color of widget
pub bg_fill_color: Option<Color>, pub bg_fill: Option<Color>,
/// Fill color of the interactive part of a component (slider grab, checkbox, ...) /// Fill color of the interactive part of a component (slider grab, checkbox, ...)
/// When you need a fill_color. /// When you need a fill.
pub fill_color: Color, pub fill: Color,
/// Stroke and text color of the interactive part of a component (button, slider grab, checkbox, ...) /// Stroke and text color of the interactive part of a component (button, slider grab, checkbox, ...)
pub stroke_color: Color, pub stroke_color: Color,

View file

@ -359,7 +359,7 @@ impl Ui {
rect, rect,
corner_radius: 0.0, corner_radius: 0.0,
outline: Some(LineStyle::new(1.0, LIGHT_BLUE)), outline: Some(LineStyle::new(1.0, LIGHT_BLUE)),
fill_color: None, fill: None,
}); });
let color = color::srgba(200, 0, 0, 255); let color = color::srgba(200, 0, 0, 255);
@ -441,7 +441,7 @@ impl Ui {
pub fn debug_rect(&mut self, rect: Rect, text: impl Into<String>) { pub fn debug_rect(&mut self, rect: Rect, text: impl Into<String>) {
self.add_paint_cmd(PaintCmd::Rect { self.add_paint_cmd(PaintCmd::Rect {
corner_radius: 0.0, corner_radius: 0.0,
fill_color: None, fill: None,
outline: Some(LineStyle::new(1.0, color::RED)), outline: Some(LineStyle::new(1.0, color::RED)),
rect, rect,
}); });

View file

@ -196,7 +196,7 @@ pub struct Button {
text_color: Option<Color>, text_color: Option<Color>,
text_style: TextStyle, text_style: TextStyle,
/// None means default for interact /// None means default for interact
fill_color: Option<Color>, fill: Option<Color>,
} }
impl Button { impl Button {
@ -205,7 +205,7 @@ impl Button {
text: text.into(), text: text.into(),
text_color: None, text_color: None,
text_style: TextStyle::Button, text_style: TextStyle::Button,
fill_color: None, fill: None,
} }
} }
@ -219,8 +219,8 @@ impl Button {
self self
} }
pub fn fill_color(mut self, fill_color: Option<Color>) -> Self { pub fn fill(mut self, fill: Option<Color>) -> Self {
self.fill_color = fill_color; self.fill = fill;
self self
} }
} }
@ -231,7 +231,7 @@ impl Widget for Button {
text, text,
text_color, text_color,
text_style, text_style,
fill_color, fill,
} = self; } = self;
let id = ui.make_position_id(); let id = ui.make_position_id();
@ -243,10 +243,10 @@ impl Widget for Button {
let rect = ui.allocate_space(size); let rect = ui.allocate_space(size);
let interact = ui.interact(rect, id, Sense::click()); let interact = ui.interact(rect, id, Sense::click());
let text_cursor = interact.rect.left_center() + vec2(padding.x, -0.5 * galley.size.y); let text_cursor = interact.rect.left_center() + vec2(padding.x, -0.5 * galley.size.y);
let bg_fill_color = fill_color.or(ui.style().interact(&interact).bg_fill_color); let bg_fill = fill.or(ui.style().interact(&interact).bg_fill);
ui.add_paint_cmd(PaintCmd::Rect { ui.add_paint_cmd(PaintCmd::Rect {
corner_radius: ui.style().interact(&interact).corner_radius, corner_radius: ui.style().interact(&interact).corner_radius,
fill_color: bg_fill_color, fill: bg_fill,
outline: ui.style().interact(&interact).rect_outline, outline: ui.style().interact(&interact).rect_outline,
rect: interact.rect, rect: interact.rect,
}); });
@ -307,7 +307,7 @@ impl<'a> Widget for Checkbox<'a> {
let (small_icon_rect, big_icon_rect) = ui.style().icon_rectangles(interact.rect); let (small_icon_rect, big_icon_rect) = ui.style().icon_rectangles(interact.rect);
ui.add_paint_cmd(PaintCmd::Rect { ui.add_paint_cmd(PaintCmd::Rect {
corner_radius: ui.style().interact(&interact).corner_radius, corner_radius: ui.style().interact(&interact).corner_radius,
fill_color: ui.style().interact(&interact).bg_fill_color, fill: ui.style().interact(&interact).bg_fill,
outline: ui.style().interact(&interact).rect_outline, outline: ui.style().interact(&interact).rect_outline,
rect: big_icon_rect, rect: big_icon_rect,
}); });
@ -323,7 +323,7 @@ impl<'a> Widget for Checkbox<'a> {
]), ]),
closed: false, closed: false,
outline: Some(LineStyle::new(ui.style().line_width, stroke_color)), outline: Some(LineStyle::new(ui.style().line_width, stroke_color)),
fill_color: None, fill: None,
}); });
} }
@ -381,14 +381,14 @@ impl Widget for RadioButton {
let text_cursor = let text_cursor =
interact.rect.min + ui.style().button_padding + vec2(ui.style().start_icon_width, 0.0); interact.rect.min + ui.style().button_padding + vec2(ui.style().start_icon_width, 0.0);
let bg_fill_color = ui.style().interact(&interact).bg_fill_color; let bg_fill = ui.style().interact(&interact).bg_fill;
let stroke_color = ui.style().interact(&interact).stroke_color; let stroke_color = ui.style().interact(&interact).stroke_color;
let (small_icon_rect, big_icon_rect) = ui.style().icon_rectangles(interact.rect); let (small_icon_rect, big_icon_rect) = ui.style().icon_rectangles(interact.rect);
ui.add_paint_cmd(PaintCmd::Circle { ui.add_paint_cmd(PaintCmd::Circle {
center: big_icon_rect.center(), center: big_icon_rect.center(),
fill_color: bg_fill_color, fill: bg_fill,
outline: ui.style().interact(&interact).rect_outline, // TODO outline: ui.style().interact(&interact).rect_outline, // TODO
radius: big_icon_rect.width() / 2.0, radius: big_icon_rect.width() / 2.0,
}); });
@ -396,7 +396,7 @@ impl Widget for RadioButton {
if checked { if checked {
ui.add_paint_cmd(PaintCmd::Circle { ui.add_paint_cmd(PaintCmd::Circle {
center: small_icon_rect.center(), center: small_icon_rect.center(),
fill_color: Some(stroke_color), fill: Some(stroke_color),
outline: None, outline: None,
radius: small_icon_rect.width() / 3.0, radius: small_icon_rect.width() / 3.0,
}); });

View file

@ -174,14 +174,14 @@ impl<'a> Widget for Slider<'a> {
ui.add_paint_cmd(PaintCmd::Rect { ui.add_paint_cmd(PaintCmd::Rect {
rect: rail_rect, rect: rail_rect,
corner_radius: rail_radius, corner_radius: rail_radius,
fill_color: Some(ui.style().background_fill_color), fill: Some(ui.style().background_fill),
outline: Some(LineStyle::new(1.0, color::gray(200, 255))), // TODO outline: Some(LineStyle::new(1.0, color::gray(200, 255))), // TODO
}); });
ui.add_paint_cmd(PaintCmd::Circle { ui.add_paint_cmd(PaintCmd::Circle {
center: pos2(marker_center_x, rail_rect.center().y), center: pos2(marker_center_x, rail_rect.center().y),
radius: handle_radius, radius: handle_radius,
fill_color: Some(ui.style().interact(&interact).fill_color), fill: Some(ui.style().interact(&interact).fill),
outline: Some(LineStyle::new( outline: Some(LineStyle::new(
ui.style().interact(&interact).stroke_width, ui.style().interact(&interact).stroke_width,
ui.style().interact(&interact).stroke_color, ui.style().interact(&interact).stroke_color,

View file

@ -122,7 +122,7 @@ impl<'t> Widget for TextEdit<'t> {
ui.add_paint_cmd(PaintCmd::Rect { ui.add_paint_cmd(PaintCmd::Rect {
rect: bg_rect, rect: bg_rect,
corner_radius: ui.style().interact.style(&interact).corner_radius, corner_radius: ui.style().interact.style(&interact).corner_radius,
fill_color: Some(ui.style().dark_bg_color), fill: Some(ui.style().dark_bg_color),
outline: ui.style().interact.style(&interact).rect_outline, outline: ui.style().interact.style(&interact).rect_outline,
}); });
} }