Fix assert in Widget::setMnemonic() for mnemonics like 'Ú'

This fixes the ASSERT((mnemonic & kMnemonicModifiersMask) == 0) in
Widget::setMnemonic() function, but as a future task we should try to
process/convert unicode chars like 'Ú' as a simplified form,
i.e. pressing 'u' should match 'ú' for mnemonics.
This commit is contained in:
David Capello 2024-02-05 20:12:28 -03:00
parent af73adeab0
commit 62599ad8b4

View File

@ -1,5 +1,5 @@
// Aseprite UI Library // Aseprite UI Library
// Copyright (C) 2018-2023 Igara Studio S.A. // Copyright (C) 2018-2024 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello // Copyright (C) 2001-2018 David Capello
// //
// This file is released under the terms of the MIT license. // This file is released under the terms of the MIT license.
@ -468,8 +468,8 @@ namespace ui {
// kMnemonicModifiersMask bit is zero, it means that the mnemonic // kMnemonicModifiersMask bit is zero, it means that the mnemonic
// can be used without Alt or Command key modifiers (useful for // can be used without Alt or Command key modifiers (useful for
// buttons in ui::Alert). // buttons in ui::Alert).
static constexpr int kMnemonicCharMask = 0x7f; static constexpr int kMnemonicCharMask = 0xffff;
static constexpr int kMnemonicModifiersMask = 0x80; static constexpr int kMnemonicModifiersMask = 0x10000;
int m_mnemonic; int m_mnemonic;
// Widget size limits // Widget size limits