From 5651d2547261ccecbf50f8141c634f59c0adc00d Mon Sep 17 00:00:00 2001 From: Dean Dettman Date: Tue, 20 Oct 2009 11:13:02 +0200 Subject: Adds Key_Back and Key_Forward menu glyphs on mac(carbon) This change improves the behavior of QMenu when Key_Back and Key_Forward are used as shortcuts. A dotted arrow appears on carbon, and on Cocoa the image is blank, instead of undefined as it was before. Task-number: QTBUG-4873 Reviewed-by: msorvig --- src/gui/widgets/qmenu_mac.mm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gui') diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 354161da9e..a7f6f0d47f 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -572,6 +572,10 @@ static void qt_mac_get_accel(quint32 accel_key, quint32 *modif, quint32 *key) { *key = kMenuNorthwestArrowGlyph; else if (accel_key == Qt::Key_End) *key = kMenuSoutheastArrowGlyph; + else if (accel_key == Qt::Key_Back) + *key = kMenuLeftArrowDashedGlyph; + else if (accel_key == Qt::Key_Forward) + *key = kMenuRightArrowDashedGlyph; } } #else // Cocoa @@ -1239,6 +1243,10 @@ NSString *keySequenceToKeyEqivalent(const QKeySequence &accel) keyEquiv[0] = NSHomeFunctionKey; else if (accel_key == Qt::Key_End) keyEquiv[0] = NSEndFunctionKey; + else if (accel_key == Qt::Key_Back) + keyEquiv[0] = kMenuLeftArrowDashedGlyph; // ### Cocoa has no equivalent - no icon is displayed + else if (accel_key == Qt::Key_Forward) + keyEquiv[0] = kMenuRightArrowDashedGlyph; // ### Cocoa has no equivalent - no icon is displayed else keyEquiv[0] = unichar(QChar(accel_key).toLower().unicode()); return [NSString stringWithCharacters:keyEquiv length:1]; -- cgit v1.2.3