notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 66dbbf7c0301d1a6e8b858fb222bc3e5a40d2b80
parent e31ce5d879cb02f478205ffde106a42f8e684199
Author: Ken Sedgwick <ken@bonsai.com>
Date:   Mon,  9 Dec 2024 10:35:39 -0800

egui: update deprecated calls to use UiBuilder instead

Diffstat:
Msrc/ui/accounts.rs | 6++++--
Msrc/ui/column/header.rs | 9++++++---
2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/ui/accounts.rs b/src/ui/accounts.rs @@ -6,7 +6,9 @@ use crate::{ ui::{Preview, PreviewConfig, View}, Damus, }; -use egui::{Align, Button, Frame, Image, InnerResponse, Layout, RichText, ScrollArea, Ui, Vec2}; +use egui::{ + Align, Button, Frame, Image, InnerResponse, Layout, RichText, ScrollArea, Ui, UiBuilder, Vec2, +}; use nostrdb::{Ndb, Transaction}; use super::profile::preview::SimpleProfilePreview; @@ -88,7 +90,7 @@ impl<'a> AccountsView<'a> { let profile_peview_view = { let max_size = egui::vec2(ui.available_width(), 77.0); let resp = ui.allocate_response(max_size, egui::Sense::click()); - ui.allocate_ui_at_rect(resp.rect, |ui| { + ui.allocate_new_ui(UiBuilder::new().max_rect(resp.rect), |ui| { let preview = SimpleProfilePreview::new(profile.as_ref(), img_cache, has_nsec); show_profile_card(ui, preview, max_size, is_selected, resp) diff --git a/src/ui/column/header.rs b/src/ui/column/header.rs @@ -11,7 +11,7 @@ use crate::{ }, }; -use egui::{RichText, Stroke}; +use egui::{RichText, Stroke, UiBuilder}; use enostr::Pubkey; use nostrdb::{Ndb, Transaction}; @@ -45,8 +45,11 @@ impl<'a> NavTitle<'a> { let mut rect = ui.available_rect_before_wrap(); rect.set_height(48.0); - let mut child_ui = - ui.child_ui(rect, egui::Layout::left_to_right(egui::Align::Center), None); + let mut child_ui = ui.new_child( + UiBuilder::new() + .max_rect(rect) + .layout(egui::Layout::left_to_right(egui::Align::Center)), + ); let r = self.title_bar(&mut child_ui);