mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-11 13:14:17 +00:00
Double-click on a preset palette loads it
This commit is contained in:
parent
b95326435c
commit
4c2a283bd7
@ -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));
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user