ui: feed background color

This commit is contained in:
Mike Dilger 2022-12-30 09:35:52 +13:00
parent 477fdbcf80
commit f7e6f567b0

View File

@ -3,7 +3,7 @@ use crate::comms::BusMessage;
use crate::globals::{Globals, GLOBALS}; use crate::globals::{Globals, GLOBALS};
use crate::ui::widgets::{CopyButton, ReplyButton}; use crate::ui::widgets::{CopyButton, ReplyButton};
use eframe::egui; use eframe::egui;
use egui::{Align, Color32, Context, Layout, RichText, ScrollArea, TextEdit, TextStyle, Ui, Vec2}; use egui::{Align, Color32, Context, Frame, Layout, RichText, ScrollArea, TextEdit, TextStyle, Ui, Vec2};
use nostr_types::{EventKind, Id}; use nostr_types::{EventKind, Id};
pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Frame, ui: &mut Ui) { pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Frame, ui: &mut Ui) {
@ -116,6 +116,10 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
ui.separator(); ui.separator();
ScrollArea::vertical().show(ui, |ui| { ScrollArea::vertical().show(ui, |ui| {
let bgcolor = if ctx.style().visuals.dark_mode { Color32::BLACK } else { Color32::WHITE };
Frame::none().fill(bgcolor)
.show(ui, |ui| {
for id in feed.iter() { for id in feed.iter() {
// Stop rendering at the bottom of the window: // Stop rendering at the bottom of the window:
// (This confuses the scrollbar a bit, so I'm taking it out for now) // (This confuses the scrollbar a bit, so I'm taking it out for now)
@ -127,6 +131,7 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
render_post(app, ctx, frame, ui, *id, 0, false); render_post(app, ctx, frame, ui, *id, 0, false);
} }
}); });
});
} }
fn render_post( fn render_post(