Double-click on a preset palette loads it

This commit is contained in:
David Capello 2016-11-14 15:55:21 -03:00
parent b95326435c
commit 4c2a283bd7
3 changed files with 19 additions and 3 deletions

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2001-2015 David Capello
// Copyright (C) 2001-2016 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -37,6 +37,7 @@ PalettePopup::PalettePopup()
addChild(m_popup);
m_paletteListBox.DoubleClickItem.connect(base::Bind<void>(&PalettePopup::onLoadPal, this));
m_popup->loadPal()->Click.connect(base::Bind<void>(&PalettePopup::onLoadPal, this));
m_popup->openFolder()->Click.connect(base::Bind<void>(&PalettePopup::onOpenFolder, this));

View File

@ -1,5 +1,5 @@
// Aseprite UI Library
// Copyright (C) 2001-2013, 2015 David Capello
// Copyright (C) 2001-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@ -29,6 +29,20 @@ ListItem::ListItem(const std::string& text)
initTheme();
}
bool ListItem::onProcessMessage(Message* msg)
{
switch (msg->type()) {
case kDoubleClickMessage:
// Propagate the message to the parent.
if (parent())
return parent()->sendMessage(msg);
else
break;
break;
}
return Widget::onProcessMessage(msg);
}
void ListItem::onPaint(PaintEvent& ev)
{
theme()->paintListItem(ev);

View File

@ -1,5 +1,5 @@
// Aseprite UI Library
// Copyright (C) 2001-2013, 2015 David Capello
// Copyright (C) 2001-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@ -23,6 +23,7 @@ namespace ui {
}
protected:
bool onProcessMessage(Message* msg) override;
void onPaint(PaintEvent& ev) override;
void onResize(ResizeEvent& ev) override;
void onSizeHint(SizeHintEvent& ev) override;