mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
More general improvements for UITerminal.
This commit is contained in:
@@ -53,7 +53,7 @@ android {
|
||||
resValue "string", "app_name", "eterm"
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
arguments "APP_MODULES=eterm"
|
||||
arguments "APP_MODULES=eterm-app"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,21 +59,24 @@ LOCAL_CFLAGS := $(EEPP_C_FLAGS)
|
||||
|
||||
LOCAL_C_INCLUDES := $(EEPP_C_INCLUDES)
|
||||
|
||||
CORE_SRCS := tools/ecode/*.cpp tools/ecode/plugins/autocomplete/*.cpp tools/ecode/plugins/linter/*.cpp tools/ecode/plugins/formatter/*.cpp
|
||||
CORE_SRCS := tools/ecode/*.cpp \
|
||||
tools/ecode/plugins/autocomplete/*.cpp \
|
||||
tools/ecode/plugins/linter/*.cpp \
|
||||
tools/ecode/plugins/formatter/*.cpp
|
||||
|
||||
LOCAL_SRC_FILES := $(SDL_MAIN_PATH) $(foreach F, $(CORE_SRCS), $(addprefix $(dir $(F)),$(notdir $(wildcard $(LOCAL_PATH)/$(F)))))
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := eepp efsw
|
||||
LOCAL_STATIC_LIBRARIES := efsw eterm eepp
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
#************ ecode ************
|
||||
|
||||
#************* etern *************
|
||||
#************* eterm *************
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_PATH := $(EEPP_BASE_PATH)
|
||||
|
||||
LOCAL_MODULE := eterm
|
||||
LOCAL_MODULE := eterm-app
|
||||
|
||||
LOCAL_LDLIBS := $(EEPP_LDLIBS)
|
||||
|
||||
@@ -81,14 +84,14 @@ LOCAL_CFLAGS := $(EEPP_C_FLAGS)
|
||||
|
||||
LOCAL_C_INCLUDES := $(EEPP_C_INCLUDES)
|
||||
|
||||
CORE_SRCS := tools/eterm/*.cpp tools/eterm/system/*.cpp tools/eterm/terminal/*.cpp
|
||||
CORE_SRCS := tools/eterm/*.cpp
|
||||
|
||||
LOCAL_SRC_FILES := $(SDL_MAIN_PATH) $(foreach F, $(CORE_SRCS), $(addprefix $(dir $(F)),$(notdir $(wildcard $(LOCAL_PATH)/$(F)))))
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := eepp
|
||||
LOCAL_STATIC_LIBRARIES := eepp eterm
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
#************ etern ************
|
||||
#************ eterm ************
|
||||
|
||||
#************* full_test *************
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
@@ -3,6 +3,7 @@ EEPP_BASE_PATH := $(LOCAL_PATH)/../../../../src
|
||||
EEPP_PATH := $(LOCAL_PATH)/../../../../src/eepp
|
||||
EEPP_INC_PATH := $(LOCAL_PATH)/../../../../include
|
||||
EEPP_THIRD_PARTY_PATH := $(EEPP_BASE_PATH)/thirdparty
|
||||
EEPP_MODULES_PATH := $(EEPP_BASE_PATH)/modules
|
||||
SDL_PATH := $(EEPP_THIRD_PARTY_PATH)/SDL2
|
||||
SDL_MAIN_PATH := $(SDL_PATH)/src/main/android/*.c
|
||||
|
||||
@@ -21,7 +22,9 @@ EEPP_C_INCLUDES := \
|
||||
$(EEPP_THIRD_PARTY_PATH)/libogg/include \
|
||||
$(EEPP_THIRD_PARTY_PATH)/mbedtls/include \
|
||||
$(EEPP_THIRD_PARTY_PATH)/mojoAL \
|
||||
$(EEPP_THIRD_PARTY_PATH)/efsw/include
|
||||
$(EEPP_THIRD_PARTY_PATH)/efsw/include \
|
||||
$(EEPP_BASE_PATH)/modules/eterm/include \
|
||||
$(EEPP_BASE_PATH)/modules/eterm/src
|
||||
|
||||
EEPP_C_FLAGS := \
|
||||
-Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit \
|
||||
@@ -269,7 +272,6 @@ include $(BUILD_SHARED_LIBRARY)
|
||||
$(call import-module,android/cpufeatures)
|
||||
#**************** SDL 2 ***************
|
||||
|
||||
|
||||
#*************** EFSW ***************
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
@@ -277,14 +279,34 @@ LOCAL_PATH := $(EEPP_THIRD_PARTY_PATH)
|
||||
|
||||
LOCAL_MODULE := efsw
|
||||
|
||||
LIBPNG_SRCS := \
|
||||
LIBEFSW_SRCS := \
|
||||
efsw/src/efsw/*.cpp \
|
||||
efsw/src/efsw/platform/posix/*.cpp
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/efsw/include $(LOCAL_PATH)/efsw/src
|
||||
LOCAL_CFLAGS := -Os -DEFSW_USE_CXX11
|
||||
|
||||
LOCAL_SRC_FILES := $(foreach F, $(LIBPNG_SRCS), $(addprefix $(dir $(F)),$(notdir $(wildcard $(LOCAL_PATH)/$(F)))))
|
||||
LOCAL_SRC_FILES := $(foreach F, $(LIBEFSW_SRCS), $(addprefix $(dir $(F)),$(notdir $(wildcard $(LOCAL_PATH)/$(F)))))
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
#*************** EFSW ***************
|
||||
|
||||
#*************** ETERM ***************
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_PATH := $(EEPP_MODULES_PATH)
|
||||
|
||||
LOCAL_MODULE := eterm
|
||||
|
||||
LIBETERM_SRCS := \
|
||||
eterm/src/eterm/system/*.cpp \
|
||||
eterm/src/eterm/terminal/*.cpp \
|
||||
eterm/src/eterm/ui/*.cpp
|
||||
|
||||
LOCAL_C_INCLUDES := $(EEPP_C_INCLUDES) $(EEPP_INC_PATH)
|
||||
LOCAL_CFLAGS := -Os
|
||||
|
||||
LOCAL_SRC_FILES := $(foreach F, $(LIBETERM_SRCS), $(addprefix $(dir $(F)),$(notdir $(wildcard $(LOCAL_PATH)/$(F)))))
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
#*************** ETERM ***************
|
||||
|
||||
@@ -22,6 +22,7 @@ mkdir -p ecode.app/assets/colorschemes
|
||||
mkdir -p ecode.app/assets/fonts
|
||||
cp -r ../../../bin/assets/colorschemes ecode.app/assets/
|
||||
cp -r ../../../bin/assets/fonts/DejaVuSansMono.ttf ecode.app/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/DejaVuSansMonoNerdFontComplete.ttf ecode.app/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/nonicons.ttf ecode.app/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/NotoSans-Regular.ttf ecode.app/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/remixicon.ttf ecode.app/assets/fonts/
|
||||
|
||||
@@ -18,6 +18,7 @@ cp -r ../../../bin/assets/colorschemes/ ecode.app/Contents/MacOS/assets/colorsch
|
||||
#cp -r ../../../bin/assets/fonts ecode.app/Contents/MacOS/assets/
|
||||
mkdir -p ecode.app/Contents/MacOS/assets/fonts
|
||||
cp -r ../../../bin/assets/fonts/DejaVuSansMono.ttf ecode.app/Contents/MacOS/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/DejaVuSansMonoNerdFontComplete.ttf ecode.app/Contents/MacOS/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/nonicons.ttf ecode.app/Contents/MacOS/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/NotoSans-Regular.ttf ecode.app/Contents/MacOS/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/remixicon.ttf ecode.app/Contents/MacOS/assets/fonts/
|
||||
|
||||
@@ -42,6 +42,7 @@ mkdir -p ecode/assets/colorschemes
|
||||
mkdir -p ecode/assets/fonts
|
||||
cp -r ../../../bin/assets/colorschemes ecode/assets/
|
||||
cp -r ../../../bin/assets/fonts/DejaVuSansMono.ttf ecode/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/DejaVuSansMonoNerdFontComplete.ttf ecode/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/nonicons.ttf ecode/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/NotoSans-Regular.ttf ecode/assets/fonts/
|
||||
cp -r ../../../bin/assets/fonts/remixicon.ttf ecode/assets/fonts/
|
||||
|
||||
@@ -887,7 +887,7 @@ void UICodeEditor::createDefaultContextMenuOptions( UIPopUpMenu* menu ) {
|
||||
|
||||
menuAdd( menu, "cut", "Cut", "cut", "cut" )->setEnabled( mDoc->hasSelection() );
|
||||
menuAdd( menu, "copy", "Copy", "copy", "copy" )->setEnabled( mDoc->hasSelection() );
|
||||
menuAdd( menu, "cut", "Paste", "paste", "paste" );
|
||||
menuAdd( menu, "paste", "Paste", "paste", "paste" );
|
||||
menuAdd( menu, "delete", "Delete", "delete-text", "delete-to-next-char" );
|
||||
menu->addSeparator();
|
||||
menuAdd( menu, "select_all", "Select All", "select-all", "select-all" );
|
||||
|
||||
@@ -257,6 +257,7 @@ class TerminalDisplay : public ITerminalDisplay {
|
||||
bool mPasteNewlineFix{ true };
|
||||
bool mFocus{ true };
|
||||
bool mUseFrameBuffer{ true };
|
||||
bool mAlreadyClickedMButton{ false };
|
||||
Clock mClock;
|
||||
Clock mLastDoubleClick;
|
||||
int mColumns{ 0 };
|
||||
|
||||
@@ -180,6 +180,8 @@ class TerminalEmulator final {
|
||||
|
||||
char* getsel() const;
|
||||
|
||||
bool hasSelection() const;
|
||||
|
||||
std::string getSelection() const;
|
||||
|
||||
void mousereport( const TerminalMouseEventType& type, const Vector2i& pos, const Uint32& flags,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define ETERM_UI_UITERMINAL_HPP
|
||||
|
||||
#include <eepp/ui/keyboardshortcut.hpp>
|
||||
#include <eepp/ui/uipopupmenu.hpp>
|
||||
#include <eepp/ui/uiwidget.hpp>
|
||||
#include <eterm/terminal/terminaldisplay.hpp>
|
||||
|
||||
@@ -74,8 +75,11 @@ class UITerminal : public UIWidget {
|
||||
bool mIsCustomTitle{ false };
|
||||
bool mDraggingSel{ false };
|
||||
bool mExclusiveMode{ false };
|
||||
bool mCreateDefaultContextMenuOptions{ true };
|
||||
KeyBindings mKeyBindings;
|
||||
std::map<std::string, TerminalCommand> mCommands;
|
||||
UIPopUpMenu* mCurrentMenu{ nullptr };
|
||||
size_t mMenuIconSize{ 16 };
|
||||
|
||||
UITerminal( const std::shared_ptr<TerminalDisplay>& terminalDisplay );
|
||||
|
||||
@@ -102,6 +106,16 @@ class UITerminal : public UIWidget {
|
||||
virtual Uint32 onFocus();
|
||||
|
||||
virtual Uint32 onFocusLoss();
|
||||
|
||||
UIMenuItem* menuAdd( UIPopUpMenu* menu, const std::string& translateKey,
|
||||
const String& translateString, const std::string& icon,
|
||||
const std::string& cmd );
|
||||
|
||||
virtual bool onCreateContextMenu( const Vector2i& position, const Uint32& flags );
|
||||
|
||||
Drawable* findIcon( const std::string& name );
|
||||
|
||||
void createDefaultContextMenuOptions( UIPopUpMenu* menu );
|
||||
};
|
||||
|
||||
}} // namespace eterm::UI
|
||||
|
||||
@@ -723,10 +723,13 @@ void TerminalDisplay::onMouseDown( const Vector2i& pos, const Uint32& flags ) {
|
||||
mTerminal->selclear();
|
||||
}
|
||||
} else if ( flags & EE_BUTTON_MMASK ) {
|
||||
auto selection = mTerminal->getSelection();
|
||||
if ( !selection.empty() ) {
|
||||
for ( auto& chr : selection )
|
||||
onTextInput( chr );
|
||||
if ( !mAlreadyClickedMButton ) {
|
||||
mAlreadyClickedMButton = true;
|
||||
auto selection = mTerminal->getSelection();
|
||||
if ( !selection.empty() ) {
|
||||
for ( auto& chr : selection )
|
||||
onTextInput( chr );
|
||||
}
|
||||
}
|
||||
}
|
||||
mTerminal->mousereport( TerminalMouseEventType::MouseButtonDown, positionToGrid( pos ), flags,
|
||||
@@ -736,6 +739,9 @@ void TerminalDisplay::onMouseDown( const Vector2i& pos, const Uint32& flags ) {
|
||||
void TerminalDisplay::onMouseUp( const Vector2i& pos, const Uint32& flags ) {
|
||||
Uint32 smod = sanitizeMod( mWindow->getInput()->getModState() );
|
||||
|
||||
if ( flags & EE_BUTTON_MMASK )
|
||||
mAlreadyClickedMButton = false;
|
||||
|
||||
auto scIt = terminalKeyMap.MouseShortcuts().find( flags );
|
||||
if ( scIt != terminalKeyMap.MouseShortcuts().end() ) {
|
||||
for ( auto& k : scIt->second ) {
|
||||
@@ -760,12 +766,6 @@ void TerminalDisplay::onMouseUp( const Vector2i& pos, const Uint32& flags ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( flags & EE_BUTTON_LMASK ) ) {
|
||||
auto selection = mTerminal->getSelection();
|
||||
if ( !selection.empty() && selection != "\n" )
|
||||
setClipboard( selection.c_str() );
|
||||
invalidate();
|
||||
}
|
||||
mTerminal->mousereport( TerminalMouseEventType::MouseButtonRelease, positionToGrid( pos ),
|
||||
flags, mWindow->getInput()->getModState() );
|
||||
}
|
||||
|
||||
@@ -579,6 +579,10 @@ char* TerminalEmulator::getsel( void ) const {
|
||||
return str;
|
||||
}
|
||||
|
||||
bool TerminalEmulator::hasSelection() const {
|
||||
return mSel.ob.x != -1;
|
||||
}
|
||||
|
||||
std::string TerminalEmulator::getSelection() const {
|
||||
char* sel = getsel();
|
||||
if ( sel ) {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include <eepp/scene/scenemanager.hpp>
|
||||
#include <eepp/ui/uieventdispatcher.hpp>
|
||||
#include <eepp/ui/uiicon.hpp>
|
||||
#include <eepp/ui/uiscenenode.hpp>
|
||||
#include <eepp/ui/uitabwidget.hpp>
|
||||
#include <eepp/window/clipboard.hpp>
|
||||
#include <eterm/ui/uiterminal.hpp>
|
||||
|
||||
using namespace EE::Scene;
|
||||
@@ -51,6 +53,25 @@ UITerminal::UITerminal( const std::shared_ptr<TerminalDisplay>& terminalDisplay
|
||||
}
|
||||
}
|
||||
} );
|
||||
setCommand( "terminal-scroll-up-screen",
|
||||
[&] { mTerm->action( TerminalShortcutAction::SCROLLUP_SCREEN ); } );
|
||||
setCommand( "terminal-scroll-down-screen",
|
||||
[&] { mTerm->action( TerminalShortcutAction::SCROLLDOWN_SCREEN ); } );
|
||||
setCommand( "terminal-scroll-up-row",
|
||||
[&] { mTerm->action( TerminalShortcutAction::SCROLLUP_ROW ); } );
|
||||
setCommand( "terminal-scroll-down-row",
|
||||
[&] { mTerm->action( TerminalShortcutAction::SCROLLDOWN_ROW ); } );
|
||||
setCommand( "terminal-scroll-up-history",
|
||||
[&] { mTerm->action( TerminalShortcutAction::SCROLLUP_HISTORY ); } );
|
||||
setCommand( "terminal-scroll-down-history",
|
||||
[&] { mTerm->action( TerminalShortcutAction::SCROLLDOWN_HISTORY ); } );
|
||||
setCommand( "terminal-font-size-grow",
|
||||
[&] { mTerm->action( TerminalShortcutAction::FONTSIZE_GROW ); } );
|
||||
setCommand( "terminal-font-size-shrink",
|
||||
[&] { mTerm->action( TerminalShortcutAction::FONTSIZE_SHRINK ); } );
|
||||
setCommand( "terminal-paste", [&] { mTerm->action( TerminalShortcutAction::PASTE ); } );
|
||||
setCommand( "terminal-copy", [&] { mTerm->action( TerminalShortcutAction::COPY ); } );
|
||||
setCommand( "terminal-paste", [&] { mTerm->action( TerminalShortcutAction::PASTE ); } );
|
||||
subscribeScheduledUpdate();
|
||||
}
|
||||
|
||||
@@ -184,8 +205,12 @@ Uint32 UITerminal::onMouseDoubleClick( const Vector2i& position, const Uint32& f
|
||||
}
|
||||
|
||||
Uint32 UITerminal::onMouseUp( const Vector2i& position, const Uint32& flags ) {
|
||||
if ( ( flags & EE_BUTTON_LMASK ) && mDraggingSel )
|
||||
if ( ( flags & EE_BUTTON_LMASK ) && mDraggingSel ) {
|
||||
mDraggingSel = false;
|
||||
} else if ( flags & EE_BUTTON_RMASK ) {
|
||||
onCreateContextMenu( position, flags );
|
||||
return 1;
|
||||
}
|
||||
mTerm->onMouseUp( position, flags );
|
||||
return 1;
|
||||
}
|
||||
@@ -212,4 +237,66 @@ Uint32 UITerminal::onFocusLoss() {
|
||||
return UIWidget::onFocusLoss();
|
||||
}
|
||||
|
||||
void UITerminal::createDefaultContextMenuOptions( UIPopUpMenu* menu ) {
|
||||
if ( !mCreateDefaultContextMenuOptions )
|
||||
return;
|
||||
|
||||
menuAdd( menu, "copy", "Copy", "copy", "terminal-copy" )
|
||||
->setEnabled( mTerm->getTerminal() && mTerm->getTerminal()->hasSelection() );
|
||||
menuAdd( menu, "paste", "Paste", "paste", "terminal-paste" )
|
||||
->setEnabled( !getUISceneNode()->getWindow()->getClipboard()->getText().empty() );
|
||||
}
|
||||
|
||||
Drawable* UITerminal::findIcon( const std::string& name ) {
|
||||
UIIcon* icon = getUISceneNode()->findIcon( name );
|
||||
if ( icon )
|
||||
return icon->getSize( mMenuIconSize );
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UIMenuItem* UITerminal::menuAdd( UIPopUpMenu* menu, const std::string& translateKey,
|
||||
const String& translateString, const std::string& icon,
|
||||
const std::string& cmd ) {
|
||||
UIMenuItem* menuItem =
|
||||
menu->add( getTranslatorString( "@string/uiterminal_" + translateKey, translateString ),
|
||||
findIcon( icon ), mKeyBindings.getCommandKeybindString( cmd ) );
|
||||
menuItem->setId( cmd );
|
||||
return menuItem;
|
||||
}
|
||||
|
||||
bool UITerminal::onCreateContextMenu( const Vector2i& position, const Uint32& flags ) {
|
||||
if ( mCurrentMenu )
|
||||
return false;
|
||||
|
||||
UIPopUpMenu* menu = UIPopUpMenu::New();
|
||||
|
||||
ContextMenuEvent event( this, menu, Event::OnCreateContextMenu, position, flags );
|
||||
sendEvent( &event );
|
||||
|
||||
createDefaultContextMenuOptions( menu );
|
||||
|
||||
if ( menu->getCount() == 0 ) {
|
||||
menu->close();
|
||||
return false;
|
||||
}
|
||||
|
||||
menu->setCloseOnHide( true );
|
||||
menu->addEventListener( Event::OnItemClicked, [&]( const Event* event ) {
|
||||
if ( !event->getNode()->isType( UI_TYPE_MENUITEM ) )
|
||||
return;
|
||||
UIMenuItem* item = event->getNode()->asType<UIMenuItem>();
|
||||
std::string txt( item->getId() );
|
||||
execute( txt );
|
||||
} );
|
||||
|
||||
Vector2f pos( position.asFloat() );
|
||||
menu->nodeToWorldTranslation( pos );
|
||||
UIMenu::findBestMenuPos( pos, menu );
|
||||
menu->setPixelsPosition( pos );
|
||||
menu->show();
|
||||
menu->addEventListener( Event::OnClose, [&]( const Event* ) { mCurrentMenu = nullptr; } );
|
||||
mCurrentMenu = menu;
|
||||
return true;
|
||||
}
|
||||
|
||||
}} // namespace eterm::UI
|
||||
|
||||
@@ -2005,7 +2005,8 @@ void App::createNewTerminal() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
UITerminal* term = UITerminal::New( mFontMono, PixelDensity::dpToPx( 11 ), Sizef( 16, 16 ) );
|
||||
UITerminal* term = UITerminal::New( mFontMonoNerdFont ? mFontMonoNerdFont : mFontMono,
|
||||
PixelDensity::dpToPx( 11 ), Sizef( 16, 16 ) );
|
||||
mEditorSplitter->createWidgetInTabWidget( tabWidget, term, "Shell", true );
|
||||
term->addEventListener( Event::OnTitleChange, [&]( const Event* event ) {
|
||||
if ( event->getNode() != mEditorSplitter->getCurWidget() )
|
||||
@@ -2978,9 +2979,11 @@ FontTrueType* App::loadFont( const std::string& name, std::string fontPath,
|
||||
fontPath = mResPath + fontPath;
|
||||
if ( fontPath.empty() || !FileSystem::fileExists( fontPath ) ) {
|
||||
fontPath = fallback;
|
||||
if ( FileSystem::isRelativePath( fontPath ) )
|
||||
if ( !fontPath.empty() && FileSystem::isRelativePath( fontPath ) )
|
||||
fontPath = mResPath + fontPath;
|
||||
}
|
||||
if ( fontPath.empty() )
|
||||
return nullptr;
|
||||
return FontTrueType::New( name, fontPath );
|
||||
}
|
||||
|
||||
@@ -3082,21 +3085,24 @@ void App::init( std::string file, const Float& pidelDensity, const std::string&
|
||||
mFontMono = loadFont( "monospace", mConfig.ui.monospaceFont, "fonts/DejaVuSansMono.ttf" );
|
||||
if ( mFontMono )
|
||||
mFontMono->setBoldAdvanceSameAsRegular( true );
|
||||
|
||||
loadFont( "NotoEmoji-Regular", "fonts/NotoEmoji-Regular.ttf" );
|
||||
|
||||
#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN
|
||||
loadFont( "NotoColorEmoji", "fonts/NotoColorEmoji.ttf" );
|
||||
#endif
|
||||
|
||||
FontTrueType* iconFont = FontTrueType::New( "icon", mResPath + "fonts/remixicon.ttf" );
|
||||
FontTrueType* iconFont = loadFont( "icon", "fonts/remixicon.ttf" );
|
||||
FontTrueType* mimeIconFont = loadFont( "nonicons", "fonts/nonicons.ttf" );
|
||||
|
||||
if ( !mFont || !mFontMono || !iconFont ) {
|
||||
if ( !mFont || !mFontMono || !iconFont || !mimeIconFont ) {
|
||||
printf( "Font not found!" );
|
||||
Log::error( "Font not found!" );
|
||||
return;
|
||||
}
|
||||
|
||||
FontTrueType* mimeIconFont =
|
||||
FontTrueType::New( "nonicons", mResPath + "fonts/nonicons.ttf" );
|
||||
mFontMonoNerdFont =
|
||||
loadFont( "monospace-nerdfont", "fonts/DejaVuSansMonoNerdFontComplete.ttf" );
|
||||
|
||||
SceneManager::instance()->add( mUISceneNode );
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ class App : public UICodeEditorSplitter::Client {
|
||||
std::string mCurrentProject;
|
||||
FontTrueType* mFont{ nullptr };
|
||||
FontTrueType* mFontMono{ nullptr };
|
||||
FontTrueType* mFontMonoNerdFont{ nullptr };
|
||||
efsw::FileWatcher* mFileWatcher{ nullptr };
|
||||
FileSystemListener* mFileSystemListener{ nullptr };
|
||||
Mutex mWatchesLock;
|
||||
|
||||
Reference in New Issue
Block a user