Rename pending_handle to new_handle

This commit is contained in:
Jonathan Johnson 2024-10-04 10:20:31 -07:00
parent 4f3ef7d9ed
commit 75b7b888eb
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
3 changed files with 9 additions and 9 deletions

View file

@ -20,7 +20,7 @@ fn main() -> cushy::Result {
} }
fn show_modal(present_in: &impl ModalTarget, level: usize) { fn show_modal(present_in: &impl ModalTarget, level: usize) {
let handle = present_in.pending_handle(); let handle = present_in.new_handle();
handle handle
.build_dialog( .build_dialog(
format!("Modal level: {level}") format!("Modal level: {level}")

View file

@ -302,7 +302,7 @@ where
T: ModalTarget, T: ModalTarget,
{ {
fn open_message_box(&self, message: &MessageBox) { fn open_message_box(&self, message: &MessageBox) {
let handle = self.pending_handle(); let handle = self.new_handle();
let dialog = handle.build_dialog( let dialog = handle.build_dialog(
message message
.title .title

View file

@ -918,7 +918,7 @@ impl Modal {
/// Returns a new pending handle that can be used to show a modal and /// Returns a new pending handle that can be used to show a modal and
/// dismiss it. /// dismiss it.
#[must_use] #[must_use]
pub fn pending_handle(&self) -> ModalHandle { pub fn new_handle(&self) -> ModalHandle {
ModalHandle { ModalHandle {
layer: self.clone(), layer: self.clone(),
above: None, above: None,
@ -936,7 +936,7 @@ impl Modal {
/// Returns a builder for a modal dialog that displays `message`. /// Returns a builder for a modal dialog that displays `message`.
pub fn build_dialog(&self, message: impl MakeWidget) -> DialogBuilder { pub fn build_dialog(&self, message: impl MakeWidget) -> DialogBuilder {
DialogBuilder::new(self.pending_handle(), message) DialogBuilder::new(self.new_handle(), message)
} }
/// Dismisses the modal session. /// Dismisses the modal session.
@ -1272,14 +1272,14 @@ impl Drop for ModalHandle {
/// A target for a [`Modal`] session. /// A target for a [`Modal`] session.
pub trait ModalTarget: Send + 'static { pub trait ModalTarget: Send + 'static {
/// Returns a new handle that can be used to show a dialog above `self`. /// Returns a new handle that can be used to show a dialog above `self`.
fn pending_handle(&self) -> ModalHandle; fn new_handle(&self) -> ModalHandle;
/// Returns a reference to the modal layer this target presents to. /// Returns a reference to the modal layer this target presents to.
fn layer(&self) -> &Modal; fn layer(&self) -> &Modal;
} }
impl ModalTarget for Modal { impl ModalTarget for Modal {
fn pending_handle(&self) -> ModalHandle { fn new_handle(&self) -> ModalHandle {
self.pending_handle() self.new_handle()
} }
fn layer(&self) -> &Modal { fn layer(&self) -> &Modal {
@ -1288,8 +1288,8 @@ impl ModalTarget for Modal {
} }
impl ModalTarget for ModalHandle { impl ModalTarget for ModalHandle {
fn pending_handle(&self) -> ModalHandle { fn new_handle(&self) -> ModalHandle {
self.layer.pending_handle().above(self) self.layer.new_handle().above(self)
} }
fn layer(&self) -> &Modal { fn layer(&self) -> &Modal {