diff options
author | Dean Dettman <dean.dettman@nokia.com> | 2009-10-20 09:13:02 (GMT) |
---|---|---|
committer | Dean Dettman <dean.dettman@nokia.com> | 2009-10-20 09:13:02 (GMT) |
commit | 5651d2547261ccecbf50f8141c634f59c0adc00d (patch) | |
tree | 51ec1203eadc573a5003f183bfbace1737fc9363 /src | |
parent | 0baa15e68c7b2e009c1f81f81148939725c216c8 (diff) | |
download | Qt-5651d2547261ccecbf50f8141c634f59c0adc00d.zip Qt-5651d2547261ccecbf50f8141c634f59c0adc00d.tar.gz Qt-5651d2547261ccecbf50f8141c634f59c0adc00d.tar.bz2 |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 354161d..a7f6f0d 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]; |