Merge branch 'main' into beta

This commit is contained in:
David Capello 2021-04-13 19:12:46 -03:00
commit de68fddbe7
12 changed files with 75 additions and 60 deletions

View File

@ -1,5 +1,5 @@
# Aseprite # Aseprite
# Copyright (C) 2018-2020 Igara Studio S.A. # Copyright (C) 2018-2021 Igara Studio S.A.
# Copyright (C) 2001-2018 David Capello # Copyright (C) 2001-2018 David Capello
cmake_minimum_required(VERSION 3.4) cmake_minimum_required(VERSION 3.4)
@ -292,8 +292,7 @@ if(USE_SHARED_CMARK)
find_path(CMARK_INCLUDE_DIRS NAMES cmark.h) find_path(CMARK_INCLUDE_DIRS NAMES cmark.h)
else() else()
add_definitions(-DCMARK_STATIC_DEFINE) add_definitions(-DCMARK_STATIC_DEFINE)
set(CMARK_LIBRARIES libcmark_static) set(CMARK_LIBRARIES cmark_static)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/third_party/cmark)
endif() endif()
if(REQUIRE_CURL) if(REQUIRE_CURL)

View File

@ -51,12 +51,9 @@ You can ask for help in:
Aseprite is being developed by [Igara Studio](https://www.igarastudio.com/): Aseprite is being developed by [Igara Studio](https://www.igarastudio.com/):
* [David Capello](https://davidcapello.com/): Lead developer, * [David Capello](https://davidcapello.com/)
bug fixing & new features in desktop & web, and user support. * [Gaspar Capello](https://github.com/Gasparoken)
* [Gaspar Capello](https://github.com/Gasparoken): Developer, * [Martin Capello](https://github.com/martincapello)
bug fixing & new features in desktop, and user support.
* [Martin Capello](https://github.com/martincapello): Developer,
new store website.
## Credits ## Credits
@ -64,6 +61,10 @@ The default Aseprite theme was introduced in v0.8, created by:
* [Ilija Melentijevic](https://ilkke.net/) * [Ilija Melentijevic](https://ilkke.net/)
And the dark theme version introduced in v1.3-beta1 by:
* [Nicolas Desilets](https://twitter.com/MapleGecko)
Aseprite includes color palettes created by: Aseprite includes color palettes created by:
* [Richard "DawnBringer" Fhager](http://pixeljoint.com/p/23821.htm), [16 colors](http://pixeljoint.com/forum/forum_posts.asp?TID=12795), [32 colors](http://pixeljoint.com/forum/forum_posts.asp?TID=16247). * [Richard "DawnBringer" Fhager](http://pixeljoint.com/p/23821.htm), [16 colors](http://pixeljoint.com/forum/forum_posts.asp?TID=12795), [32 colors](http://pixeljoint.com/forum/forum_posts.asp?TID=16247).

View File

@ -6,27 +6,23 @@
<vbox> <vbox>
<label text="" id="title" /> <label text="" id="title" />
<label text="Animated sprite editor &amp;&amp; pixel art tool" /> <label text="Animated sprite editor &amp;&amp; pixel art tool" />
<separator text="Developers:" horizontal="true" /> <hbox homogeneous="true">
<grid columns="2"> <hbox>
<link text="David Capello" url="https://twitter.com/davidcapello" /> <vbox expansive="true">
<label text="- Lead developer, new features &amp;&amp; bug fixing in desktop &amp;&amp; web" /> <separator text="Developer Team" horizontal="true" />
<link text="Gaspar Capello" url="https://twitter.com/Gasparoken" /> <link text="David Capello" url="https://twitter.com/davidcapello" />
<label text="- Developer, new features &amp;&amp; bug fixing in desktop" /> <link text="Gaspar Capello" url="https://twitter.com/Gasparoken" />
<link text="Martin Capello" url="https://twitter.com/martincapell0" /> <link text="Martin Capello" url="https://twitter.com/martincapell0" />
<label text="- Developer, new store website" /> <vbox minheight="8" />
</vbox>
<separator text="Contributors:" horizontal="true" cell_hspan="2" /> <separator vertical="true" />
<link text="Ilija Melentijevic" url="https://ilkke.net/" />
<label text="- Default theme &amp;&amp; graphics introduced in v0.8" />
<link text="Nicolas Desilets" url="https://twitter.com/MapleGecko" />
<label text="- Default dark theme introduced in v1.3" />
<hbox cell_hspan="2">
<link text="Other Contributors" url="https://www.aseprite.org/contributors/" />
<label text="&amp;&amp;" />
<link text="Third-Party Projects" url="" id="licenses" />
</hbox> </hbox>
</grid> <vbox>
<separator text="Credits" horizontal="true" cell_hspan="2" />
<link text="Contributors" url="" id="credits" />
<link text="Open Source Projects" url="" id="licenses" />
</vbox>
</hbox>
<separator horizontal="true" /> <separator horizontal="true" />
<hbox> <hbox>
<label text="Copyright (C) 2001-2021" /> <label text="Copyright (C) 2001-2021" />

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2020 Igara Studio S.A. // Copyright (C) 2020-2021 Igara Studio S.A.
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2016 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
@ -180,7 +180,7 @@ AppBrushes::AppBrushes()
m_standard.push_back(BrushRef(new Brush(kLineBrushType, 7, 44))); m_standard.push_back(BrushRef(new Brush(kLineBrushType, 7, 44)));
try { try {
std::string fn = userBrushesFilename(); std::string fn = m_userBrushesFilename = userBrushesFilename();
if (base::is_file(fn)) if (base::is_file(fn))
load(fn); load(fn);
} }
@ -191,7 +191,8 @@ AppBrushes::AppBrushes()
AppBrushes::~AppBrushes() AppBrushes::~AppBrushes()
{ {
save(userBrushesFilename()); if (!m_userBrushesFilename.empty())
save(m_userBrushesFilename);
} }
AppBrushes::slot_id AppBrushes::addBrushSlot(const BrushSlot& brush) AppBrushes::slot_id AppBrushes::addBrushSlot(const BrushSlot& brush)

View File

@ -1,4 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2021 Igara Studio S.A.
// Copyright (C) 2001-2016 David Capello // Copyright (C) 2001-2016 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
@ -12,6 +13,7 @@
#include "doc/brushes.h" #include "doc/brushes.h"
#include "obs/signal.h" #include "obs/signal.h"
#include <string>
#include <vector> #include <vector>
namespace app { namespace app {
@ -49,6 +51,7 @@ namespace app {
doc::Brushes m_standard; doc::Brushes m_standard;
BrushSlots m_slots; BrushSlots m_slots;
std::string m_userBrushesFilename;
}; };
} // namespace app } // namespace app

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2020 Igara Studio S.A. // Copyright (C) 2020-2021 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello // Copyright (C) 2001-2018 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
@ -44,6 +44,11 @@ void AboutCommand::onExecute(Context* context)
window.closeWindow(nullptr); window.closeWindow(nullptr);
App::instance()->mainWindow()->showBrowser("docs/LICENSES.md"); App::instance()->mainWindow()->showBrowser("docs/LICENSES.md");
}); });
window.credits()->Click.connect(
[&window]{
window.closeWindow(nullptr);
App::instance()->mainWindow()->showBrowser("README.md", "Authors");
});
window.openWindowInForeground(); window.openWindowInForeground();
} }

View File

@ -90,7 +90,8 @@ public:
return m_file; return m_file;
} }
void loadFile(const std::string& inputFile) { void loadFile(const std::string& inputFile,
const std::string& section = std::string()) {
std::string file = inputFile; std::string file = inputFile;
{ {
ResourceFinder rf; ResourceFinder rf;
@ -121,9 +122,8 @@ public:
cmark_parser_feed(parser, "\n```\n", 5); cmark_parser_feed(parser, "\n```\n", 5);
cmark_node* root = cmark_parser_finish(parser); cmark_node* root = cmark_parser_finish(parser);
if (root) { if (root) {
processNode(root); processNode(root, section);
cmark_node_free(root); cmark_node_free(root);
} }
fclose(fp); fclose(fp);
@ -140,6 +140,16 @@ public:
FileChange(); FileChange();
} }
void focusSection() {
View* view = View::getView(this);
if (m_sectionWidget) {
int y = m_sectionWidget->bounds().y - bounds().y;
view->setViewScroll(gfx::Point(0, y));
m_sectionWidget = nullptr;
}
}
private: private:
void layoutElements(int width, void layoutElements(int width,
std::function<void(const gfx::Rect& bounds, std::function<void(const gfx::Rect& bounds,
@ -265,7 +275,8 @@ private:
delete firstChild(); delete firstChild();
} }
void processNode(cmark_node* root) { void processNode(cmark_node* root,
const std::string& section) {
clear(); clear();
m_content.clear(); m_content.clear();
@ -293,8 +304,11 @@ private:
} }
else { else {
m_content += text; m_content += text;
if (inHeading) if (inHeading) {
closeContent(); closeContent();
if (section == text)
m_sectionWidget = lastChild();
}
} }
} }
break; break;
@ -520,6 +534,7 @@ private:
std::string m_file; std::string m_file;
std::string m_content; std::string m_content;
Widget* m_sectionWidget = nullptr;
}; };
BrowserView::BrowserView() BrowserView::BrowserView()
@ -546,9 +561,10 @@ BrowserView::~BrowserView()
delete m_textBox; delete m_textBox;
} }
void BrowserView::loadFile(const std::string& file) void BrowserView::loadFile(const std::string& file,
const std::string& section)
{ {
m_textBox->loadFile(file); m_textBox->loadFile(file, section);
} }
std::string BrowserView::getTabText() std::string BrowserView::getTabText()
@ -575,6 +591,9 @@ void BrowserView::onWorkspaceViewSelected()
{ {
if (auto statusBar = StatusBar::instance()) if (auto statusBar = StatusBar::instance())
statusBar->clearText(); statusBar->clearText();
if (m_textBox)
m_textBox->focusSection();
} }
bool BrowserView::onCloseView(Workspace* workspace, bool quitting) bool BrowserView::onCloseView(Workspace* workspace, bool quitting)

