mirror of
https://github.com/danbulant/cushy
synced 2026-06-17 13:31:07 +00:00
Rename pending_handle to new_handle
This commit is contained in:
parent
4f3ef7d9ed
commit
75b7b888eb
3 changed files with 9 additions and 9 deletions
|
|
@ -20,7 +20,7 @@ fn main() -> cushy::Result {
|
|||
}
|
||||
|
||||
fn show_modal(present_in: &impl ModalTarget, level: usize) {
|
||||
let handle = present_in.pending_handle();
|
||||
let handle = present_in.new_handle();
|
||||
handle
|
||||
.build_dialog(
|
||||
format!("Modal level: {level}")
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ where
|
|||
T: ModalTarget,
|
||||
{
|
||||
fn open_message_box(&self, message: &MessageBox) {
|
||||
let handle = self.pending_handle();
|
||||
let handle = self.new_handle();
|
||||
let dialog = handle.build_dialog(
|
||||
message
|
||||
.title
|
||||
|
|
|
|||
|
|
@ -918,7 +918,7 @@ impl Modal {
|
|||
/// Returns a new pending handle that can be used to show a modal and
|
||||
/// dismiss it.
|
||||
#[must_use]
|
||||
pub fn pending_handle(&self) -> ModalHandle {
|
||||
pub fn new_handle(&self) -> ModalHandle {
|
||||
ModalHandle {
|
||||
layer: self.clone(),
|
||||
above: None,
|
||||
|
|
@ -936,7 +936,7 @@ impl Modal {
|
|||
|
||||
/// Returns a builder for a modal dialog that displays `message`.
|
||||
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.
|
||||
|
|
@ -1272,14 +1272,14 @@ impl Drop for ModalHandle {
|
|||
/// A target for a [`Modal`] session.
|
||||
pub trait ModalTarget: Send + 'static {
|
||||
/// 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.
|
||||
fn layer(&self) -> &Modal;
|
||||
}
|
||||
|
||||
impl ModalTarget for Modal {
|
||||
fn pending_handle(&self) -> ModalHandle {
|
||||
self.pending_handle()
|
||||
fn new_handle(&self) -> ModalHandle {
|
||||
self.new_handle()
|
||||
}
|
||||
|
||||
fn layer(&self) -> &Modal {
|
||||
|
|
@ -1288,8 +1288,8 @@ impl ModalTarget for Modal {
|
|||
}
|
||||
|
||||
impl ModalTarget for ModalHandle {
|
||||
fn pending_handle(&self) -> ModalHandle {
|
||||
self.layer.pending_handle().above(self)
|
||||
fn new_handle(&self) -> ModalHandle {
|
||||
self.layer.new_handle().above(self)
|
||||
}
|
||||
|
||||
fn layer(&self) -> &Modal {
|
||||
|
|
|
|||
Loading…
Reference in a new issue