summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorDean Dettman <dean.dettman@nokia.com>2009-10-20 11:13:02 +0200
committerDean Dettman <dean.dettman@nokia.com>2009-10-20 11:13:02 +0200
commit5651d2547261ccecbf50f8141c634f59c0adc00d (patch)
tree51ec1203eadc573a5003f183bfbace1737fc9363 /src/gui/widgets
parent0baa15e68c7b2e009c1f81f81148939725c216c8 (diff)
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/gui/widgets')
-rw-r--r--src/gui/widgets/qmenu_mac.mm8
1 files changed, 8 insertions, 0 deletions
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];