macOS: add "Toggle printing of titlebar" to application menu - cont'd.
This commit is contained in:
parent
935074ba0b
commit
895ac51c69
2
FL/mac.H
2
FL/mac.H
@ -143,7 +143,7 @@ public:
|
|||||||
This menu item and next one won't be displayed if Fl_Mac_App_Menu::print
|
This menu item and next one won't be displayed if Fl_Mac_App_Menu::print
|
||||||
is set to an empty string.
|
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. */
|
/** Localizable text for the "Print Front Window" application menu item. */
|
||||||
static const char *print_no_titlebar;
|
static const char *print_no_titlebar;
|
||||||
/** Localizable text for the "Toggle print titlebar" application menu item. */
|
/** Localizable text for the "Toggle print titlebar" application menu item. */
|
||||||
|
@ -74,7 +74,7 @@ Fl_MacOS_Sys_Menu_Bar_Driver* Fl_MacOS_Sys_Menu_Bar_Driver::driver() {
|
|||||||
|
|
||||||
// Apple App Menu
|
// Apple App Menu
|
||||||
const char *Fl_Mac_App_Menu::about = "About %@";
|
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::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::toggle_print_titlebar = "Toggle printing of titlebar";
|
||||||
const char *Fl_Mac_App_Menu::services = "Services";
|
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;
|
NSInteger to_index;
|
||||||
if ([[menu itemAtIndex:2] action] != @selector(printPanel)) { // the 'Print' item was removed
|
if ([[menu itemAtIndex:2] action] != @selector(printPanel)) { // the 'Print' item was removed
|
||||||
[menu insertItem:[NSMenuItem separatorItem] atIndex:1];
|
[menu insertItem:[NSMenuItem separatorItem] atIndex:1];
|
||||||
to_index = 3;
|
to_index = 2;
|
||||||
} else to_index = 4; // after the "Print Front Window/Toggle" items
|
} else to_index = 4; // after the "Print Front Window/Toggle" items
|
||||||
NSInteger count = [menu numberOfItems];
|
NSInteger count = [menu numberOfItems];
|
||||||
createSubMenu(menu, m, NULL, @selector(customCallback)); // add new items at end of application menu
|
createSubMenu(menu, m, NULL, @selector(customCallback)); // add new items at end of application menu
|
||||||
|
@ -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;
|
title = Fl_Mac_App_Menu::print_no_titlebar;
|
||||||
} else {
|
} else {
|
||||||
[self setState:NSOnState];
|
[self setState:NSOnState];
|
||||||
title = Fl_Mac_App_Menu::print_with_titlebar;
|
title = Fl_Mac_App_Menu::print;
|
||||||
}
|
}
|
||||||
[item setTitle:NSLocalizedString([NSString stringWithUTF8String:title], nil)];
|
[item setTitle:NSLocalizedString([NSString stringWithUTF8String:title], nil)];
|
||||||
}
|
}
|
||||||
@ -4022,7 +4022,7 @@ static void createAppleMenu(void)
|
|||||||
[menuItem setTarget:about];
|
[menuItem setTarget:about];
|
||||||
[appleMenu addItem:[NSMenuItem separatorItem]];
|
[appleMenu addItem:[NSMenuItem separatorItem]];
|
||||||
// Print front window
|
// 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) {
|
if ([title length] > 0) {
|
||||||
menuItem = [appleMenu
|
menuItem = [appleMenu
|
||||||
addItemWithTitle:title
|
addItemWithTitle:title
|
||||||
|
Loading…
Reference in New Issue
Block a user