2015-02-12 15:16:25 +00:00
|
|
|
// Aseprite
|
|
|
|
// Copyright (C) 2001-2015 David Capello
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License version 2 as
|
|
|
|
// published by the Free Software Foundation.
|
2012-01-05 22:45:03 +00:00
|
|
|
|
2013-08-06 00:20:19 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2012-01-05 22:45:03 +00:00
|
|
|
#include "config.h"
|
2013-08-06 00:20:19 +00:00
|
|
|
#endif
|
2012-01-05 22:45:03 +00:00
|
|
|
|
2013-08-06 00:20:19 +00:00
|
|
|
#include "app/commands/command.h"
|
|
|
|
#include "app/modules/gui.h"
|
2012-01-05 22:45:03 +00:00
|
|
|
#include "base/bind.h"
|
2013-08-06 00:20:19 +00:00
|
|
|
#include "ui/ui.h"
|
2012-01-05 22:45:03 +00:00
|
|
|
|
2013-08-06 00:20:19 +00:00
|
|
|
namespace app {
|
2012-01-05 22:45:03 +00:00
|
|
|
|
2012-06-18 01:02:54 +00:00
|
|
|
using namespace ui;
|
|
|
|
|
2013-08-06 00:20:19 +00:00
|
|
|
class AboutCommand : public Command {
|
2012-01-05 22:45:03 +00:00
|
|
|
public:
|
|
|
|
AboutCommand();
|
2014-08-15 02:07:47 +00:00
|
|
|
Command* clone() const override { return new AboutCommand(*this); }
|
2012-01-05 22:45:03 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void onExecute(Context* context);
|
|
|
|
};
|
|
|
|
|
|
|
|
AboutCommand::AboutCommand()
|
|
|
|
: Command("About",
|
|
|
|
"About",
|
|
|
|
CmdUIOnlyFlag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void AboutCommand::onExecute(Context* context)
|
|
|
|
{
|
2013-11-23 20:47:57 +00:00
|
|
|
base::UniquePtr<Window> window(new Window(Window::WithTitleBar, "About " PACKAGE));
|
2015-06-23 17:00:00 +00:00
|
|
|
Box* box1 = new Box(VERTICAL);
|
2012-01-05 22:45:03 +00:00
|
|
|
Grid* grid = new Grid(2, false);
|
|
|
|
Label* title = new Label(PACKAGE " v" VERSION);
|
2015-05-05 16:41:27 +00:00
|
|
|
Label* subtitle = new Label("Animated sprite editor & pixel art tool");
|
2015-06-23 17:00:00 +00:00
|
|
|
Separator* authors_separator1 = new Separator("Authors:", HORIZONTAL | TOP);
|
|
|
|
Separator* authors_separator2 = new Separator("", HORIZONTAL);
|
2015-02-28 00:03:46 +00:00
|
|
|
Label* author1 = new LinkLabel("http://davidcapello.com/", "David Capello");
|
2015-05-05 16:41:27 +00:00
|
|
|
Label* author1_desc = new Label("- Lead developer, graphics & maintainer");
|
2012-01-05 22:45:03 +00:00
|
|
|
Label* author2 = new LinkLabel("http://ilkke.blogspot.com/", "Ilija Melentijevic");
|
2015-05-05 16:41:27 +00:00
|
|
|
Label* author2_desc = new Label("- Default skin & graphics introduced in v0.8");
|
2014-04-12 15:28:34 +00:00
|
|
|
Label* author3 = new LinkLabel(WEBSITE_CONTRIBUTORS, "Contributors");
|
2015-06-23 17:00:00 +00:00
|
|
|
Box* bottom_box1 = new Box(HORIZONTAL);
|
|
|
|
Box* bottom_box2 = new Box(HORIZONTAL);
|
|
|
|
Box* bottom_box3 = new Box(HORIZONTAL);
|
2012-01-05 22:45:03 +00:00
|
|
|
Label* copyright = new Label(COPYRIGHT);
|
|
|
|
Label* website = new LinkLabel(WEBSITE);
|
|
|
|
Button* close_button = new Button("&Close");
|
|
|
|
|
|
|
|
grid->addChildInCell(title, 2, 1, 0);
|
|
|
|
grid->addChildInCell(subtitle, 2, 1, 0);
|
|
|
|
grid->addChildInCell(authors_separator1, 2, 1, 0);
|
|
|
|
grid->addChildInCell(author1, 1, 1, 0);
|
|
|
|
grid->addChildInCell(author1_desc, 1, 1, 0);
|
|
|
|
grid->addChildInCell(author2, 1, 1, 0);
|
|
|
|
grid->addChildInCell(author2_desc, 1, 1, 0);
|
|
|
|
grid->addChildInCell(author3, 2, 1, 0);
|
|
|
|
grid->addChildInCell(authors_separator2, 2, 1, 0);
|
|
|
|
grid->addChildInCell(copyright, 2, 1, 0);
|
|
|
|
grid->addChildInCell(website, 2, 1, 0);
|
|
|
|
grid->addChildInCell(bottom_box1, 2, 1, 0);
|
|
|
|
|
2012-04-05 22:00:19 +00:00
|
|
|
close_button->setFocusMagnet(true);
|
2012-01-05 22:45:03 +00:00
|
|
|
|
2012-04-05 22:00:19 +00:00
|
|
|
bottom_box2->setExpansive(true);
|
|
|
|
bottom_box3->setExpansive(true);
|
2012-01-05 22:45:03 +00:00
|
|
|
|
|
|
|
bottom_box1->addChild(bottom_box2);
|
|
|
|
bottom_box1->addChild(close_button);
|
|
|
|
bottom_box1->addChild(bottom_box3);
|
|
|
|
|
|
|
|
box1->addChild(grid);
|
2012-07-09 02:24:42 +00:00
|
|
|
window->addChild(box1);
|
2012-01-05 22:45:03 +00:00
|
|
|
|
2015-06-23 22:20:49 +00:00
|
|
|
close_button->setBorder(
|
|
|
|
gfx::Border(
|
|
|
|
close_button->border().left() + 16*guiscale(),
|
|
|
|
close_button->border().top(),
|
|
|
|
close_button->border().right() + 16*guiscale(),
|
|
|
|
close_button->border().bottom()));
|
2012-01-05 22:45:03 +00:00
|
|
|
|
2012-07-09 02:24:42 +00:00
|
|
|
close_button->Click.connect(Bind<void>(&Window::closeWindow, window.get(), close_button));
|
2012-01-05 22:45:03 +00:00
|
|
|
|
2012-07-09 02:24:42 +00:00
|
|
|
window->openWindowInForeground();
|
2012-01-05 22:45:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Command* CommandFactory::createAboutCommand()
|
|
|
|
{
|
|
|
|
return new AboutCommand;
|
|
|
|
}
|
2013-08-06 00:20:19 +00:00
|
|
|
|
|
|
|
} // namespace app
|