mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
fix symbol-font bug
seen here: https://github.com/MagicSetEditorPacks/Full-Magic-Pack/issues/149
This commit is contained in:
@@ -481,13 +481,25 @@ wxMenu* InsertSymbolMenu::makeMenu(int id, SymbolFont& font) const {
|
|||||||
|
|
||||||
wxMenuItem* InsertSymbolMenu::makeMenuItem(wxMenu* parent, int first_id, SymbolFont& font) const {
|
wxMenuItem* InsertSymbolMenu::makeMenuItem(wxMenu* parent, int first_id, SymbolFont& font) const {
|
||||||
String label = this->label.get();
|
String label = this->label.get();
|
||||||
// ensure that there is not actually an accelerator string,
|
// ensure that we are not defining an accelerator...
|
||||||
label.Replace(_("\t "), _("\t"));
|
// everything after a tab is considered to be an accelerator by wxMenuItem
|
||||||
#ifdef __WXMSW__
|
int accel_pos = label.find_last_of('\t');
|
||||||
label.Replace(_("\t"), _("\t ")); // by prepending " "
|
if (accel_pos != label.npos && accel_pos > 0) {
|
||||||
#else
|
String accel = label.substr(accel_pos+1);
|
||||||
label.Replace(_("\t"), _(" ")); // by simply dropping the \t
|
#ifdef __WXMSW__
|
||||||
#endif
|
// if there is a + or - in the accelerator, replace the tab with spaces (simply adding a space does not work)
|
||||||
|
if (accel.Contains("+") || accel.Contains("-")) {
|
||||||
|
label = label.substr(0, accel_pos) + _(" ") + accel;
|
||||||
|
}
|
||||||
|
// otherwise simply add a space after the tab if there isn't one
|
||||||
|
else {
|
||||||
|
label.Replace(_("\t "), _("\t"));
|
||||||
|
label.Replace(_("\t"), _("\t "));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
label = label.substr(0, accel_pos) + _(" ") + accel; // replace the tab with spaces
|
||||||
|
#endif
|
||||||
|
}
|
||||||
if (type == Type::SUBMENU) {
|
if (type == Type::SUBMENU) {
|
||||||
wxMenuItem* item = new wxMenuItem(parent, wxID_ANY, label,
|
wxMenuItem* item = new wxMenuItem(parent, wxID_ANY, label,
|
||||||
wxEmptyString, wxITEM_NORMAL,
|
wxEmptyString, wxITEM_NORMAL,
|
||||||
|
|||||||
Reference in New Issue
Block a user