mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Merge #18587 into the merge queue batch
Match the Type menu submenu separators
This commit is contained in:
commit
fd8039ffa4
2 files changed
+29
No files matched your search
@@ -468,6 +468,7 @@ pub static CATALOG: &[(&[&str], &str, Option<&str>, &str)] = &[
|
||||
(&["Type", "Anti-Alias"], "---", None, "---"),
|
||||
(&["Type", "Anti-Alias"], "Windows LCD", None, "type.antiAlias.windowsLcd"),
|
||||
(&["Type", "Anti-Alias"], "Windows", None, "type.antiAlias.windows"),
|
||||
(&["Type"], "---", None, "---"),
|
||||
(&["Type", "Orientation"], "Horizontal", None, "type.orientation.horizontal"),
|
||||
(&["Type", "Orientation"], "Vertical", None, "type.orientation.vertical"),
|
||||
(&["Type", "OpenType"], "Standard Ligatures", None, "type.openType.standardLigatures"),
|
||||
@@ -524,6 +525,7 @@ pub static CATALOG: &[(&[&str], &str, Option<&str>, &str)] = &[
|
||||
(&["Type", "Font Preview Size"], "Large", None, "type.fontPreviewSize.large"),
|
||||
(&["Type", "Font Preview Size"], "Extra Large", None, "type.fontPreviewSize.extraLarge"),
|
||||
(&["Type", "Font Preview Size"], "Huge", None, "type.fontPreviewSize.huge"),
|
||||
(&["Type"], "---", None, "---"),
|
||||
(&["Type", "Language Options"], "Default Features", None, "type.languageOptions.defaultFeatures"),
|
||||
(&["Type", "Language Options"], "East Asian Features", None, "type.languageOptions.eastAsianFeatures"),
|
||||
(&["Type", "Language Options"], "Middle Eastern Features", None, "type.languageOptions.middleEasternFeatures"),
|
||||
@@ -828,3 +830,7 @@ pub const ARRANGE_ICONS: &[(&str, &str)] = &[
|
||||
("window.arrange.sixUp", "arrange-six-up"),
|
||||
("window.arrange.consolidateAllToTabs", "arrange-consolidate-all-to-tabs"),
|
||||
];
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "menus/type_menu_groups_tests.rs"]
|
||||
mod type_menu_groups_tests;
|
||||
@@ -0,0 +1,23 @@
|
||||
use crate::PhotocraftApp;
|
||||
use craft::menu::{Node, from_items};
|
||||
|
||||
#[test]
|
||||
fn type_submenus_keep_their_reference_groups() {
|
||||
let app = PhotocraftApp::new(photocraft_engine::Session::new(), Default::default());
|
||||
let bar = from_items(&["Type"], &crate::menus::menu_rows(&app));
|
||||
let entries: Vec<_> = bar.menus[0]
|
||||
.children
|
||||
.iter()
|
||||
.map(|node| match node {
|
||||
Node::Separator => "---",
|
||||
Node::Submenu { label, .. } | Node::Heading(label) => label.as_str(),
|
||||
Node::Item(row) => row.command.id.as_str(),
|
||||
_ => "<unknown menu node>",
|
||||
})
|
||||
.collect();
|
||||
assert!(entries.windows(6).any(|rows| rows == ["---", "Anti-Alias", "---", "Orientation", "OpenType", "---"]), "{entries:?}");
|
||||
assert!(entries.windows(6).any(|rows| rows == ["---", "Font Preview Size", "---", "Language Options", "---", "type.updateAllTextLayers"]), "{entries:?}");
|
||||
let warp = entries.iter().position(|entry| *entry == "type.warpText").unwrap();
|
||||
let preview = entries.iter().position(|entry| *entry == "Font Preview Size").unwrap();
|
||||
assert!(warp < preview, "{entries:?}");
|
||||
}
|
||||
Reference in new issue
Block a user