macOS: add "Toggle printing of titlebar" to application menu - cont'd.

This commit is contained in:
ManoloFLTK 2022-02-02 11:19:09 +01:00
parent 935074ba0b
commit 895ac51c69
3 changed files with 5 additions and 5 deletions

View File

@ -143,7 +143,7 @@ public:
This menu item and next one won't be displayed if Fl_Mac_App_Menu::print
is set to an empty string.
*/
static const char *print_with_titlebar;
static const char *print;
/** Localizable text for the "Print Front Window" application menu item. */
static const char *print_no_titlebar;
/** Localizable text for the "Toggle print titlebar" application menu item. */

View File

@ -74,7 +74,7 @@ Fl_MacOS_Sys_Menu_Bar_Driver* Fl_MacOS_Sys_Menu_Bar_Driver::driver() {
// Apple App Menu
const char *Fl_Mac_App_Menu::about = "About %@";
const char *Fl_Mac_App_Menu::print_with_titlebar = "Print Front Window & Titlebar";
const char *Fl_Mac_App_Menu::print = "Print Front Window & Titlebar";
const char *Fl_Mac_App_Menu::print_no_titlebar = "Print Front Window";
const char *Fl_Mac_App_Menu::toggle_print_titlebar = "Toggle printing of titlebar";
const char *Fl_Mac_App_Menu::services = "Services";
@ -506,7 +506,7 @@ void Fl_Mac_App_Menu::custom_application_menu_items(const Fl_Menu_Item *m)
NSInteger to_index;
if ([[menu itemAtIndex:2] action] != @selector(printPanel)) { // the 'Print' item was removed
[menu insertItem:[NSMenuItem separatorItem] atIndex:1];
to_index = 3;
to_index = 2;
} else to_index = 4; // after the "Print Front Window/Toggle" items
NSInteger count = [menu numberOfItems];
createSubMenu(menu, m, NULL, @selector(customCallback)); // add new items at end of application menu

View File

@ -3916,7 +3916,7 @@ int Fl_Cocoa_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int
title = Fl_Mac_App_Menu::print_no_titlebar;
} else {
[self setState:NSOnState];
title = Fl_Mac_App_Menu::print_with_titlebar;
title = Fl_Mac_App_Menu::print;
}
[item setTitle:NSLocalizedString([NSString stringWithUTF8String:title], nil)];
}
@ -4022,7 +4022,7 @@ static void createAppleMenu(void)
[menuItem setTarget:about];
[appleMenu addItem:[NSMenuItem separatorItem]];
// Print front window
title = NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::print_with_titlebar], nil);
title = NSLocalizedString([NSString stringWithUTF8String:Fl_Mac_App_Menu::print], nil);
if ([title length] > 0) {
menuItem = [appleMenu
addItemWithTitle:title