mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 10:51:22 +00:00
Design: every offer verb has a hint, shown on hover — and the status line wraps
Mirror of snaporca 2b3e890165 (DesignPanel.cpp applied as a patch; parity 30 / 16, shared files byte-identical). All 86 verbs now carry a hint: 55 extracted from the C++ tool definitions so the offer and the armed-tool hint cannot drift, 31 written by hand. One wxEVT_MENU_HIGHLIGHT binding shows the hovered verb's hint in the status line. The generator asserts that no wired verb lacks one. Also: all 200 status writes go through set_status(), which wraps instead of clipping at the panel edge; and the empty-document hint is called from on_tab_shown() as well, since after_tree_edit() never runs on a freshly opened tab. Verified on the rig. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LyRwbuq6fjn3VV9U9UvhBM
This commit is contained in:
co-authored by
Claude Opus 5
parent
3037e55f44
commit
96816f725c
@@ -93,6 +93,7 @@ def main():
|
||||
" // grouping instead of flattening 19 create tools into one wall.",
|
||||
" const char* family;",
|
||||
" const char* icon; // resources/images name, or nullptr — the offer draws it beside the row",
|
||||
" const char* hint; // what the verb does / what to click; shown on hover",
|
||||
"};",
|
||||
"",
|
||||
"// Row labels, in ratified order.",
|
||||
@@ -106,19 +107,23 @@ def main():
|
||||
"",
|
||||
"static const OfferVerb kOfferVerbs[] = {",
|
||||
]
|
||||
# A verb the user can PICK must say what it does. Fail loudly rather than ship a
|
||||
# bare name — the offer is now the only door to these tools.
|
||||
blind = [v["id"] for v in A["verbs"] if v.get("action") and not v.get("hint")]
|
||||
assert not blind, f"wired verbs with no hint: {blind}"
|
||||
for v in A["verbs"]:
|
||||
mask = 0
|
||||
for a in v["accepts"]:
|
||||
mask |= 1 << sels.index(a)
|
||||
n = v.get("needs") or {}
|
||||
lines.append(
|
||||
" {%s, %s, %d, %s, %s, %s, 0x%08xu, %d, %d, %s, %s, %s, %s}," % (
|
||||
" {%s, %s, %d, %s, %s, %s, 0x%08xu, %d, %d, %s, %s, %s, %s, %s}," % (
|
||||
cstr(v["id"]), cstr(v["name"]), slots.index(v["slot"]),
|
||||
cstr(v.get("key")), cstr(v.get("action")), cstr(v.get("refusal")),
|
||||
mask, n.get("bodies", 0), n.get("sketches", 0),
|
||||
"true" if n.get("sheet") else "false",
|
||||
"true" if v.get("mode") == "sketch" else "false",
|
||||
cstr(v.get("family")), cstr(v.get("icon"))))
|
||||
cstr(v.get("family")), cstr(v.get("icon")), cstr(v.get("hint"))))
|
||||
lines += [
|
||||
"};",
|
||||
f"static const int kOfferVerbCount = {len(A['verbs'])};",
|
||||
|
||||
Reference in New Issue
Block a user