Enter key selects the preset palette

Also the listbox doesn't lost the focus, so we can continue navigating
preset palettes.
This commit is contained in:
David Capello 2016-11-14 16:04:29 -03:00
parent 9b1f0bf33c
commit a19a834c4d
2 changed files with 4 additions and 1 deletions

View File

@ -5,7 +5,7 @@
<label text="Available Palettes:" /> <label text="Available Palettes:" />
<view id="view" expansive="true" /> <view id="view" expansive="true" />
<hbox> <hbox>
<button id="load_pal" text="&amp;Load" width="80" /> <button id="load_pal" text="&amp;Load" width="80" magnet="true" />
<hbox expansive="true" /> <hbox expansive="true" />
<button id="open_folder" text="Open &amp;Folder" width="60" /> <button id="open_folder" text="Open &amp;Folder" width="60" />
</hbox> </hbox>

View File

@ -34,6 +34,7 @@ PalettePopup::PalettePopup()
{ {
setAutoRemap(false); setAutoRemap(false);
setBorder(gfx::Border(4*guiscale())); setBorder(gfx::Border(4*guiscale()));
setEnterBehavior(EnterBehavior::DoNothingOnEnter);
addChild(m_popup); addChild(m_popup);
@ -76,6 +77,8 @@ void PalettePopup::onLoadPal()
CommandsModule::instance()->getCommandByName(CommandId::SetPalette)); CommandsModule::instance()->getCommandByName(CommandId::SetPalette));
cmd->setPalette(palette); cmd->setPalette(palette);
UIContext::instance()->executeCommand(cmd); UIContext::instance()->executeCommand(cmd);
m_paletteListBox.requestFocus();
} }
void PalettePopup::onOpenFolder() void PalettePopup::onOpenFolder()