mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-29 17:46:29 +03:00
Added shorthand: min-size and max-size.
SyntaxDefinitionManager: Improved JSON. breeze theme improvements. ecode: Added mime-type icons (using nonicons).
This commit is contained in:
@@ -2037,6 +2037,24 @@ void App::onCodeEditorCreated( UICodeEditor* editor, TextDocument& doc ) {
|
||||
updateEditorTabTitle( editor );
|
||||
} );
|
||||
|
||||
auto docChanged = [&]( const Event* event ) {
|
||||
const DocEvent* synEvent = static_cast<const DocEvent*>( event );
|
||||
UICodeEditor* editor = event->getNode()->asType<UICodeEditor>();
|
||||
UIIcon* icon = mUISceneNode->findIcon(
|
||||
UIIconThemeManager::getIconNameFromFileName( synEvent->getDoc()->getFilename() ) );
|
||||
if ( !icon )
|
||||
icon = mUISceneNode->findIcon( "file" );
|
||||
if ( !icon )
|
||||
return;
|
||||
if ( editor->getData() ) {
|
||||
UITab* tab = (UITab*)editor->getData();
|
||||
tab->setIcon( icon->getSize( mMenuIconSize ) );
|
||||
}
|
||||
};
|
||||
|
||||
editor->addEventListener( Event::OnDocumentLoaded, docChanged );
|
||||
editor->addEventListener( Event::OnDocumentChanged, docChanged );
|
||||
|
||||
editor->showMinimap( config.minimap );
|
||||
|
||||
if ( config.autoComplete && !mAutoCompletePlugin )
|
||||
@@ -2800,6 +2818,9 @@ void App::init( std::string file, const Float& pidelDensity, const std::string&
|
||||
return;
|
||||
}
|
||||
|
||||
FontTrueType* mimeIconFont =
|
||||
FontTrueType::New( "nonicons", mResPath + "fonts/nonicons.ttf" );
|
||||
|
||||
SceneManager::instance()->add( mUISceneNode );
|
||||
|
||||
UITheme* theme =
|
||||
@@ -3011,7 +3032,7 @@ void App::init( std::string file, const Float& pidelDensity, const std::string&
|
||||
</RelativeLayout>
|
||||
)html";
|
||||
|
||||
UIIconTheme* iconTheme = UIIconTheme::New( "remixicon" );
|
||||
UIIconTheme* iconTheme = UIIconTheme::New( "ecode" );
|
||||
mMenuIconSize = mConfig.ui.fontSize.asPixels( 0, Sizef(), mDisplayDPI );
|
||||
std::unordered_map<std::string, Uint32> icons = {
|
||||
{ "document-new", 0xecc3 },
|
||||
@@ -3029,10 +3050,10 @@ void App::init( std::string file, const Float& pidelDensity, const std::string&
|
||||
{ "split-horizontal", 0xf17a },
|
||||
{ "split-vertical", 0xf17b },
|
||||
{ "find-replace", 0xed2b },
|
||||
{ "folder", 0xed54 },
|
||||
{ "folder-open", 0xed70 },
|
||||
// { "folder", 0xed54 },
|
||||
// { "folder-open", 0xed70 },
|
||||
{ "folder-add", 0xed5a },
|
||||
{ "file", 0xecc3 },
|
||||
// { "file", 0xecc3 },
|
||||
{ "file-add", 0xecc9 },
|
||||
{ "file-copy", 0xecd3 },
|
||||
{ "file-code", 0xecd1 },
|
||||
@@ -3068,6 +3089,71 @@ void App::init( std::string file, const Float& pidelDensity, const std::string&
|
||||
for ( const auto& icon : icons )
|
||||
iconTheme->add( UIGlyphIcon::New( icon.first, iconFont, icon.second ) );
|
||||
|
||||
if ( mimeIconFont && mimeIconFont->loaded() ) {
|
||||
std::unordered_map<std::string, Uint32> mimeIcons = {
|
||||
{ "filetype-lua", 61826 },
|
||||
{ "filetype-c", 61718 },
|
||||
{ "filetype-h", 61792 },
|
||||
{ "filetype-cs", 61720 },
|
||||
{ "filetype-cpp", 61719 },
|
||||
{ "filetype-css", 61743 },
|
||||
{ "filetype-conf", 61781 },
|
||||
{ "filetype-cfg", 61781 },
|
||||
{ "filetype-desktop", 61781 },
|
||||
{ "filetype-service", 61781 },
|
||||
{ "filetype-env", 61781 },
|
||||
{ "filetype-properties", 61781 },
|
||||
{ "filetype-ini", 61781 },
|
||||
{ "filetype-dart", 61744 },
|
||||
{ "filetype-diff", 61752 },
|
||||
{ "filetype-zip", 61775 },
|
||||
{ "filetype-go", 61789 },
|
||||
{ "filetype-htm", 61799 },
|
||||
{ "filetype-html", 61799 },
|
||||
{ "filetype-java", 61809 },
|
||||
{ "filetype-js", 61810 },
|
||||
{ "filetype-json", 61811 },
|
||||
{ "filetype-kt", 61814 },
|
||||
{ "filetype-md", 61829 },
|
||||
{ "filetype-perl", 61853 },
|
||||
{ "filetype-php", 61855 },
|
||||
{ "filetype-py", 61863 },
|
||||
{ "filetype-pyc", 61863 },
|
||||
{ "filetype-pyd", 61863 },
|
||||
{ "filetype-swift", 61906 },
|
||||
{ "filetype-rb", 61880 },
|
||||
{ "filetype-rs", 61881 },
|
||||
{ "filetype-ts", 61923 },
|
||||
{ "filetype-yaml", 61945 },
|
||||
{ "filetype-yml", 61945 },
|
||||
{ "filetype-jpg", 61801 },
|
||||
{ "filetype-png", 61801 },
|
||||
{ "filetype-jpeg", 61801 },
|
||||
{ "filetype-bmp", 61801 },
|
||||
{ "filetype-tga", 61801 },
|
||||
{ "filetype-sh", 61911 },
|
||||
{ "filetype-bash", 61911 },
|
||||
{ "filetype-fish", 61911 },
|
||||
{ "filetype-scala", 61882 },
|
||||
{ "filetype-r", 61866 },
|
||||
{ "filetype-rake", 61880 },
|
||||
{ "filetype-rss", 61879 },
|
||||
{ "filetype-sql", 61746 },
|
||||
{ "filetype-elm", 61763 },
|
||||
{ "filetype-ex", 61971 },
|
||||
{ "filetype-exs", 61971 },
|
||||
{ "filetype-awk", 61971 },
|
||||
{ "filetype-nim", 61734 },
|
||||
{ "filetype-xml", 61769 },
|
||||
{ "filetype-dockerfile", 61758 },
|
||||
{ "file", 61766 },
|
||||
{ "folder", 0xF23B },
|
||||
{ "folder-open", 0xF23C },
|
||||
};
|
||||
for ( const auto& icon : mimeIcons )
|
||||
iconTheme->add( UIGlyphIcon::New( icon.first, mimeIconFont, icon.second ) );
|
||||
}
|
||||
|
||||
mUISceneNode->getUIIconThemeManager()->setCurrentTheme( iconTheme );
|
||||
|
||||
UIWidgetCreator::registerWidget( "searchbar", UISearchBar::New );
|
||||
|
||||
Reference in New Issue
Block a user