2015-02-12 23:16:25 +08: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-06 06:45:03 +08:00
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2012-01-06 06:45:03 +08:00
|
|
|
#include "config.h"
|
2013-08-06 08:20:19 +08:00
|
|
|
#endif
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
#include "app/commands/command.h"
|
|
|
|
#include "app/modules/gui.h"
|
2012-01-06 06:45:03 +08:00
|
|
|
#include "base/bind.h"
|
2013-08-06 08:20:19 +08:00
|
|
|
#include "ui/ui.h"
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
namespace app {
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2012-06-18 09:02:54 +08:00
|
|
|
using namespace ui;
|
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
class AboutCommand : public Command {
|
2012-01-06 06:45:03 +08:00
|
|
|
public:
|
|
|
|
AboutCommand();
|
2014-08-15 10:07:47 +08:00
|
|
|
Command* clone() const override { return new AboutCommand(*this); }
|
2012-01-06 06:45:03 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void onExecute(Context* context);
|
|
|
|
};
|
|
|
|
|
|
|
|
AboutCommand::AboutCommand()
|
|
|
|
: Command("About",
|
|
|
|
"About",
|
|
|
|
CmdUIOnlyFlag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void AboutCommand::onExecute(Context* context)
|
|
|
|
{
|
2013-11-24 04:47:57 +08:00
|
|
|
base::UniquePtr<Window> window(new Window(Window::WithTitleBar, "About " PACKAGE));
|
2015-06-24 01:00:00 +08:00
|
|
|
Box* box1 = new Box(VERTICAL);
|
2012-01-06 06:45:03 +08:00
|
|
|
Grid* grid = new Grid(2, false);
|
|
|
|
Label* title = new Label(PACKAGE " v" VERSION);
|
2015-05-06 00:41:27 +08:00
|
|
|
Label* subtitle = new Label("Animated sprite editor & pixel art tool");
|
2015-06-24 01:00:00 +08:00
|
|
|
Separator* authors_separator1 = new Separator("Authors:", HORIZONTAL | TOP);
|
|
|
|
Separator* authors_separator2 = new Separator("", HORIZONTAL);
|
2015-02-28 08:03:46 +08:00
|
|
|
Label* author1 = new LinkLabel("http://davidcapello.com/", "David Capello");
|
2015-05-06 00:41:27 +08:00
|
|
|
Label* author1_desc = new Label("- Lead developer, graphics & maintainer");
|
2012-01-06 06:45:03 +08:00
|
|
|
Label* author2 = new LinkLabel("http://ilkke.blogspot.com/", "Ilija Melentijevic");
|
2015-05-06 00:41:27 +08:00
|
|
|
Label* author2_desc = new Label("- Default skin & graphics introduced in v0.8");
|
2014-04-12 23:28:34 +08:00
|
|
|
Label* author3 = new LinkLabel(WEBSITE_CONTRIBUTORS, "Contributors");
|
2015-06-24 01:00:00 +08:00
|
|
|
Box* bottom_box1 = new Box(HORIZONTAL);
|
|
|
|
Box* bottom_box2 = new Box(HORIZONTAL);
|
|
|
|
Box* bottom_box3 = new Box(HORIZONTAL);
|
2012-01-06 06:45:03 +08: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-06 06:00:19 +08:00
|
|
|
close_button->setFocusMagnet(true);
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2012-04-06 06:00:19 +08:00
|
|
|
bottom_box2->setExpansive(true);
|
|
|
|
bottom_box3->setExpansive(true);
|
2012-01-06 06:45:03 +08:00
|
|
|
|
|
|
|
bottom_box1->addChild(bottom_box2);
|
|
|
|
bottom_box1->addChild(close_button);
|
|
|
|
bottom_box1->addChild(bottom_box3);
|
|
|
|
|
|
|
|
box1->addChild(grid);
|
2012-07-09 10:24:42 +08:00
|
|
|
window->addChild(box1);
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2014-04-18 02:55:55 +08:00
|
|
|
close_button->setBorder(gfx::Border(
|
2014-11-26 09:33:45 +08:00
|
|
|
close_button->border_width.l + 16*guiscale(),
|
2014-04-18 02:55:55 +08:00
|
|
|
close_button->border_width.t,
|
2014-11-26 09:33:45 +08:00
|
|
|
close_button->border_width.r + 16*guiscale(),
|
2014-04-18 02:55:55 +08:00
|
|
|
close_button->border_width.b));
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2012-07-09 10:24:42 +08:00
|
|
|
close_button->Click.connect(Bind<void>(&Window::closeWindow, window.get(), close_button));
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2012-07-09 10:24:42 +08:00
|
|
|
window->openWindowInForeground();
|
2012-01-06 06:45:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
Command* CommandFactory::createAboutCommand()
|
|
|
|
{
|
|
|
|
return new AboutCommand;
|
|
|
|
}
|
2013-08-06 08:20:19 +08:00
|
|
|
|
|
|
|
} // namespace app
|