Move all operations to widget::operation module
This commit is contained in:
parent
885d45f435
commit
34a42b5ad4
14 changed files with 124 additions and 136 deletions
|
|
@ -2,7 +2,7 @@ mod echo;
|
|||
|
||||
use iced::futures::stream;
|
||||
use iced::widget::{
|
||||
self, button, center, column, row, scrollable, text, text_input,
|
||||
button, center, column, operation, row, scrollable, text, text_input,
|
||||
};
|
||||
use iced::{Center, Element, Fill, Subscription, Task, color};
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ impl WebSocket {
|
|||
new_message: String::new(),
|
||||
state: State::Disconnected,
|
||||
},
|
||||
widget::focus_next(),
|
||||
operation::focus_next(),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -73,10 +73,7 @@ impl WebSocket {
|
|||
echo::Event::MessageReceived(message) => {
|
||||
self.messages.push(message);
|
||||
|
||||
scrollable::snap_to(
|
||||
MESSAGE_LOG,
|
||||
scrollable::RelativeOffset::END,
|
||||
)
|
||||
operation::snap_to_end(MESSAGE_LOG)
|
||||
}
|
||||
},
|
||||
Message::Server => Task::none(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue