Skip to content

Commit b7de074

Browse files
committed
chore: add document for macro
1 parent 24994e6 commit b7de074

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

iced_examples/counter/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ fn update(counter: &mut Counter, message: Message) -> Command<Message> {
7979
counter.text = text;
8080
Command::none()
8181
}
82-
8382
Message::Direction(direction) => match direction {
8483
WindowDirection::Left => Command::done(Message::AnchorSizeChange(
8584
Anchor::Left | Anchor::Top | Anchor::Bottom,

iced_layershell_macros/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub fn to_layer_message(attr: TokenStream2, input: TokenStream2) -> manyhow::Res
4141
SetInputRegion{ id: iced::window::Id, callback: iced_layershell::actions::ActionCallback },
4242
AnchorSizeChange{id: iced::window::Id, anchor:iced_layershell::reexport::Anchor, size: (u32, u32)},
4343
LayerChange{id: iced::window::Id, layer:iced_layershell::reexport::Layer},
44+
/// Margin: top, left, bottom, right
4445
MarginChange{id: iced::window::Id, margin: (i32, i32, i32, i32)},
4546
SizeChange{id: iced::window::Id, size: (u32, u32)},
4647
ExclusiveZoneChange{id: iced::window::Id, zone_size: i32},
@@ -129,8 +130,10 @@ pub fn to_layer_message(attr: TokenStream2, input: TokenStream2) -> manyhow::Res
129130
let additional_variants = quote! {
130131
AnchorChange(iced_layershell::reexport::Anchor),
131132
SetInputRegion(iced_layershell::actions::ActionCallback),
133+
// Ancher and Size (width, height)
132134
AnchorSizeChange(iced_layershell::reexport::Anchor, (u32, u32)),
133135
LayerChange(iced_layershell::reexport::Layer),
136+
/// Margin: top, left, bottom, right
134137
MarginChange((i32, i32, i32, i32)),
135138
SizeChange((u32, u32)),
136139
ExclusiveZoneChange(i32),

0 commit comments

Comments
 (0)