mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
refactor(ui-egui): move dialogs modules under dialogs/
This commit is contained in:
1 parent
0b2c35c024
commit
b6afd0953d
125 files changed
+155
-125
No files matched your search
@@ -979,8 +979,70 @@ pub fn open_command_dialog(app: &mut PhotocraftApp, command: &str, label: &str)
|
||||
app.ui.open_dialog(DialogKind::Command, fields)
|
||||
}
|
||||
|
||||
pub mod adjust_dialog;
|
||||
pub mod adjust_editors;
|
||||
pub mod adjust_preview;
|
||||
pub(crate) mod bitmap_dialog;
|
||||
pub mod blur_pins;
|
||||
pub mod brush_preset_dialog;
|
||||
pub mod caf_ui;
|
||||
pub(super) mod camera_raw_detail_ui;
|
||||
pub(super) mod camera_raw_gpu;
|
||||
pub(super) mod camera_raw_preview_ui;
|
||||
pub(super) mod camera_raw_scope_ui;
|
||||
pub mod camera_raw_ui;
|
||||
pub mod channel_options_ui;
|
||||
pub mod color_picker_ui;
|
||||
pub mod color_range_ui;
|
||||
pub mod color_table_ui;
|
||||
pub mod credits;
|
||||
pub mod dds_options_ui;
|
||||
pub mod delete_layer_prompt;
|
||||
pub mod dialog_alt_reset;
|
||||
pub mod dialog_blend_ui;
|
||||
pub mod discard_ui;
|
||||
pub mod disk_change_prompt;
|
||||
pub mod distort_ui;
|
||||
pub mod duplicate_layer_ui;
|
||||
pub mod edit_history;
|
||||
pub mod export_dialog;
|
||||
pub mod file_ui;
|
||||
pub mod fill_ui;
|
||||
pub mod filter_dialog;
|
||||
pub(super) mod filter_preview_ui;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub(super) mod filter_preview_worker;
|
||||
pub mod gallery_ui;
|
||||
pub mod guide_layout_ui;
|
||||
pub mod jpeg_options_ui;
|
||||
pub mod layer_picker;
|
||||
pub mod layer_style;
|
||||
pub mod liquify_ui;
|
||||
pub mod mask_trash_prompt;
|
||||
pub mod new_doc_ui;
|
||||
pub mod new_guide_ui;
|
||||
pub mod new_layer_ui;
|
||||
pub mod open_prompt;
|
||||
pub mod palette;
|
||||
pub(crate) mod pattern_fill_ui;
|
||||
pub mod rasterize_prompt;
|
||||
pub mod replace_prompt;
|
||||
pub(super) mod rgb_histogram;
|
||||
pub mod screen_picker;
|
||||
pub mod shape_dialog;
|
||||
pub(crate) mod shape_fill_ui;
|
||||
pub(super) mod sizing;
|
||||
pub mod smart_filter_dialog;
|
||||
pub mod snapshot_dialog;
|
||||
pub(crate) mod solid_fill_ui;
|
||||
pub mod stack_dialog;
|
||||
pub mod stroke_ui;
|
||||
pub mod targa_options_ui;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
pub mod tiff_options_ui;
|
||||
pub mod vp_ui;
|
||||
pub mod wide_angle_ui;
|
||||
|
||||
#[cfg(test)]
|
||||
mod preference_resize_tests {
|
||||
|
||||
File renamed without changes.
+8
-19
@@ -101,8 +101,7 @@ fn color_balance_dialog() -> (Harness<'static, PhotocraftApp>, u64) {
|
||||
PhotocraftApp::setup_context(&h.ctx, crate::theme::ThemeKind::ALL[0]);
|
||||
let id = open(h.state_mut(), "image.adjustments.colorBalance").unwrap();
|
||||
let d = h.state_mut().ui.dialog_mut(id).unwrap();
|
||||
for (k, v) in
|
||||
[("shadows", json!([10, 0, 0])), ("midtones", json!([40, -30, 20])), ("highlights", json!([0, 0, -15])), ("preserveLuminosity", json!(false))]
|
||||
for (k, v) in [("shadows", json!([10, 0, 0])), ("midtones", json!([40, -30, 20])), ("highlights", json!([0, 0, -15])), ("preserveLuminosity", json!(false))]
|
||||
{
|
||||
d.fields.insert(k.into(), v);
|
||||
}
|
||||
@@ -166,8 +165,7 @@ fn color_balance_dialog_gestures_match_photoshop() {
|
||||
h.run_steps(2);
|
||||
let reset = h.get_by_label("Reset").rect();
|
||||
assert!(h.query_by_label("Cancel").is_none());
|
||||
let click =
|
||||
|pressed| egui::Event::PointerButton { pos: reset.center(), button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::ALT };
|
||||
let click = |pressed| egui::Event::PointerButton { pos: reset.center(), button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::ALT };
|
||||
input(&mut h, egui::Modifiers::ALT, &[egui::Event::PointerMoved(reset.center()), click(true), click(false)]);
|
||||
assert!(h.state().ui.dialogs.iter().any(|d| d.id == id), "Reset keeps the dialog open");
|
||||
for k in ["shadows", "midtones", "highlights"] {
|
||||
@@ -177,8 +175,7 @@ fn color_balance_dialog_gestures_match_photoshop() {
|
||||
assert_eq!(h.ctx.data(|d| d.get_temp::<usize>(tone)), Some(1), "Reset shows Midtones");
|
||||
// Without Alt it is Cancel again, and it closes.
|
||||
let cancel = h.get_by_label("Cancel").rect();
|
||||
let click =
|
||||
|pressed| egui::Event::PointerButton { pos: cancel.center(), button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE };
|
||||
let click = |pressed| egui::Event::PointerButton { pos: cancel.center(), button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE };
|
||||
input(&mut h, egui::Modifiers::NONE, &[egui::Event::PointerMoved(cancel.center()), click(true), click(false)]);
|
||||
assert!(h.state().ui.dialogs.is_empty(), "Cancel closes");
|
||||
}
|
||||
@@ -198,8 +195,7 @@ fn levels_alt_reset_restores_defaults() {
|
||||
h.run_steps(2);
|
||||
let reset = h.get_by_label("Reset").rect();
|
||||
assert!(h.query_by_label("Cancel").is_none());
|
||||
let click =
|
||||
|pressed| egui::Event::PointerButton { pos: reset.center(), button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::ALT };
|
||||
let click = |pressed| egui::Event::PointerButton { pos: reset.center(), button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::ALT };
|
||||
input(&mut h, egui::Modifiers::ALT, &[egui::Event::PointerMoved(reset.center()), click(true), click(false)]);
|
||||
assert!(h.state().ui.dialogs.iter().any(|d| d.id == id), "Reset keeps the dialog open");
|
||||
let defaults =
|
||||
@@ -335,8 +331,7 @@ fn curves_graph_never_pushes_the_dialog_off_a_short_window() {
|
||||
|
||||
#[test]
|
||||
fn cancel_leaves_the_document_untouched() {
|
||||
let mut harness =
|
||||
Harness::builder().with_size(egui::vec2(1200.0, 900.0)).build_ui_state(|ui, app| crate::dialogs::show(app, ui.ctx()), app_with_image());
|
||||
let mut harness = Harness::builder().with_size(egui::vec2(1200.0, 900.0)).build_ui_state(|ui, app| crate::dialogs::show(app, ui.ctx()), app_with_image());
|
||||
PhotocraftApp::setup_context(&harness.ctx, crate::theme::ThemeKind::ALL[0]);
|
||||
let id = open(harness.state_mut(), "image.adjustments.curves").unwrap();
|
||||
harness.run_steps(2);
|
||||
@@ -589,18 +584,13 @@ fn curves_picker_modes_and_depths_are_explicit() {
|
||||
assert!((neutral_anchor[1] - serialized_target_level).abs() < 1e-5, "depth={depth} anchor={neutral_anchor:?} sampled={sampled:?}");
|
||||
assert!((neutral_anchor[0] - sample_level).abs() <= 0.0051, "depth={depth} anchor={neutral_anchor:?} sampled={}", sampled[0]);
|
||||
if depth == 16 || depth == 32 {
|
||||
assert!(
|
||||
(sampled[0] * 255.0 - (sampled[0] * 255.0).round()).abs() > 0.01,
|
||||
"depth={depth} sample was quantized to an 8-bit level: {}",
|
||||
sampled[0]
|
||||
);
|
||||
assert!((sampled[0] * 255.0 - (sampled[0] * 255.0).round()).abs() > 0.01, "depth={depth} sample was quantized to an 8-bit level: {}", sampled[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn pointer_down(app: &mut PhotocraftApp, ctx: &egui::Context, x: f64, y: f64, modifiers: Value) {
|
||||
let (request, _receiver) =
|
||||
crate::control::ControlRequest::new("ui.pointer", json!({"events": [{"kind": "down", "x": x, "y": y}], "modifiers": modifiers}));
|
||||
let (request, _receiver) = crate::control::ControlRequest::new("ui.pointer", json!({"events": [{"kind": "down", "x": x, "y": y}], "modifiers": modifiers}));
|
||||
let _ = crate::control::handle(app, ctx, &request);
|
||||
}
|
||||
|
||||
@@ -697,8 +687,7 @@ fn command_click_adds_nothing_without_the_modifier_on_a_full_curve_or_with_an_ey
|
||||
}
|
||||
|
||||
// Sixteen points (the most a curve holds), none within reach of level 86.
|
||||
let full: Vec<[f64; 2]> =
|
||||
[0, 10, 20, 30, 40, 50, 60, 70, 80, 100, 120, 140, 160, 180, 200, 255].iter().map(|&i| [f64::from(i), f64::from(i)]).collect();
|
||||
let full: Vec<[f64; 2]> = [0, 10, 20, 30, 40, 50, 60, 70, 80, 100, 120, 140, 160, 180, 200, 255].iter().map(|&i| [f64::from(i), f64::from(i)]).collect();
|
||||
app.ui.dialog_mut(id).unwrap().fields.insert("points".into(), json!(full));
|
||||
pointer_down(&mut app, &ctx, 8.0, 8.0, json!({"command": true}));
|
||||
assert_eq!(channel_points(&app, "points"), full, "a full curve takes no more points and moves none");
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -75,7 +75,7 @@ pub struct CameraRawDialog {
|
||||
pub(crate) full_w: usize,
|
||||
full_h: usize,
|
||||
preview_ppp: f32,
|
||||
pub(crate) detail: super::camera_raw_detail_ui::DetailPreview,
|
||||
pub(crate) detail: crate::camera_raw_detail_ui::DetailPreview,
|
||||
display: std::sync::Arc<photocraft_engine::display_color::CanvasDisplay>,
|
||||
pub(crate) viewport: Option<ERect>,
|
||||
pub(crate) float: bool,
|
||||
@@ -86,7 +86,7 @@ pub struct CameraRawDialog {
|
||||
pub(crate) processed: Vec<[f32; 4]>,
|
||||
pub(crate) lab_transform: std::sync::Arc<photocraft_cms::Transform>,
|
||||
pub(crate) scope_transform: std::sync::Arc<photocraft_cms::Transform>,
|
||||
pub(crate) scope: super::camera_raw_scope_ui::ScopeView,
|
||||
pub(crate) scope: crate::camera_raw_scope_ui::ScopeView,
|
||||
pub(crate) after_histogram: RgbHistogram,
|
||||
pub(crate) preview_revision: u64,
|
||||
histogram_ms: f64,
|
||||
@@ -173,7 +173,7 @@ impl CameraRawDialog {
|
||||
fn image(px: &[[f32; 4]], w: usize, h: usize, display: &photocraft_engine::display_color::CanvasDisplay) -> egui::ColorImage {
|
||||
// Bands copied straight from `px`, converted in parallel (#4682), not a whole copy of the
|
||||
// proxy converted on one thread.
|
||||
super::camera_raw_detail_ui::display_image(Rect::new(0, 0, w as i32, h as i32), display, |r, out| {
|
||||
crate::camera_raw_detail_ui::display_image(Rect::new(0, 0, w as i32, h as i32), display, |r, out| {
|
||||
let start = (r.y0.max(0) as usize).saturating_mul(w);
|
||||
if let Some(src) = px.get(start..start.saturating_add(out.len())) {
|
||||
out.copy_from_slice(src);
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-6
@@ -93,12 +93,7 @@ fn field_and_slider_pick_on_press_and_follow_small_moves() {
|
||||
h.event(egui::Event::PointerMoved(at + vec2(3.0, 0.0)));
|
||||
h.run_steps(1);
|
||||
assert_ne!(color(&h), picked, "a small drag adjusts the pick");
|
||||
h.event(egui::Event::PointerButton {
|
||||
pos: at + vec2(3.0, 0.0),
|
||||
button: egui::PointerButton::Primary,
|
||||
pressed: false,
|
||||
modifiers: egui::Modifiers::NONE,
|
||||
});
|
||||
h.event(egui::Event::PointerButton { pos: at + vec2(3.0, 0.0), button: egui::PointerButton::Primary, pressed: false, modifiers: egui::Modifiers::NONE });
|
||||
h.run_steps(2);
|
||||
// Hue slider: a press near the bottom picks a hue near 0 at once.
|
||||
let before = color(&h);
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-3
@@ -357,9 +357,8 @@ fn export_as_downscales_stroke_only_shapes_and_preview() {
|
||||
for depth in [8, 16, 32] {
|
||||
let mut session = photocraft_engine::Session::new();
|
||||
session.execute("file.new", json!({"width": 1024, "height": 1024, "depth": depth, "background": "transparent"})).unwrap();
|
||||
let id = session.execute("shape.create", json!({"rect": [256, 256, 512, 512], "fill": null, "stroke": {"width": 32}})).unwrap()["layer"]
|
||||
.as_u64()
|
||||
.unwrap();
|
||||
let id =
|
||||
session.execute("shape.create", json!({"rect": [256, 256, 512, 512], "fill": null, "stroke": {"width": 32}})).unwrap()["layer"].as_u64().unwrap();
|
||||
let doc = session.active().unwrap().doc.clone();
|
||||
let fields = Map::from_iter([("format".into(), json!("png")), ("scale".into(), json!(25))]);
|
||||
for limit in [None, Some(128)] {
|
||||
@@ -17,15 +17,15 @@ use crate::theme::Tokens;
|
||||
mod print;
|
||||
mod web;
|
||||
|
||||
use print::{print_body, print_confirm};
|
||||
#[cfg(test)]
|
||||
use print::{drag_print_position, driver_paper_is_wide, print_params, print_preview_image, printer_options, take_turned_page, turn_driver};
|
||||
pub use print::open_print;
|
||||
pub(crate) use print::print_status;
|
||||
use web::{web_body, web_confirm};
|
||||
#[cfg(test)]
|
||||
use web::{advance_preview, download_for_web, WEB_COMMAND, web_frame_document, WebCache, WebProxy};
|
||||
use print::{drag_print_position, driver_paper_is_wide, print_params, print_preview_image, printer_options, take_turned_page, turn_driver};
|
||||
use print::{print_body, print_confirm};
|
||||
pub use web::open_web;
|
||||
#[cfg(test)]
|
||||
use web::{WEB_COMMAND, WebCache, WebProxy, advance_preview, download_for_web, web_frame_document};
|
||||
use web::{web_body, web_confirm};
|
||||
|
||||
fn no_params(p: &Value) -> bool {
|
||||
p.as_object().is_none_or(|o| o.is_empty())
|
||||
File renamed without changes.
@@ -459,10 +459,8 @@ fn the_printable_area_goes_only_with_a_print_to_the_printer() {
|
||||
fn print_dialog_opens_with_the_settings_remembered_from_an_earlier_session() {
|
||||
let (mut app, _) = app();
|
||||
app.session.prefs.edit(|p| {
|
||||
p.dialogs.insert(
|
||||
photocraft_engine::print_cmds::REMEMBERED.into(),
|
||||
json!({"paper": "a5", "scale": 50, "orientation": "landscape", "intent": "perceptual"}),
|
||||
);
|
||||
p.dialogs
|
||||
.insert(photocraft_engine::print_cmds::REMEMBERED.into(), json!({"paper": "a5", "scale": 50, "orientation": "landscape", "intent": "perceptual"}));
|
||||
});
|
||||
let id = open_print(&mut app);
|
||||
let f = &app.ui.dialog_mut(id).unwrap().fields;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-5
@@ -1232,11 +1232,8 @@ fn sweep_params(app: &mut PhotocraftApp, command: &str) -> Vec<(String, Value)>
|
||||
/// Every previewed command with its parameter sets.
|
||||
fn previewed_cases() -> Vec<(&'static str, String, Value)> {
|
||||
let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), Default::default());
|
||||
let ids: Vec<&'static str> = photocraft_engine::command_specs()
|
||||
.iter()
|
||||
.map(|c| c.id)
|
||||
.filter(|id| has_dialog(id) && (id.starts_with("filter.") || PREVIEWED.contains(id)))
|
||||
.collect();
|
||||
let ids: Vec<&'static str> =
|
||||
photocraft_engine::command_specs().iter().map(|c| c.id).filter(|id| has_dialog(id) && (id.starts_with("filter.") || PREVIEWED.contains(id))).collect();
|
||||
ids.into_iter().flat_map(|id| sweep_params(&mut app, id).into_iter().map(move |(label, p)| (id, label, p))).collect()
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-2
@@ -431,8 +431,7 @@ fn blending_page_renders_for_every_mode_and_odd_fields() {
|
||||
let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), Default::default());
|
||||
let mut layer = photocraft_doc::Layer::new("L", photocraft_doc::LayerContent::Adjustment(photocraft_doc::Adjustment::Invert));
|
||||
layer.advanced.knockout = photocraft_doc::Knockout::Deep;
|
||||
for mode in
|
||||
[photocraft_color::ColorMode::Rgb, photocraft_color::ColorMode::Cmyk, photocraft_color::ColorMode::Lab, photocraft_color::ColorMode::Grayscale]
|
||||
for mode in [photocraft_color::ColorMode::Rgb, photocraft_color::ColorMode::Cmyk, photocraft_color::ColorMode::Lab, photocraft_color::ColorMode::Grayscale]
|
||||
{
|
||||
let mut f = initial_fields(&layer, Some(BLENDING), 120.0);
|
||||
set_blending_fields(&mut f, &layer, mode);
|
||||
File renamed without changes.
+4
-8
@@ -210,8 +210,7 @@ fn dialog_strokes_match_the_engine_and_commit_once() {
|
||||
pointer(&mut app, ev, egui::Modifiers::NONE);
|
||||
}
|
||||
control(&mut app, &json!({"tool": "bloat"})).unwrap();
|
||||
for ev in [ToolEvent::Down { x: 80.0, y: 40.0, pressure: 1.0 }, ToolEvent::Move { x: 80.0, y: 40.0, pressure: 1.0 }, ToolEvent::Up { x: 80.0, y: 40.0 }]
|
||||
{
|
||||
for ev in [ToolEvent::Down { x: 80.0, y: 40.0, pressure: 1.0 }, ToolEvent::Move { x: 80.0, y: 40.0, pressure: 1.0 }, ToolEvent::Up { x: 80.0, y: 40.0 }] {
|
||||
pointer(&mut app, ev, egui::Modifiers::NONE);
|
||||
}
|
||||
let d = app.distort.liquify.as_ref().unwrap();
|
||||
@@ -269,8 +268,7 @@ fn undo_dirties_the_zoomed_preview() {
|
||||
let mut app = app_with_layer();
|
||||
open(&mut app, &ctx).unwrap();
|
||||
control(&mut app, &json!({"tool": "forwardWarp", "size": 40})).unwrap();
|
||||
for ev in [ToolEvent::Down { x: 35.0, y: 40.0, pressure: 1.0 }, ToolEvent::Move { x: 55.0, y: 40.0, pressure: 1.0 }, ToolEvent::Up { x: 55.0, y: 40.0 }]
|
||||
{
|
||||
for ev in [ToolEvent::Down { x: 35.0, y: 40.0, pressure: 1.0 }, ToolEvent::Move { x: 55.0, y: 40.0, pressure: 1.0 }, ToolEvent::Up { x: 55.0, y: 40.0 }] {
|
||||
pointer(&mut app, ev, egui::Modifiers::NONE);
|
||||
}
|
||||
{
|
||||
@@ -431,8 +429,7 @@ fn shortcut_handler_undoes_liquify_even_when_egui_owns_keyboard_focus() {
|
||||
let ctx = egui::Context::default();
|
||||
let mut app = app_with_layer();
|
||||
open(&mut app, &ctx).unwrap();
|
||||
for ev in [ToolEvent::Down { x: 40.0, y: 40.0, pressure: 1.0 }, ToolEvent::Move { x: 52.0, y: 40.0, pressure: 1.0 }, ToolEvent::Up { x: 52.0, y: 40.0 }]
|
||||
{
|
||||
for ev in [ToolEvent::Down { x: 40.0, y: 40.0, pressure: 1.0 }, ToolEvent::Move { x: 52.0, y: 40.0, pressure: 1.0 }, ToolEvent::Up { x: 52.0, y: 40.0 }] {
|
||||
pointer(&mut app, ev, egui::Modifiers::NONE);
|
||||
}
|
||||
assert_eq!(app.distort.liquify.as_ref().unwrap().strokes.len(), 1);
|
||||
@@ -472,8 +469,7 @@ fn liquify_undo_and_redo_work_while_a_numeric_field_is_focused() {
|
||||
let ctx = egui::Context::default();
|
||||
let mut app = app_with_layer();
|
||||
open(&mut app, &ctx).unwrap();
|
||||
for ev in [ToolEvent::Down { x: 40.0, y: 40.0, pressure: 1.0 }, ToolEvent::Move { x: 52.0, y: 40.0, pressure: 1.0 }, ToolEvent::Up { x: 52.0, y: 40.0 }]
|
||||
{
|
||||
for ev in [ToolEvent::Down { x: 40.0, y: 40.0, pressure: 1.0 }, ToolEvent::Move { x: 52.0, y: 40.0, pressure: 1.0 }, ToolEvent::Up { x: 52.0, y: 40.0 }] {
|
||||
pointer(&mut app, ev, egui::Modifiers::NONE);
|
||||
}
|
||||
let strokes = |app: &PhotocraftApp| app.distort.liquify.as_ref().unwrap().strokes.len();
|
||||
File renamed without changes.
File renamed without changes.
+3
-8
@@ -10,10 +10,7 @@ fn color_profile_menu_lists_the_profiles_of_the_modes_space() {
|
||||
InstalledProfile { path: "panel.icc".into(), description: "Panel".into(), class: ProfileClass::Display, color_space: ColorSpace::Rgb },
|
||||
];
|
||||
let values = |mode: &str| {
|
||||
profile_options(color_mode_of(mode).map(photocraft_engine::color_cmds::mode_space), "sRGB", &installed)
|
||||
.into_iter()
|
||||
.map(|(v, _)| v)
|
||||
.collect::<Vec<_>>()
|
||||
profile_options(color_mode_of(mode).map(photocraft_engine::color_cmds::mode_space), "sRGB", &installed).into_iter().map(|(v, _)| v).collect::<Vec<_>>()
|
||||
};
|
||||
let rgb = values("rgb");
|
||||
assert_eq!(rgb[0], "working");
|
||||
@@ -469,10 +466,8 @@ mod dialog {
|
||||
|
||||
fn harness() -> Harness<'static, PhotocraftApp> {
|
||||
let app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default());
|
||||
let mut h = Harness::builder()
|
||||
.with_size(egui::vec2(1400.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(|ui, app| crate::dialogs::show(app, ui.ctx()), app);
|
||||
let mut h =
|
||||
Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 60.0).build_ui_state(|ui, app| crate::dialogs::show(app, ui.ctx()), app);
|
||||
PhotocraftApp::setup_context(&h.ctx, crate::theme::ThemeKind::ALL[0]);
|
||||
h.state_mut().ui.open_dialog(DialogKind::NewDocument, UiState::new_document_fields());
|
||||
h.run_steps(3);
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 125 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user