View File

@ -1,4 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2021 Igara Studio S.A.
// Copyright (C) 2016 David Capello // Copyright (C) 2016 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
@ -20,7 +21,8 @@ namespace app {
BrowserView(); BrowserView();
~BrowserView(); ~BrowserView();
void loadFile(const std::string& file); void loadFile(const std::string& file,
const std::string& section = std::string());
// TabView implementation // TabView implementation
std::string getTabText() override; std::string getTabText() override;

View File

@ -273,12 +273,13 @@ bool MainWindow::isHomeSelected() const
return (m_homeView && m_workspace->activeView() == m_homeView); return (m_homeView && m_workspace->activeView() == m_homeView);
} }
void MainWindow::showBrowser(const std::string& filename) void MainWindow::showBrowser(const std::string& filename,
const std::string& section)
{ {
if (!m_browserView) if (!m_browserView)
m_browserView = new BrowserView; m_browserView = new BrowserView;
m_browserView->loadFile(filename); m_browserView->loadFile(filename, section);
if (!m_browserView->parent()) { if (!m_browserView->parent()) {
m_workspace->addView(m_browserView); m_workspace->addView(m_browserView);

View File

@ -73,7 +73,8 @@ namespace app {
void showHome(); void showHome();
void showDefaultStatusBar(); void showDefaultStatusBar();
void showDevConsole(); void showDevConsole();
void showBrowser(const std::string& filename); void showBrowser(const std::string& filename,
const std::string& section = std::string());
bool isHomeSelected() const; bool isHomeSelected() const;
Mode getMode() const { return m_mode; } Mode getMode() const { return m_mode; }

View File

@ -1,4 +1,5 @@
# ASEPRITE # Aseprite
# Copyright (C) 2021 Igara Studio S.A.
# Copyright (C) 2001-2018 David Capello # Copyright (C) 2001-2018 David Capello
include_directories(.) include_directories(.)
@ -84,20 +85,6 @@ add_subdirectory(fmt)
if(NOT USE_SHARED_CMARK) if(NOT USE_SHARED_CMARK)
set(CMARK_TESTS OFF CACHE BOOL "Build cmark tests and enable testing") set(CMARK_TESTS OFF CACHE BOOL "Build cmark tests and enable testing")
add_subdirectory(cmark) add_subdirectory(cmark)
set(cmark_headers
${CMAKE_CURRENT_SOURCE_DIR}/cmark/src/cmark.h
${CMAKE_CURRENT_BINARY_DIR}/cmark/src/cmark_export.h
${CMAKE_CURRENT_BINARY_DIR}/cmark/src/cmark_version.h)
foreach(fn ${cmark_headers})
get_filename_component(fn_name "${fn}" NAME)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cmark/${fn_name}
COMMAND ${CMAKE_COMMAND} -E copy ${fn} ${CMAKE_CURRENT_BINARY_DIR}/cmark/${fn_name}
MAIN_DEPENDENCY ${fn})
list(APPEND copy_cmark_headers ${CMAKE_CURRENT_BINARY_DIR}/cmark/${fn_name})
endforeach()
add_custom_target(copy_cmark_headers DEPENDS ${copy_cmark_headers})
add_dependencies(libcmark_static copy_cmark_headers)
endif() endif()
# JSON # JSON

2
third_party/cmark vendored

@ -1 +1 @@
Subproject commit 5255e2d5717dc7a265ca79404d387ef8abe8c004 Subproject commit 8a023286198a7e408398e282f293e3b0baebb644