mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-25 23:37:05 +00:00
Fix combobox widget: fire Change signal when the combobox is selected with the keyboard
This commit is contained in:
parent
44d3e228fd
commit
7253fa59c5
@ -454,14 +454,9 @@ bool ComboBoxListBox::onProcessMessage(Message* msg)
|
|||||||
{
|
{
|
||||||
switch (msg->type()) {
|
switch (msg->type()) {
|
||||||
|
|
||||||
case kMouseUpMessage: {
|
case kMouseUpMessage:
|
||||||
int index = m_comboBox->getSelectedItemIndex();
|
|
||||||
if (isValidItem(index))
|
|
||||||
m_comboBox->onChange();
|
|
||||||
|
|
||||||
m_comboBox->closeListBox();
|
m_comboBox->closeListBox();
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
case kKeyDownMessage:
|
case kKeyDownMessage:
|
||||||
if (hasFocus()) {
|
if (hasFocus()) {
|
||||||
@ -486,8 +481,10 @@ void ComboBoxListBox::onChangeSelectedItem()
|
|||||||
ListBox::onChangeSelectedItem();
|
ListBox::onChangeSelectedItem();
|
||||||
|
|
||||||
int index = getSelectedIndex();
|
int index = getSelectedIndex();
|
||||||
if (isValidItem(index))
|
if (isValidItem(index)) {
|
||||||
m_comboBox->setSelectedItemIndex(index);
|
m_comboBox->setSelectedItemIndex(index);
|
||||||
|
m_comboBox->onChange();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// When the mouse is clicked we switch the visibility-status of the list-box
|
// When the mouse is clicked we switch the visibility-status of the list-box
|
||||||
|
Loading…
x
Reference in New Issue
Block a user