mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 06:24:39 +00:00
fwb2-fix: sizing dialog keys as public consts
(cherry picked from commit a9ddf1b98cbd7f15032e0a88947b05e94129e0c3)
This commit is contained in:
@@ -238,10 +238,13 @@ pub struct HostedCanvasSize {
|
||||
}
|
||||
|
||||
impl HostedCanvasSize {
|
||||
/// The dialog's key: its [`DialogId`] is `dialog_id(KEY)`, so an app finds the open dialog by it.
|
||||
pub const KEY: &'static str = "sizing.canvasSize";
|
||||
|
||||
/// A dialog opening with `values`; `build` makes it over the values (`CanvasSize::new` with its settings).
|
||||
pub fn new(values: CanvasSizeValues, build: impl for<'b> Fn(Bind<'b, CanvasSizeValues>) -> CanvasSize<'b> + Send + 'static) -> Self {
|
||||
HostedCanvasSize {
|
||||
id: dialog_id(KEY),
|
||||
id: dialog_id(Self::KEY),
|
||||
open: true,
|
||||
values,
|
||||
build: Box::new(build),
|
||||
@@ -256,9 +259,6 @@ impl HostedCanvasSize {
|
||||
}
|
||||
}
|
||||
|
||||
/// The key of the hosted dialog.
|
||||
const KEY: &str = "sizing.canvasSize";
|
||||
|
||||
impl StackDialog for HostedCanvasSize {
|
||||
type Result = CanvasSizeResult;
|
||||
|
||||
@@ -317,7 +317,7 @@ impl StackDialog for HostedCanvasSize {
|
||||
}
|
||||
|
||||
fn key(&self) -> Option<&str> {
|
||||
Some(KEY)
|
||||
Some(Self::KEY)
|
||||
}
|
||||
|
||||
#[cfg(feature = "testing")]
|
||||
|
||||
@@ -243,10 +243,13 @@ pub struct HostedImageSize {
|
||||
}
|
||||
|
||||
impl HostedImageSize {
|
||||
/// The dialog's key: its [`DialogId`] is `dialog_id(KEY)`, so an app finds the open dialog by it.
|
||||
pub const KEY: &'static str = "sizing.imageSize";
|
||||
|
||||
/// A dialog opening with `values`; `build` makes it over the values (`ImageSize::new` with its settings).
|
||||
pub fn new(values: ImageSizeValues, build: impl for<'b> Fn(Bind<'b, ImageSizeValues>) -> ImageSize<'b> + Send + 'static) -> Self {
|
||||
HostedImageSize {
|
||||
id: dialog_id(KEY),
|
||||
id: dialog_id(Self::KEY),
|
||||
open: true,
|
||||
values,
|
||||
build: Box::new(build),
|
||||
@@ -261,9 +264,6 @@ impl HostedImageSize {
|
||||
}
|
||||
}
|
||||
|
||||
/// The key of the hosted dialog.
|
||||
const KEY: &str = "sizing.imageSize";
|
||||
|
||||
impl StackDialog for HostedImageSize {
|
||||
type Result = ImageSizeResult;
|
||||
|
||||
@@ -347,7 +347,7 @@ impl StackDialog for HostedImageSize {
|
||||
}
|
||||
|
||||
fn key(&self) -> Option<&str> {
|
||||
Some(KEY)
|
||||
Some(Self::KEY)
|
||||
}
|
||||
|
||||
#[cfg(feature = "testing")]
|
||||
|
||||
Reference in New Issue
Block a user