black background

This commit is contained in:
William Casarin
2024-03-09 01:21:07 -08:00
parent 088d012c93
commit 4a5a9d4319
3 changed files with 19 additions and 5 deletions

10
Cargo.lock generated
View File

@@ -844,6 +844,7 @@ dependencies = [
"objc", "objc",
"parking_lot", "parking_lot",
"percent-encoding", "percent-encoding",
"pollster",
"puffin", "puffin",
"raw-window-handle 0.5.2", "raw-window-handle 0.5.2",
"raw-window-handle 0.6.0", "raw-window-handle 0.6.0",
@@ -853,6 +854,7 @@ dependencies = [
"wasm-bindgen-futures", "wasm-bindgen-futures",
"web-sys", "web-sys",
"web-time", "web-time",
"wgpu",
"winapi", "winapi",
"winit", "winit",
] ]
@@ -2396,6 +2398,12 @@ dependencies = [
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
[[package]]
name = "pollster"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2"
[[package]] [[package]]
name = "powerfmt" name = "powerfmt"
version = "0.2.0" version = "0.2.0"
@@ -3811,6 +3819,7 @@ dependencies = [
"cfg_aliases", "cfg_aliases",
"js-sys", "js-sys",
"log", "log",
"naga",
"parking_lot", "parking_lot",
"profiling", "profiling",
"raw-window-handle 0.6.0", "raw-window-handle 0.6.0",
@@ -3860,6 +3869,7 @@ dependencies = [
"arrayvec", "arrayvec",
"ash", "ash",
"bitflags 2.4.2", "bitflags 2.4.2",
"block",
"cfg_aliases", "cfg_aliases",
"core-graphics-types", "core-graphics-types",
"glow", "glow",

View File

@@ -14,6 +14,7 @@ crate-type = ["lib", "cdylib"]
#egui-android = { git = "https://github.com/jb55/egui-android.git" } #egui-android = { git = "https://github.com/jb55/egui-android.git" }
egui = "0.26.0" egui = "0.26.0"
eframe = { version = "0.26.0", default-features = false, features = [ "glow", "wgpu", "android-native-activity" ] } eframe = { version = "0.26.0", default-features = false, features = [ "glow", "wgpu", "android-native-activity" ] }
#eframe = { version = "0.26.0", default-features = false, features = [ "glow", "android-native-activity" ] }
#eframe = "0.22.0" #eframe = "0.22.0"
egui_extras = { version = "0.26.0", features = ["all_loaders"] } egui_extras = { version = "0.26.0", features = ["all_loaders"] }
ehttp = "0.2.0" ehttp = "0.2.0"

View File

@@ -13,8 +13,8 @@ use std::borrow::Cow;
use egui::widgets::Spinner; use egui::widgets::Spinner;
use egui::{ use egui::{
Color32, Context, Frame, Hyperlink, Image, Label, Margin, RichText, Sense, Style, CollapsingHeader, Color32, Context, Frame, Hyperlink, Image, Label, Margin, RichText, Sense,
TextureHandle, Vec2, Visuals, Style, TextureHandle, Vec2, Visuals,
}; };
use enostr::{ClientMessage, Filter, Pubkey, RelayEvent, RelayMessage}; use enostr::{ClientMessage, Filter, Pubkey, RelayEvent, RelayMessage};
@@ -300,7 +300,7 @@ fn setup_initial_nostrdb_subs(damus: &mut Damus) -> Result<()> {
.collect(); .collect();
damus.timelines[0].subscription = Some(damus.ndb.subscribe(filters.clone())?); damus.timelines[0].subscription = Some(damus.ndb.subscribe(filters.clone())?);
let txn = Transaction::new(&damus.ndb)?; let txn = Transaction::new(&damus.ndb)?;
let res = damus.ndb.query(&txn, filters, 200)?; let res = damus.ndb.query(&txn, filters, 100)?;
damus.timelines[0].notes = res damus.timelines[0].notes = res
.iter() .iter()
.map(|qr| NoteRef { .map(|qr| NoteRef {
@@ -642,7 +642,7 @@ fn render_note_contents(
let blocks = if let Ok(blocks) = damus.ndb.get_blocks_by_key(txn, note_key) { let blocks = if let Ok(blocks) = damus.ndb.get_blocks_by_key(txn, note_key) {
blocks blocks
} else { } else {
warn!("note content '{}'", note.content()); warn!("missing note content blocks? '{}'", note.content());
ui.weak(note.content()); ui.weak(note.content());
return; return;
}; };
@@ -755,6 +755,8 @@ fn render_note(ui: &mut egui::Ui, damus: &mut Damus, note_key: NoteKey) -> Resul
}); });
render_note_contents(ui, damus, &txn, &note, note_key); render_note_contents(ui, damus, &txn, &note, note_key);
//render_note_actionbar(ui, damus);
}) })
}); });
}); });
@@ -859,7 +861,8 @@ fn set_app_style(style: &mut Style) {
visuals.hyperlink_color = PURPLE; visuals.hyperlink_color = PURPLE;
if visuals.dark_mode { if visuals.dark_mode {
visuals.override_text_color = Some(egui::Color32::from_rgb(250, 250, 250)); visuals.override_text_color = Some(egui::Color32::from_rgb(250, 250, 250));
visuals.panel_fill = egui::Color32::from_rgb(31, 31, 31); //visuals.panel_fill = egui::Color32::from_rgb(31, 31, 31);
visuals.panel_fill = egui::Color32::from_rgb(0, 0, 0);
//visuals.override_text_color = Some(egui::Color32::from_rgb(170, 177, 190)); //visuals.override_text_color = Some(egui::Color32::from_rgb(170, 177, 190));
//visuals.panel_fill = egui::Color32::from_rgb(40, 44, 52); //visuals.panel_fill = egui::Color32::from_rgb(40, 44, 52);
} else { } else {