mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-21 09:26:43 +00:00
refactor(ui-egui): move menus modules under menus/
This commit is contained in:
1 parent
b6afd0953d
commit
086bdba303
18 files changed
+24
-32
No files matched your search
@@ -42,7 +42,6 @@ pub mod direct_select;
|
||||
pub mod direction;
|
||||
pub mod dock;
|
||||
pub mod egui_fonts;
|
||||
pub mod enable_rules;
|
||||
pub mod eraser_ui;
|
||||
pub mod eyedropper_ui;
|
||||
pub mod field_tab;
|
||||
@@ -66,8 +65,6 @@ mod layout_keys;
|
||||
pub mod links;
|
||||
pub mod magnetic_lasso_ui;
|
||||
pub mod menu_catalog;
|
||||
pub mod menu_keys;
|
||||
pub mod menu_nav;
|
||||
pub mod menus;
|
||||
pub mod monitor_status;
|
||||
pub mod move_box;
|
||||
@@ -75,7 +72,6 @@ pub mod move_distance;
|
||||
pub mod move_hover;
|
||||
pub mod move_lock;
|
||||
pub mod move_mods;
|
||||
pub mod native_menu;
|
||||
pub mod notices;
|
||||
pub mod nudge_bundle;
|
||||
mod numeric_expression;
|
||||
@@ -83,10 +79,8 @@ pub mod object_finder;
|
||||
mod opacity_keys;
|
||||
mod page_keys;
|
||||
pub mod panels;
|
||||
pub mod parity;
|
||||
pub mod perspective_crop_ui;
|
||||
pub mod perspective_ui;
|
||||
pub mod plugin_ui;
|
||||
pub mod point_curve;
|
||||
pub mod prefs_ui;
|
||||
pub mod preset_files_ui;
|
||||
@@ -132,11 +126,9 @@ pub mod type_tool;
|
||||
mod type_transform;
|
||||
pub mod updates_ui;
|
||||
pub mod vector_ui;
|
||||
pub mod view_cmds;
|
||||
pub mod warp_preview;
|
||||
pub mod widgets;
|
||||
pub mod work_area;
|
||||
pub mod workspace_ui;
|
||||
pub mod zoom_tool;
|
||||
|
||||
use std::collections::HashMap;
|
||||
@@ -251,6 +243,14 @@ pub use dialogs::targa_options_ui;
|
||||
pub use dialogs::tiff_options_ui;
|
||||
pub use dialogs::vp_ui;
|
||||
pub use dialogs::wide_angle_ui;
|
||||
pub use menus::enable_rules;
|
||||
pub use menus::menu_keys;
|
||||
pub use menus::menu_nav;
|
||||
pub use menus::native_menu;
|
||||
pub use menus::parity;
|
||||
pub use menus::plugin_ui;
|
||||
pub use menus::view_cmds;
|
||||
pub use menus::workspace_ui;
|
||||
pub use panels::actions;
|
||||
pub use panels::adjust_ui;
|
||||
pub use panels::apply_color;
|
||||
|
||||
@@ -6,29 +6,37 @@ use crate::PhotocraftApp;
|
||||
use crate::state::DialogKind;
|
||||
|
||||
mod bar;
|
||||
pub mod enable_rules;
|
||||
mod invoke;
|
||||
mod items;
|
||||
pub mod menu_keys;
|
||||
pub mod menu_nav;
|
||||
pub mod native_menu;
|
||||
pub mod parity;
|
||||
pub mod plugin_ui;
|
||||
mod render;
|
||||
mod search;
|
||||
mod state;
|
||||
pub mod view_cmds;
|
||||
pub mod workspace_ui;
|
||||
|
||||
pub use bar::menu_bar;
|
||||
#[cfg(test)]
|
||||
use bar::pointer_reaches_title;
|
||||
pub use bar::menu_bar;
|
||||
pub use invoke::{apply_workspace, invoke};
|
||||
pub(crate) use invoke::{invoke_unguarded, panel_alias};
|
||||
pub use items::{is_live, menu_items, MenuItem};
|
||||
pub(crate) use items::ItemCache;
|
||||
pub use items::{MenuItem, is_live, menu_items};
|
||||
pub use render::alt_click;
|
||||
#[cfg(test)]
|
||||
use render::submenu_enabled;
|
||||
pub use render::alt_click;
|
||||
#[cfg(test)]
|
||||
use search::HELP_SEARCH_MAX;
|
||||
pub use search::{search_items, search_rank};
|
||||
#[cfg(test)]
|
||||
use state::{checked, translated_menu_label};
|
||||
pub use state::is_enabled;
|
||||
pub(crate) use state::reveal_label;
|
||||
#[cfg(test)]
|
||||
use state::{checked, translated_menu_label};
|
||||
|
||||
/// Shared gate for native menu clicks and control-channel `ui.menu.invoke`.
|
||||
/// Dialogs and unsaved-changes prompts block edits, but allow the four view-navigation
|
||||
|
||||
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
-18
@@ -33,21 +33,7 @@ fn photocraft_gets_a_mac_app_menu() {
|
||||
assert_eq!((app.title.as_str(), app.role), ("PhotoCraft", MenuRole::App));
|
||||
assert_eq!(
|
||||
ids(&app.children),
|
||||
[
|
||||
"help.about",
|
||||
"---",
|
||||
"[Settings]",
|
||||
"[Language]",
|
||||
"[Appearance]",
|
||||
"---",
|
||||
"<Services>",
|
||||
"---",
|
||||
HIDE,
|
||||
"<HideOthers>",
|
||||
"<ShowAll>",
|
||||
"---",
|
||||
"file.exit"
|
||||
]
|
||||
["help.about", "---", "[Settings]", "[Language]", "[Appearance]", "---", "<Services>", "---", HIDE, "<HideOthers>", "<ShowAll>", "---", "file.exit"]
|
||||
);
|
||||
let quit = l.bar.find("file.exit").unwrap();
|
||||
assert_eq!((quit.label.as_str(), quit.shortcut.as_deref()), ("Quit PhotoCraft", Some("Cmd+Q")));
|
||||
@@ -379,9 +365,7 @@ fn cut_selected_type_from_native_menu_matches_keyboard_cut() {
|
||||
});
|
||||
out.textures_delta.clear();
|
||||
assert_eq!(out.platform_output.commands, [egui::OutputCommand::CopyText("Hello".into())]);
|
||||
let photocraft_doc::LayerContent::Text(text) = &app.session.active().unwrap().doc.layer(id).unwrap().content else {
|
||||
panic!("type layer changed kind")
|
||||
};
|
||||
let photocraft_doc::LayerContent::Text(text) = &app.session.active().unwrap().doc.layer(id).unwrap().content else { panic!("type layer changed kind") };
|
||||
assert!(text.text.is_empty());
|
||||
let edit = app.ui.text_edit.as_ref().unwrap();
|
||||
assert_eq!((edit.anchor, edit.caret), (0, 0));
|
||||
File renamed without changes.
File renamed without changes.
@@ -20,10 +20,10 @@ mod options;
|
||||
|
||||
pub use arrange::cells;
|
||||
pub(crate) use arrange::float_window;
|
||||
pub(crate) use dialogs::write_copy;
|
||||
#[cfg(test)]
|
||||
use dialogs::{form, front, label_of};
|
||||
pub use dialogs::{form_body, form_keys, reset_form};
|
||||
pub(crate) use dialogs::write_copy;
|
||||
#[cfg(test)]
|
||||
use dispatch::is_enabled_with_engine;
|
||||
pub use dispatch::{checked, handles, invoke, is_enabled};
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user