Merge master into more-theme-options

This commit is contained in:
Bu5hm4nn 2023-03-04 21:00:54 -06:00
commit 330e0beea2
7 changed files with 30 additions and 6 deletions

View File

@ -30,7 +30,8 @@ Gossip is ready to use as a daily client if you wish. There are shortcomings, an
### Screenshot
![Gossip Screenshot](gossip_screenshot.png)
![Gossip Screenshot, Default Light Theme](assets/gossip_screenshot_light.png)
![Gossip Screenshot, Default Dark Theme](assets/gossip_screenshot_dark.png)
### Videos

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

View File

@ -54,6 +54,8 @@ impl Feed {
// Recompute as they switch
self.switched_and_recomputing.store(true, Ordering::Relaxed);
task::spawn(async move {
let now = Instant::now();
*GLOBALS.feed.last_computed.write() = now;
if let Err(e) = GLOBALS.feed.recompute().await {
tracing::error!("{}", e);
}
@ -77,6 +79,8 @@ impl Feed {
// Recompute as they switch
self.switched_and_recomputing.store(true, Ordering::Relaxed);
task::spawn(async move {
let now = Instant::now();
*GLOBALS.feed.last_computed.write() = now;
if let Err(e) = GLOBALS.feed.recompute().await {
tracing::error!("{}", e);
}
@ -174,10 +178,10 @@ impl Feed {
{
let now = now;
task::spawn(async move {
*GLOBALS.feed.last_computed.write() = now;
if let Err(e) = GLOBALS.feed.recompute().await {
tracing::error!("{}", e);
}
*GLOBALS.feed.last_computed.write() = now;
});
}
}

View File

@ -33,7 +33,7 @@ use crate::error::Error;
use crate::globals::GLOBALS;
use std::ops::DerefMut;
use std::{env, mem, thread};
use tracing_subscriber::filter::EnvFilter;
use tracing_subscriber::filter::{EnvFilter, LevelFilter};
pub const AVATAR_SIZE: u32 = 48; // points, not pixels
pub const AVATAR_SIZE_F32: f32 = 48.0; // points, not pixels
@ -45,12 +45,18 @@ fn main() -> Result<(), Error> {
env::set_var("RUST_LOG", "info");
}
let env_filter = EnvFilter::from_default_env();
let max_level = match env_filter.max_level_hint() {
Some(l) => l,
None => LevelFilter::ERROR,
};
let show_debug = cfg!(debug_assertions) || max_level <= LevelFilter::DEBUG;
tracing_subscriber::fmt::fmt()
.without_time()
.with_target(false)
.with_file(cfg!(debug_assertions))
.with_line_number(cfg!(debug_assertions))
.with_env_filter(EnvFilter::from_default_env())
.with_file(show_debug)
.with_line_number(show_debug)
.with_env_filter(env_filter)
.init();
// Setup the database (possibly create, possibly upgrade)

View File

@ -1,5 +1,6 @@
use super::{GossipUi, Page};
use crate::comms::ToOverlordMessage;
use crate::feed::FeedKind;
use crate::globals::{Globals, GLOBALS};
use crate::ui::widgets::CopyButton;
use eframe::egui;
@ -20,6 +21,18 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, _frame: &mut eframe::Fra
app.set_page(Page::YourKeys);
}
ui.separator();
if let Some(pubkeyhex) = GLOBALS.signer.public_key() {
if ui
.add(SelectableLabel::new(
app.page == Page::Feed(FeedKind::Person(pubkeyhex.into())),
"Notes »",
))
.clicked()
{
app.set_page(Page::Feed(FeedKind::Person(pubkeyhex.into())));
}
ui.separator();
}
if ui
.add(SelectableLabel::new(
app.page == Page::YourMetadata,