Bug 1903508 - Part 2: Implement nsLookAndFeel::GetKeyboardLayoutImpl() for the windows platform. r=win-reviewers,gstoll

Differential Revision: https://phabricator.services.mozilla.com/D215071
This commit is contained in:
Tim Huang 2024-07-03 20:08:32 +00:00
Родитель 907cde80ec
Коммит 63a951e9fb
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -878,6 +878,16 @@ auto nsLookAndFeel::ComputeTitlebarColors() -> TitlebarColors {
return result;
}
nsresult nsLookAndFeel::GetKeyboardLayoutImpl(nsACString& aLayout) {
char layout[KL_NAMELENGTH];
if (!::GetKeyboardLayoutNameA(layout)) {
return NS_ERROR_NOT_AVAILABLE;
}
aLayout.Assign(layout);
return NS_OK;
}
void nsLookAndFeel::EnsureInit() {
if (mInitialized) {
return;

Просмотреть файл

@ -62,6 +62,8 @@ class nsLookAndFeel final : public nsXPLookAndFeel {
gfxFontStyle& aFontStyle) override;
char16_t GetPasswordCharacterImpl() override;
nsresult GetKeyboardLayoutImpl(nsACString& aLayout) override;
private:
struct TitlebarColors {
// NOTE: These are the DWM accent colors, which might not match the