Design: the offer draws each verb's icon — set the bitmap BEFORE Append, not after

Mirror of snaporca bcab67f8ce (DesignPanel.cpp applied as a patch; parity 30 / 16, shared
files byte-identical).

tool_atlas.json now names an icon for 80 of 86 verbs, derived from the toolbar's own
definitions rather than invented, and every one of the 54 distinct names was checked to
exist in resources/images first.

The first attempt drew nothing despite a green build: wxGTK builds the GtkMenuItem inside
Append() and reads GetBitmap() there, so setting the bitmap on the returned item is a
silent no-op. append_offer_item() constructs, sets, then appends — the same order Orca's
own append_menu_item() uses.

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:
Tommaso Bianchi
2026-08-01 17:55:52 +02:00
co-authored by Claude Opus 5
parent bc4fb3b680
commit a535b0cb76
5 changed files with 290 additions and 176 deletions
+4
View File
@@ -622,6 +622,10 @@ private:
// DesignOffer.hpp; this map is how a row reaches the code that already implements it, for
// the verbs that have no keyboard shortcut to route through.
std::map<std::string, std::function<void()>> m_verb_actions;
// Append an offer row with its toolbar glyph. The bitmap must be set BEFORE Append —
// wxGTK builds the GtkMenuItem there and only makes an image item if one is present.
wxMenuItem* append_offer_item(wxMenu* menu, int id, const wxString& text,
const struct OfferVerb& v);
void show_offer_menu(const wxPoint& screen_pos);
// Where the offer opens when no mouse press anchors it: the keyboard route, and the automatic
// open on entering Sketch. The pointer if it is over the viewport, else the viewport's centre.