eepp: Added UISVGIcon class. Added Image::getInfoFromMemory.

ecode: Added "Welcome" screen.
This commit is contained in:
Martín Lucas Golini
2023-03-21 01:15:01 -03:00
parent 3aeb3fdc2f
commit 8f2071e389
14 changed files with 505 additions and 21 deletions

View File

@@ -86,7 +86,7 @@ void ProjectDirectoryTree::scan( const ProjectDirectoryTree::ScanCompleteEvent&
#endif
#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN || defined( __EMSCRIPTEN_PTHREADS__ )
},
[scanComplete, this] ( const auto& ) {
[scanComplete, this]( const auto& ) {
if ( scanComplete )
scanComplete( *this );
} );
@@ -194,6 +194,28 @@ ProjectDirectoryTree::asModel( const size_t& max,
return model;
}
std::shared_ptr<FileListModel>
ProjectDirectoryTree::emptyModel( const std::vector<CommandInfo>& prependCommands ) {
std::vector<std::string> files;
std::vector<std::string> names;
if ( !prependCommands.empty() ) {
int count = 0;
for ( const auto& cmd : prependCommands ) {
names.insert( names.begin() + count, cmd.name );
files.insert( files.begin() + count, cmd.desc );
count++;
}
}
auto model = std::make_shared<FileListModel>( files, names );
if ( !prependCommands.empty() ) {
for ( size_t i = 0; i < prependCommands.size(); ++i )
model->setIcon( i, prependCommands[i].icon );
}
return model;
}
size_t ProjectDirectoryTree::getFilesCount() const {
return mFiles.size();
}