Area to type in your message

This commit is contained in:
Mike Dilger 2022-12-22 06:38:40 +13:00
parent eb1d3a8141
commit d5aeaf1ba5
2 changed files with 17 additions and 0 deletions

View File

@ -2,12 +2,27 @@ use super::GossipUi;
use eframe::egui;
use egui::{Align, Color32, Context, Layout, RichText, ScrollArea, TextStyle, Ui, Vec2};
use nostr_proto::PublicKey;
use tracing::info;
pub(super) fn update(app: &mut GossipUi, _ctx: &Context, _frame: &mut eframe::Frame, ui: &mut Ui) {
let feed = crate::globals::blocking_get_feed();
//let screen_rect = ctx.input().screen_rect; // Rect
ui.horizontal(|ui| {
ui.text_edit_multiline(&mut app.draft);
if ui.button("Send").clicked() {
info!("Would send: {}", app.draft);
app.draft = "".to_owned();
// We need our private key
// Then we need to create a TextNote event
// Then we need to send it to multiple relays
// NOT a one-liner
}
});
ScrollArea::vertical().show(ui, |ui| {
for id in feed.iter() {
// Stop rendering at the bottom of the window:

View File

@ -57,6 +57,7 @@ struct GossipUi {
about: About,
icon: TextureHandle,
placeholder_avatar: TextureHandle,
draft: String,
}
impl GossipUi {
@ -104,6 +105,7 @@ impl GossipUi {
about: crate::about::about(),
icon: icon_texture_handle,
placeholder_avatar: placeholder_avatar_texture_handle,
draft: "".to_owned(),
}
}
}