Migrate to egui v0.29.1
Not too many breaking changes. I updated egui-nav and egui-tabs as well. Fixes: https://github.com/damus-io/notedeck/issues/315 Changelog-Fixed: Fixed crash when navigating in debug mode Changelog-Changed: Migrated to egui v0.29.1 Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -235,7 +235,7 @@ pub fn create_themed_visuals(theme: ColorTheme, default: Visuals) -> Visuals {
|
||||
}
|
||||
}
|
||||
|
||||
pub static DECK_ICON_SIZE: f32 = 24.0;
|
||||
//pub static DECK_ICON_SIZE: f32 = 24.0;
|
||||
|
||||
pub fn deck_icon_font_sized(size: f32) -> FontId {
|
||||
egui::FontId::new(size, emoji_font_family())
|
||||
|
||||
@@ -58,6 +58,7 @@ fn available_characters(ui: &egui::Ui, family: egui::FontFamily) -> Vec<char> {
|
||||
.font(&egui::FontId::new(10.0, family)) // size is arbitrary for getting the characters
|
||||
.characters()
|
||||
.iter()
|
||||
.map(|(chr, _v)| chr)
|
||||
.filter(|chr| !chr.is_whitespace() && !chr.is_ascii_control())
|
||||
.copied()
|
||||
.collect()
|
||||
|
||||
@@ -14,10 +14,10 @@ use crate::{
|
||||
|
||||
static FALLBACK_PUBKEY: &str = "aa733081e4f0f79dd43023d8983265593f2b41a988671cfcef3f489b91ad93fe";
|
||||
|
||||
pub enum DecksAction {
|
||||
Switch(usize),
|
||||
Removing(usize),
|
||||
}
|
||||
//pub enum DecksAction {
|
||||
// Switch(usize),
|
||||
// Removing(usize),
|
||||
//}
|
||||
|
||||
pub struct DecksCache {
|
||||
pub account_to_decks: HashMap<Pubkey, Decks>,
|
||||
|
||||
@@ -248,7 +248,7 @@ pub fn render_nav(col: usize, app: &mut Damus, ui: &mut egui::Ui) -> RenderNavRe
|
||||
let col_id = get_active_columns(&app.accounts, &app.decks_cache).get_column_id_at_index(col);
|
||||
// TODO(jb55): clean up this router_mut mess by using Router<R> in egui-nav directly
|
||||
|
||||
let nav_response = Nav::new(app.columns().column(col).router().routes().clone())
|
||||
let nav_response = Nav::new(&app.columns().column(col).router().routes().clone())
|
||||
.navigating(app.columns_mut().column_mut(col).router_mut().navigating)
|
||||
.returning(app.columns_mut().column_mut(col).router_mut().returning)
|
||||
.id_source(egui::Id::new(col_id))
|
||||
@@ -258,7 +258,7 @@ pub fn render_nav(col: usize, app: &mut Damus, ui: &mut egui::Ui) -> RenderNavRe
|
||||
&mut app.img_cache,
|
||||
get_active_columns_mut(&app.accounts, &mut app.decks_cache),
|
||||
app.accounts.get_selected_account().map(|a| &a.pubkey),
|
||||
nav.routes_arr(),
|
||||
nav.routes(),
|
||||
)
|
||||
.show(ui),
|
||||
NavUiType::Body => render_nav_body(ui, app, nav.routes().last().expect("top"), col),
|
||||
|
||||
@@ -244,7 +244,7 @@ fn image_carousel(
|
||||
|
||||
ui.add_sized([width, height], |ui: &mut egui::Ui| {
|
||||
egui::ScrollArea::horizontal()
|
||||
.id_source(carousel_id)
|
||||
.id_salt(carousel_id)
|
||||
.show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
for image in images {
|
||||
|
||||
@@ -50,7 +50,7 @@ impl<'a> ProfileView<'a> {
|
||||
let scroll_id = egui::Id::new(("profile_scroll", self.col_id, self.pubkey));
|
||||
|
||||
ScrollArea::vertical()
|
||||
.id_source(scroll_id)
|
||||
.id_salt(scroll_id)
|
||||
.show(ui, |ui| {
|
||||
let txn = Transaction::new(self.ndb).expect("txn");
|
||||
if let Ok(profile) = self.ndb.get_profile_by_pubkey(&txn, self.pubkey.bytes()) {
|
||||
|
||||
@@ -65,7 +65,7 @@ impl<'a> RelayView<'a> {
|
||||
.inner_margin(Margin::symmetric(0.0, 4.0))
|
||||
.show(ui, |ui| {
|
||||
egui::ScrollArea::horizontal()
|
||||
.id_source(index)
|
||||
.id_salt(index)
|
||||
.max_width(
|
||||
ui.max_rect().width()
|
||||
- get_right_side_width(relay_info.status),
|
||||
|
||||
@@ -73,7 +73,7 @@ impl<'a> ThreadView<'a> {
|
||||
);
|
||||
|
||||
egui::ScrollArea::vertical()
|
||||
.id_source(self.id_source)
|
||||
.id_salt(self.id_source)
|
||||
.animated(false)
|
||||
.auto_shrink([false, false])
|
||||
.scroll_bar_visibility(egui::scroll_area::ScrollBarVisibility::AlwaysVisible)
|
||||
|
||||
@@ -97,7 +97,7 @@ fn timeline_ui(
|
||||
};
|
||||
|
||||
egui::ScrollArea::vertical()
|
||||
.id_source(scroll_id)
|
||||
.id_salt(scroll_id)
|
||||
.animated(false)
|
||||
.auto_shrink([false, false])
|
||||
.scroll_bar_visibility(ScrollBarVisibility::AlwaysVisible)
|
||||
|
||||
Reference in New Issue
Block a user