mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
Area to type in your message
This commit is contained in:
parent
eb1d3a8141
commit
d5aeaf1ba5
@ -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:
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user