mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-09-22 13:01:05 +03:00
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
20 lines
611 B
Objective-C
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.];
|
|
}
|