summaryrefslogtreecommitdiffstats
path: root/examples/websocket
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2022-11-19 10:29:37 -0800
committerLibravatar bungoboingo <shankern@protonmail.com>2022-12-29 10:21:23 -0800
commitd91f4f6aa74d0693179a02167d626efa3ac4c20b (patch)
tree293852763793fbf6cb142fffac222ee7a87a1edf /examples/websocket
parenta6d0d5773f0561a841a84b538523cbd97e91eccd (diff)
downloadiced-d91f4f6aa74d0693179a02167d626efa3ac4c20b.tar.gz
iced-d91f4f6aa74d0693179a02167d626efa3ac4c20b.tar.bz2
iced-d91f4f6aa74d0693179a02167d626efa3ac4c20b.zip
Add multidirectional scrolling capabilities to the existing Scrollable.
Diffstat (limited to 'examples/websocket')
-rw-r--r--examples/websocket/src/main.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/websocket/src/main.rs b/examples/websocket/src/main.rs
index ff2929da..b10ef17e 100644
--- a/examples/websocket/src/main.rs
+++ b/examples/websocket/src/main.rs
@@ -1,10 +1,10 @@
mod echo;
use iced::alignment::{self, Alignment};
-use iced::executor;
use iced::widget::{
button, column, container, row, scrollable, text, text_input, Column,
};
+use iced::{executor, Vector};
use iced::{
Application, Color, Command, Element, Length, Settings, Subscription, Theme,
};
@@ -81,7 +81,10 @@ impl Application for WebSocket {
echo::Event::MessageReceived(message) => {
self.messages.push(message);
- scrollable::snap_to(MESSAGE_LOG.clone(), 1.0)
+ scrollable::snap_to(
+ MESSAGE_LOG.clone(),
+ Vector::new(0.0, 1.0),
+ )
}
},
Message::Server => Command::none(),