mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 04:04:25 +00:00
Crop menus and Path Options start closed; their own buttons open them
This commit is contained in:
@@ -54,15 +54,15 @@ fn crop_bar_with_user_presets(ui: &mut Ui, data: &mut StoryData) -> StoryOutput
|
||||
}
|
||||
|
||||
#[story(CropOverlayMenu<'static>, covers = [], drive = Drive::Never)]
|
||||
fn crop_overlay_menu_open(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
fn crop_overlay_menu(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
let settings = data.value("overlay", CropSettings::default());
|
||||
CropOverlayMenu::new(settings).opened().show(ui).into()
|
||||
CropOverlayMenu::new(settings).show(ui).into()
|
||||
}
|
||||
|
||||
#[story(CropOptionsMenu<'static>, covers = [], drive = Drive::Never)]
|
||||
fn crop_options_menu_open(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
fn crop_options_menu(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
let settings = data.value("options", CropSettings::default());
|
||||
CropOptionsMenu::new(settings).opened().show(ui).into()
|
||||
CropOptionsMenu::new(settings).show(ui).into()
|
||||
}
|
||||
|
||||
#[story(CropOptionsMenu<'static>, covers = [], drive = Drive::Never)]
|
||||
@@ -70,5 +70,5 @@ fn crop_options_menu_classic_mode(ui: &mut Ui, data: &mut StoryData) -> StoryOut
|
||||
let mut settings = CropSettings::default();
|
||||
settings.shield.classic_mode = true;
|
||||
let settings = data.value("classic", settings);
|
||||
CropOptionsMenu::new(settings).opened().show(ui).into()
|
||||
CropOptionsMenu::new(settings).show(ui).into()
|
||||
}
|
||||
|
||||
@@ -13,18 +13,18 @@ fn line_color() -> Srgba {
|
||||
|
||||
#[story(PathOptionsPopover<'static>, covers = [Default], drive = Drive::Never)]
|
||||
fn path_options_defaults(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
let mut open = *data.value("open", true);
|
||||
let mut open = *data.value("open", false);
|
||||
let settings = data.value("defaults", PathOptionsSettings::default());
|
||||
let shown = PathOptionsPopover::new("Path Options", Bind::bound(&mut *settings)).default_color(line_color()).show(ui, &mut open);
|
||||
*data.value("open", true) = open;
|
||||
*data.value("open", false) = open;
|
||||
shown.into()
|
||||
}
|
||||
|
||||
#[story(PathOptionsPopover<'static>, covers = [], drive = Drive::Never)]
|
||||
fn path_options_with_a_color(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
let mut open = *data.value("open-set", true);
|
||||
let mut open = *data.value("open-set", false);
|
||||
let settings = data.value("set", PathOptionsSettings { rubber_band: true, color: Some([200, 40, 40]), thickness: Some(2.0) });
|
||||
let shown = PathOptionsPopover::new("Path Options", Bind::bound(&mut *settings)).show(ui, &mut open);
|
||||
*data.value("open-set", true) = open;
|
||||
*data.value("open-set", false) = open;
|
||||
shown.into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user