mirror of https://github.com/PCSX2/pcsx2.git
MacOS: Mark our help menu as the macOS help menu
This gives it a nice search box for searching other menus
This commit is contained in:
parent
23c495b939
commit
417e86c825
|
@ -19,6 +19,8 @@ namespace CocoaTools
|
||||||
void AddThemeChangeHandler(void* ctx, void(handler)(void* ctx));
|
void AddThemeChangeHandler(void* ctx, void(handler)(void* ctx));
|
||||||
/// Remove a handler previously added using AddThemeChangeHandler with the given context
|
/// Remove a handler previously added using AddThemeChangeHandler with the given context
|
||||||
void RemoveThemeChangeHandler(void* ctx);
|
void RemoveThemeChangeHandler(void* ctx);
|
||||||
|
/// Mark an NSMenu as the help menu
|
||||||
|
void MarkHelpMenu(void* menu);
|
||||||
/// Returns the bundle path.
|
/// Returns the bundle path.
|
||||||
std::optional<std::string> GetBundlePath();
|
std::optional<std::string> GetBundlePath();
|
||||||
/// Get the bundle path to the actual application without any translocation fun
|
/// Get the bundle path to the actual application without any translocation fun
|
||||||
|
|
|
@ -143,6 +143,11 @@ void CocoaTools::RemoveThemeChangeHandler(void* ctx)
|
||||||
[s_themeChangeHandler removeCallback:ctx];
|
[s_themeChangeHandler removeCallback:ctx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CocoaTools::MarkHelpMenu(void* menu)
|
||||||
|
{
|
||||||
|
[NSApp setHelpMenu:(__bridge NSMenu*)menu];
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Sound playback
|
// MARK: - Sound playback
|
||||||
|
|
||||||
bool Common::PlaySoundAsync(const char* path)
|
bool Common::PlaySoundAsync(const char* path)
|
||||||
|
|
|
@ -151,6 +151,10 @@ void MainWindow::initialize()
|
||||||
ctx->updateTheme(); // Qt won't notice the style change without us touching the palette in some way
|
ctx->updateTheme(); // Qt won't notice the style change without us touching the palette in some way
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// The cocoa backing isn't initialized yet, delay this until stuff is set up with a `RunOnUIThread` call
|
||||||
|
QtHost::RunOnUIThread([this]{
|
||||||
|
CocoaTools::MarkHelpMenu(m_ui.menuHelp->toNSMenu());
|
||||||
|
});
|
||||||
#endif
|
#endif
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
setupAdditionalUi();
|
setupAdditionalUi();
|
||||||
|
|
Loading…
Reference in New Issue