Files
eepp/src/tools/ecode/macos/macos.m
Martín Lucas Golini 9752be89ad Add native macOS global menu bar integration
Mirror UIMenuBar hierarchies into AppKit while keeping eepp menus as the
source of truth.

Add semantic item activation and menu lifecycle hooks so native actions,
lazy menus, checkboxes, radio buttons, visibility, enabled state, and
submenus preserve existing eepp behavior. Support shortcuts and standard
About, Preferences, Quit, Window, Help, and Services menu integration.

Keep the platform adapter private to the UI implementation and support
safe installation, synchronization, and removal of the native menu.

Migrate ecode away from its hand-written Cocoa menu, assign semantic menu
roles, and populate the UI Language submenu synchronously so it is ready
on its first opening.

Add unit tests covering activation, menu lifecycle, roles, and submenu
preparation.

Refs: SpartanJ/ecode#823
2026-08-24 02:38:36 -03:00

20 lines
611 B
Objective-C

#import <AppKit/AppKit.h>
#include <Cocoa/Cocoa.h>
#include "macos.hpp"
void macOS_enableScrollMomentum() {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"AppleMomentumScrollSupported"];
}
void macOS_removeTitleBarSeparator( void* window ) {
NSWindow* nsWindow = window;
[nsWindow setTitlebarSeparatorStyle:NSTitlebarSeparatorStyleNone];
}
void macOS_changeTitleBarColor( void* window, double red, double green, double blue ) {
NSWindow* nsWindow = window;
nsWindow.titlebarAppearsTransparent = YES;
nsWindow.backgroundColor = [NSColor colorWithRed:red green:green blue:blue alpha:1.];
}