Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–22 unchanged (22 lines)
23 };
24 Style {
25 background,
26 incoming: colors.secondary,
27 outgoing: colors.outgoing,
28 text_color: colors.text_body,
29 }
30 }
31}
32
33impl Catalog for StyleType {
34 type Class<'a> = DonutType;
35
…lines 36–42 unchanged (7 lines)
43}
44
45pub struct Style {
46 pub(crate) background: Color,
47 pub(crate) incoming: Color,
48 pub(crate) outgoing: Color,
49 pub(crate) text_color: Color,
50}
51
52/// The theme catalog of a [`ProgressBar`].
53pub trait Catalog: Sized {
54 /// The item class of the [`Catalog`].
55 type Class<'a>;
…lines 56–63 unchanged (8 lines)

After

…lines 1–22 unchanged (22 lines)
23 };
24 Style {
25 background,
26 incoming: colors.secondary,
27 outgoing: colors.outgoing,
28 text_color: colors.text_body,
29 filtered_out: Color {
30 a: ext.alpha_round_borders,
31 ..ext.buttons_color
32 },
33 dropped: Color::new(0.8, 0.15, 0.15, 1.0),
34 }
35 }
36}
37
38impl Catalog for StyleType {
39 type Class<'a> = DonutType;
…lines 40–45 unchanged (6 lines)
46 class.active(self)
47 }
48}
49
50pub struct Style {
51 pub(crate) background: Color,
52 pub(crate) text_color: Color,
53 pub(crate) incoming: Color,
54 pub(crate) outgoing: Color,
55 pub(crate) filtered_out: Color,
56 pub(crate) dropped: Color,
57}
58
59/// The theme catalog of a [`ProgressBar`].
60pub trait Catalog: Sized {
61 /// The item class of the [`Catalog`].
62 type Class<'a>;
…lines 63–70 unchanged (8 lines)

Before

source_file
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "chart"
:: "::"
identifier "types"
:: "::"
identifier "donut_chart"
:: "::"
identifier "Status"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "gui"
:: "::"
identifier "styles"
:: "::"
identifier "button"
:: "::"
identifier "ButtonType"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "gui"
:: "::"
identifier "styles"
:: "::"
identifier "types"
:: "::"
identifier "style_type"
:: "::"
identifier "StyleType"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "iced"
:: "::"
identifier "Color"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Default"
) ")"
] "]"
enum_item
visibility_modifier
pub "pub"
enum "enum"
type_identifier "DonutType"
enum_variant_list
{ "{"
attribute_item
# "#"
[ "["
attribute
identifier "default"
] "]"
enum_variant
identifier "Standard"
, ","
} "}"
impl_item
impl "impl"
type_identifier "DonutType"
declaration_list
{ "{"
function_item
fn "fn"
identifier "active"
parameters
( "("
self_parameter
& "&"
self "self"
, ","
parameter
identifier "style"
: ":"
reference_type
& "&"
type_identifier "StyleType"
) ")"
-> "->"
type_identifier "Style"
block
{ "{"
let_declaration
let "let"
identifier "colors"
= "="
call_expression
field_expression
identifier "style"
. "."
field_identifier "get_palette"
arguments
( "("
) ")"
; ";"
let_declaration
let "let"
identifier "ext"
= "="
call_expression
field_expression
identifier "style"
. "."
field_identifier "get_extension"
arguments
( "("
) ")"
; ";"
let_declaration
let "let"
identifier "primary"
= "="
field_expression
identifier "colors"
. "."
field_identifier "primary"
; ";"
let_declaration
let "let"
identifier "buttons"
= "="
field_expression
identifier "ext"
. "."
field_identifier "buttons_color"
; ";"
let_declaration (+102 nodes collapsed)
struct_expression
type_identifier "Style"
field_initializer_list
{ "{"
shorthand_field_initializer
identifier "background"
, ","
field_initializer
field_identifier "incoming"
: ":"
field_expression
identifier "colors"
. "."
field_identifier "secondary"
, ","
field_initializer
field_identifier "outgoing"
: ":"
field_expression
identifier "colors"
. "."
field_identifier "outgoing"
, ","
field_initializer
field_identifier "text_color"
: ":"
field_expression
identifier "colors"
. "."
field_identifier "text_body"
, ","
} "}"
} "}"
} "}"
impl_item (+100 nodes collapsed)
struct_item
visibility_modifier
pub "pub"
struct "struct"
type_identifier "Style"
field_declaration_list
{ "{"
field_declaration
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
field_identifier "background"
: ":"
type_identifier "Color"
, ","
field_declaration
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
field_identifier "incoming"
: ":"
type_identifier "Color"
, ","
field_declaration
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
field_identifier "outgoing"
: ":"
type_identifier "Color"
, ","
field_declaration
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
field_identifier "text_color"
: ":"
type_identifier "Color"
, ","
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " The theme catalog of a [`ProgressBar`].\n"
trait_item (+92 nodes collapsed)

After

source_file
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "chart"
:: "::"
identifier "types"
:: "::"
identifier "donut_chart"
:: "::"
identifier "Status"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "gui"
:: "::"
identifier "styles"
:: "::"
identifier "button"
:: "::"
identifier "ButtonType"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "gui"
:: "::"
identifier "styles"
:: "::"
identifier "types"
:: "::"
identifier "style_type"
:: "::"
identifier "StyleType"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "iced"
:: "::"
identifier "Color"
; ";"
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Default"
) ")"
] "]"
enum_item
visibility_modifier
pub "pub"
enum "enum"
type_identifier "DonutType"
enum_variant_list
{ "{"
attribute_item
# "#"
[ "["
attribute
identifier "default"
] "]"
enum_variant
identifier "Standard"
, ","
} "}"
impl_item
impl "impl"
type_identifier "DonutType"
declaration_list
{ "{"
function_item
fn "fn"
identifier "active"
parameters
( "("
self_parameter
& "&"
self "self"
, ","
parameter
identifier "style"
: ":"
reference_type
& "&"
type_identifier "StyleType"
) ")"
-> "->"
type_identifier "Style"
block
{ "{"
let_declaration
let "let"
identifier "colors"
= "="
call_expression
field_expression
identifier "style"
. "."
field_identifier "get_palette"
arguments
( "("
) ")"
; ";"
let_declaration
let "let"
identifier "ext"
= "="
call_expression
field_expression
identifier "style"
. "."
field_identifier "get_extension"
arguments
( "("
) ")"
; ";"
let_declaration
let "let"
identifier "primary"
= "="
field_expression
identifier "colors"
. "."
field_identifier "primary"
; ";"
let_declaration
let "let"
identifier "buttons"
= "="
field_expression
identifier "ext"
. "."
field_identifier "buttons_color"
; ";"
let_declaration (+102 nodes collapsed)
struct_expression
type_identifier "Style"
field_initializer_list
{ "{"
shorthand_field_initializer
identifier "background"
, ","
field_initializer
field_identifier "incoming"
: ":"
field_expression
identifier "colors"
. "."
field_identifier "secondary"
, ","
field_initializer
field_identifier "outgoing"
: ":"
field_expression
identifier "colors"
. "."
field_identifier "outgoing"
, ","
field_initializer
field_identifier "text_color"
: ":"
field_expression
identifier "colors"
. "."
field_identifier "text_body"
, ","
field_initializer
field_identifier "filtered_out"
: ":"
struct_expression
type_identifier "Color"
field_initializer_list
{ "{"
field_initializer
field_identifier "a"
: ":"
field_expression
identifier "ext"
. "."
field_identifier "alpha_round_borders"
, ","
base_field_initializer
.. ".."
field_expression
identifier "ext"
. "."
field_identifier "buttons_color"
} "}"
, ","
field_initializer
field_identifier "dropped"
: ":"
call_expression
scoped_identifier
identifier "Color"
:: "::"
identifier "new"
arguments
( "("
float_literal "0.8"
, ","
float_literal "0.15"
, ","
float_literal "0.15"
, ","
float_literal "1.0"
) ")"
, ","
} "}"
} "}"
} "}"
impl_item (+100 nodes collapsed)
struct_item
visibility_modifier
pub "pub"
struct "struct"
type_identifier "Style"
field_declaration_list
{ "{"
field_declaration
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
field_identifier "background"
: ":"
type_identifier "Color"
, ","
field_declaration
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
field_identifier "text_color"
: ":"
type_identifier "Color"
, ","
field_declaration
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
field_identifier "incoming"
: ":"
type_identifier "Color"
, ","
field_declaration
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
field_identifier "outgoing"
: ":"
type_identifier "Color"
, ","
field_declaration
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
field_identifier "filtered_out"
: ":"
type_identifier "Color"
, ","
field_declaration
visibility_modifier
pub "pub"
( "("
crate "crate"
) ")"
field_identifier "dropped"
: ":"
type_identifier "Color"
, ","
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " The theme catalog of a [`ProgressBar`].\n"
trait_item (+92 nodes collapsed)