aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPWindow.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPWindow.m')
-rw-r--r--Source/SPWindow.m21
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/SPWindow.m b/Source/SPWindow.m
index f4164ef2..492b8779 100644
--- a/Source/SPWindow.m
+++ b/Source/SPWindow.m
@@ -192,13 +192,30 @@
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
-
+
+ // If the item is the Show/Hide Toolbar menu item, override the text to allow correct translation
+ if ([menuItem action] == @selector(toggleToolbarShown:)) {
+ BOOL theResponse = [super validateMenuItem:menuItem];
+ if ([[self toolbar] isVisible] || [menuItem state] == NSOnState) {
+ [menuItem setTitle:NSLocalizedString(@"Hide Toolbar", @"Hide Toolbar menu item")];
+ } else {
+ [menuItem setTitle:NSLocalizedString(@"Show Toolbar", @"Show Toolbar menu item")];
+ }
+ return theResponse;
+ }
+
+ // On systems which don't support fullscreen windows, disable the fullscreen menu item
if ([menuItem action] == @selector(toggleFullScreen:)) {
- return ([super respondsToSelector:@selector(toggleFullScreen:)]);
+ if (![super respondsToSelector:@selector(toggleFullScreen:)]) {
+ return NO;
+ }
}
+
+ // Allow the superclass to perform validation otherwise (if possible)
if ([super respondsToSelector:@selector(validateMenuItem:)]) {
return [super validateMenuItem:menuItem];
}
+
return YES;
}