mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
ADded DroidSansFallbackFull as fallback font in ecode and eterm.
CheckBox and RadioButton now display hover effect. Added alias "lg" for layout-gravity. Node: Added addMouseClickListener and hasChild helper functions. UICodeEditor: Fixed a minor bug that provoked to scroll the view when resizing the widget. UITabWidget: minor bug fix. ecode: Fixed a bug that caused to save a monospace font when the user did not accept to change it. Added debug options to the widget inspector. Added i18n to all strings defined in XML files/strings. Added "Rename Session" button in the Terminal menu.
This commit is contained in:
@@ -649,7 +649,7 @@ Probably deprecate the Maps module, since I will focus my efforts on the UI syst
|
||||
|
||||
* Lewis Van Winkle for [PlusCallback](https://github.com/codeplea/pluscallback)
|
||||
|
||||
* Dieter Baron and Thomas Klausner for [libbzip](https://libzip.org/)
|
||||
* Dieter Baron and Thomas Klausner for [libzip](https://libzip.org/)
|
||||
|
||||
* Jean-loup Gailly and Mark Adler for [zlib](https://zlib.net/)
|
||||
|
||||
|
||||
BIN
bin/assets/fonts/DroidSansFallbackFull.ttf
Normal file
BIN
bin/assets/fonts/DroidSansFallbackFull.ttf
Normal file
Binary file not shown.
@@ -197,6 +197,10 @@ CheckBox::inactive {
|
||||
border-color: var(--button-border);
|
||||
}
|
||||
|
||||
CheckBox:hover CheckBox::inactive {
|
||||
border-color: var(--primary);
|
||||
}
|
||||
|
||||
CheckBox::active {
|
||||
border-color: var(--primary);
|
||||
background-image: rectangle(solid, var(--primary));
|
||||
@@ -223,6 +227,10 @@ RadioButton::inactive {
|
||||
border-color: var(--button-border);
|
||||
}
|
||||
|
||||
RadioButton:hover RadioButton::inactive {
|
||||
border-color: var(--primary);
|
||||
}
|
||||
|
||||
RadioButton::active {
|
||||
border-color: var(--primary);
|
||||
background-image: circle(solid, var(--primary));
|
||||
|
||||
@@ -850,7 +850,7 @@ XML attribute (for those who are familiar with).
|
||||
* `center_vertical`: Place element in the vertical center of its container.
|
||||
* `center`: shorthand of `center_horizontal|center_vertical`
|
||||
* Default value: `left|top`
|
||||
* Aliases: `layout_gravity`
|
||||
* Aliases: `layout_gravity`, `lg`
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -195,6 +195,9 @@ class EE_API Node : public Transformable {
|
||||
return addEventListener( eventType, callback );
|
||||
}
|
||||
|
||||
Uint32 addMouseClickListener( const std::function<void( const MouseEvent* )>& callback,
|
||||
const MouseButton& button );
|
||||
|
||||
void removeEventsOfType( const Uint32& eventType );
|
||||
|
||||
void removeEventListener( const Uint32& callbackId );
|
||||
@@ -229,6 +232,8 @@ class EE_API Node : public Transformable {
|
||||
|
||||
Node* find( const std::string& id ) const;
|
||||
|
||||
Node* hasChild( const std::string& id ) const;
|
||||
|
||||
template <typename T> T* find( const std::string& id ) const {
|
||||
return reinterpret_cast<T*>( find( id ) );
|
||||
}
|
||||
@@ -547,6 +552,8 @@ class EE_API Node : public Transformable {
|
||||
|
||||
Node* findIdHash( const String::HashType& idHash ) const;
|
||||
|
||||
Node* hasChildHash( const String::HashType& idHash ) const;
|
||||
|
||||
virtual void updateOriginPoint();
|
||||
|
||||
void setDirty();
|
||||
|
||||
@@ -22,7 +22,7 @@ class EE_API UICheckBox : public UITextView {
|
||||
|
||||
const bool& isChecked() const;
|
||||
|
||||
void setChecked( const bool& checked );
|
||||
UICheckBox* setChecked( const bool& checked );
|
||||
|
||||
UIWidget* getCheckedButton() const;
|
||||
|
||||
|
||||
@@ -121,7 +121,6 @@ class EE_API DocSyntaxDefEvent : public DocEvent {
|
||||
const std::string& getNewLang() const { return newLang; }
|
||||
|
||||
protected:
|
||||
TextDocument* doc;
|
||||
std::string oldLang;
|
||||
std::string newLang;
|
||||
};
|
||||
@@ -546,6 +545,7 @@ class EE_API UICodeEditor : public UIWidget, public TextDocument::Client {
|
||||
Clock mBlinkTimer;
|
||||
Time mBlinkTime;
|
||||
bool mDirtyEditor{ false };
|
||||
bool mDirtyScroll{ false };
|
||||
bool mCursorVisible{ false };
|
||||
bool mMouseDown{ false };
|
||||
bool mShowLineNumber{ true };
|
||||
@@ -641,7 +641,7 @@ class EE_API UICodeEditor : public UIWidget, public TextDocument::Client {
|
||||
|
||||
void updateLongestLineWidth();
|
||||
|
||||
void invalidateEditor();
|
||||
void invalidateEditor( bool dirtyScroll = true );
|
||||
|
||||
void invalidateLongestLineWidth();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 8.0.1, 2022-10-06T00:33:05. -->
|
||||
<!-- Written by QtCreator 8.0.1, 2022-10-16T03:14:23. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
@@ -186,7 +186,7 @@
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--with-mojoal gmake</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--with-mojoal --with-mold-linker gmake</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Command">premake4</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}../../../</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.ProcessStep</value>
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
|
||||
const char* EEGL3_STATES_NAME[] = {"dgl_Vertex", "dgl_Normal", "dgl_FrontColor"};
|
||||
const char* EEGL3_STATES_NAME[] = { "dgl_Vertex", "dgl_Normal", "dgl_FrontColor" };
|
||||
|
||||
const char* EEGL3_TEXTUREUNIT_NAMES[] = {"dgl_MultiTexCoord0", "dgl_MultiTexCoord1",
|
||||
"dgl_MultiTexCoord2", "dgl_MultiTexCoord3"};
|
||||
const char* EEGL3_TEXTUREUNIT_NAMES[] = { "dgl_MultiTexCoord0", "dgl_MultiTexCoord1",
|
||||
"dgl_MultiTexCoord2", "dgl_MultiTexCoord3" };
|
||||
|
||||
const char* EEGL3_PLANES_ENABLED_NAME[] = {"dgl_ClipEnabled[0]", "dgl_ClipEnabled[1]",
|
||||
"dgl_ClipEnabled[2]", "dgl_ClipEnabled[3]",
|
||||
"dgl_ClipEnabled[4]", "dgl_ClipEnabled[5]"};
|
||||
const char* EEGL3_PLANES_ENABLED_NAME[] = { "dgl_ClipEnabled[0]", "dgl_ClipEnabled[1]",
|
||||
"dgl_ClipEnabled[2]", "dgl_ClipEnabled[3]",
|
||||
"dgl_ClipEnabled[4]", "dgl_ClipEnabled[5]" };
|
||||
|
||||
const char* EEGL3_PLANES_NAME[] = {"dgl_ClipPlane[0]", "dgl_ClipPlane[1]", "dgl_ClipPlane[2]",
|
||||
"dgl_ClipPlane[3]", "dgl_ClipPlane[4]", "dgl_ClipPlane[5]"};
|
||||
const char* EEGL3_PLANES_NAME[] = { "dgl_ClipPlane[0]", "dgl_ClipPlane[1]", "dgl_ClipPlane[2]",
|
||||
"dgl_ClipPlane[3]", "dgl_ClipPlane[4]", "dgl_ClipPlane[5]" };
|
||||
|
||||
#ifdef EE_GLES2
|
||||
const GLchar* GL3_SHADER_HEAD = "precision mediump float;\nprecision lowp int;\n";
|
||||
@@ -88,7 +88,8 @@ void RendererGL3::init() {
|
||||
|
||||
mShaders[EEGL3_SHADER_BASE] =
|
||||
ShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() );
|
||||
mShaders[EEGL3_SHADER_BASE]->setReloadCb( cb::Make1( this, &RendererGL3::reloadShader ) );
|
||||
mShaders[EEGL3_SHADER_BASE]->setReloadCb(
|
||||
[&]( ShaderProgram* sp ) { reloadShader( sp ); } );
|
||||
|
||||
Shader::ensure( true );
|
||||
|
||||
@@ -323,7 +324,7 @@ void RendererGL3::disableClientState( unsigned int array ) {
|
||||
}
|
||||
|
||||
void RendererGL3::vertexPointer( int size, unsigned int type, int stride, const void* pointer,
|
||||
unsigned int allocate ) {
|
||||
unsigned int /*allocate*/ ) {
|
||||
const int index = mAttribsLoc[EEGL_VERTEX_ARRAY];
|
||||
|
||||
if ( -1 != index ) {
|
||||
@@ -338,7 +339,7 @@ void RendererGL3::vertexPointer( int size, unsigned int type, int stride, const
|
||||
}
|
||||
|
||||
void RendererGL3::colorPointer( int size, unsigned int type, int stride, const void* pointer,
|
||||
unsigned int allocate ) {
|
||||
unsigned int /*allocate*/ ) {
|
||||
const int index = mAttribsLoc[EEGL_COLOR_ARRAY];
|
||||
|
||||
if ( -1 != index ) {
|
||||
@@ -357,7 +358,7 @@ void RendererGL3::colorPointer( int size, unsigned int type, int stride, const v
|
||||
}
|
||||
|
||||
void RendererGL3::texCoordPointer( int size, unsigned int type, int stride, const void* pointer,
|
||||
unsigned int allocate ) {
|
||||
unsigned int /*allocate*/ ) {
|
||||
const int index = mTextureUnits[mCurActiveTex];
|
||||
|
||||
if ( -1 != index ) {
|
||||
|
||||
@@ -759,6 +759,20 @@ Node* Node::find( const std::string& id ) const {
|
||||
return findIdHash( String::hash( id ) );
|
||||
}
|
||||
|
||||
Node* Node::hasChildHash( const String::HashType& idHash ) const {
|
||||
Node* child = mChild;
|
||||
while ( NULL != child ) {
|
||||
if ( child->getIdHash() == idHash )
|
||||
return child;
|
||||
child = child->mNext;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Node* Node::hasChild( const std::string& id ) const {
|
||||
return hasChildHash( String::hash( id ) );
|
||||
}
|
||||
|
||||
Node* Node::findByType( const Uint32& type ) const {
|
||||
if ( !isClosing() && isType( type ) ) {
|
||||
return const_cast<Node*>( this );
|
||||
@@ -1104,6 +1118,15 @@ Uint32 Node::addEventListener( const Uint32& eventType, const EventCallback& cal
|
||||
return mNumCallBacks;
|
||||
}
|
||||
|
||||
Uint32 Node::addMouseClickListener( const std::function<void( const MouseEvent* )>& callback,
|
||||
const MouseButton& button ) {
|
||||
return addEventListener( Event::MouseClick, [callback, button]( const Event* event ) {
|
||||
if ( event->asMouseEvent()->getFlags() & ( EE_BUTTON_MASK( button ) ) ) {
|
||||
callback( event->asMouseEvent() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
void Node::removeEventsOfType( const Uint32& eventType ) {
|
||||
auto it = mEvents.find( eventType );
|
||||
if ( it != mEvents.end() )
|
||||
|
||||
@@ -150,7 +150,7 @@ void StyleSheetSpecification::registerDefaultProperties() {
|
||||
.addAlias( "layout_weight" )
|
||||
.addAlias( "lw8" )
|
||||
.setType( PropertyType::NumberFloat );
|
||||
registerProperty( "layout-gravity", "" ).addAlias( "layout_gravity" );
|
||||
registerProperty( "layout-gravity", "" ).addAlias( "layout_gravity" ).addAlias( "lg" );
|
||||
registerProperty( "layout-width", "" ).addAlias( "layout_width" ).addAlias( "lw" );
|
||||
registerProperty( "layout-height", "" ).addAlias( "layout_height" ).addAlias( "lh" );
|
||||
registerProperty( "layout-to-left-of", "" ).addAlias( "layout_to_left_of" );
|
||||
|
||||
@@ -136,7 +136,7 @@ void UICheckBox::switchState() {
|
||||
setChecked( !mChecked );
|
||||
}
|
||||
|
||||
void UICheckBox::setChecked( const bool& checked ) {
|
||||
UICheckBox* UICheckBox::setChecked( const bool& checked ) {
|
||||
if ( !checked ) {
|
||||
mActiveButton->setVisible( false );
|
||||
mInactiveButton->setVisible( true );
|
||||
@@ -156,6 +156,8 @@ void UICheckBox::setChecked( const bool& checked ) {
|
||||
alignFix();
|
||||
|
||||
onValueChange();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
const bool& UICheckBox::isChecked() const {
|
||||
@@ -177,13 +179,13 @@ void UICheckBox::alignFix() {
|
||||
|
||||
switch ( Font::getHorizontalAlign( getFlags() ) ) {
|
||||
case UI_HALIGN_CENTER:
|
||||
mRealAlignOffset.x =
|
||||
( Float )( ( Int32 )( ( mSize.x - mPaddingPx.Left - mPaddingPx.Right -
|
||||
mTextCache->getTextWidth() -
|
||||
mActiveButton->getPixelsSize().getWidth() +
|
||||
PixelDensity::dpToPx( mTextSeparation ) ) /
|
||||
2.f ) ) +
|
||||
mActiveButton->getPixelsSize().getWidth() + PixelDensity::dpToPx( mTextSeparation );
|
||||
mRealAlignOffset.x = (Float)( (Int32)( ( mSize.x - mPaddingPx.Left - mPaddingPx.Right -
|
||||
mTextCache->getTextWidth() -
|
||||
mActiveButton->getPixelsSize().getWidth() +
|
||||
PixelDensity::dpToPx( mTextSeparation ) ) /
|
||||
2.f ) ) +
|
||||
mActiveButton->getPixelsSize().getWidth() +
|
||||
PixelDensity::dpToPx( mTextSeparation );
|
||||
break;
|
||||
case UI_HALIGN_RIGHT:
|
||||
mRealAlignOffset.x = ( (Float)mSize.x - mPaddingPx.Left - mPaddingPx.Right -
|
||||
|
||||
@@ -776,8 +776,9 @@ bool UICodeEditor::isDirty() const {
|
||||
return mDoc->isDirty();
|
||||
}
|
||||
|
||||
void UICodeEditor::invalidateEditor() {
|
||||
void UICodeEditor::invalidateEditor( bool dirtyScroll ) {
|
||||
mDirtyEditor = true;
|
||||
mDirtyScroll = dirtyScroll;
|
||||
}
|
||||
|
||||
void UICodeEditor::invalidateLongestLineWidth() {
|
||||
@@ -1295,12 +1296,12 @@ void UICodeEditor::drawCursor( const Vector2f& startScroll, const Float& lineHei
|
||||
|
||||
void UICodeEditor::onSizeChange() {
|
||||
UIWidget::onSizeChange();
|
||||
invalidateEditor();
|
||||
invalidateEditor( false );
|
||||
}
|
||||
|
||||
void UICodeEditor::onPaddingChange() {
|
||||
UIWidget::onPaddingChange();
|
||||
invalidateEditor();
|
||||
invalidateEditor( false );
|
||||
}
|
||||
|
||||
void UICodeEditor::findLongestLine() {
|
||||
@@ -1428,10 +1429,11 @@ void UICodeEditor::scrollToCursor( bool centered ) {
|
||||
|
||||
void UICodeEditor::updateEditor() {
|
||||
mDoc->setPageSize( getVisibleLinesCount() );
|
||||
if ( mDoc->getActiveClient() == this )
|
||||
if ( mDirtyScroll && mDoc->getActiveClient() == this )
|
||||
scrollTo( mDoc->getSelection().start() );
|
||||
updateScrollBar();
|
||||
mDirtyEditor = false;
|
||||
mDirtyScroll = false;
|
||||
}
|
||||
|
||||
void UICodeEditor::onDocumentTextChanged() {
|
||||
|
||||
@@ -249,8 +249,10 @@ bool UITabWidget::applyProperty( const StyleSheetProperty& attribute ) {
|
||||
break;
|
||||
case PropertyId::TabAllowSwitchTabsInEmptySpaces:
|
||||
setAllowSwitchTabsInEmptySpaces( attribute.asBool() );
|
||||
break;
|
||||
case PropertyId::DroppableHoveringColor:
|
||||
setDroppableHoveringColor( attribute.asColor() );
|
||||
break;
|
||||
default:
|
||||
return UIWidget::applyProperty( attribute );
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ void AppConfig::load( const std::string& confPath, std::string& keybindingsPath,
|
||||
ui.monospaceFont = ini.getValue( "ui", "monospace_font", "fonts/DejaVuSansMono.ttf" );
|
||||
ui.terminalFont =
|
||||
ini.getValue( "ui", "terminal_font", "fonts/DejaVuSansMonoNerdFontComplete.ttf" );
|
||||
ui.fallbackFont = ini.getValue( "ui", "fallback_font", "fonts/DroidSansFallbackFull.ttf" );
|
||||
ui.colorScheme = ini.getValue( "ui", "ui_color_scheme", "dark" ) == "light"
|
||||
? ColorSchemePreference::Light
|
||||
: ColorSchemePreference::Dark;
|
||||
@@ -179,6 +180,7 @@ void AppConfig::save( const std::vector<std::string>& recentFiles,
|
||||
ini.setValue( "ui", "serif_font", ui.serifFont );
|
||||
ini.setValue( "ui", "monospace_font", ui.monospaceFont );
|
||||
ini.setValue( "ui", "terminal_font", ui.terminalFont );
|
||||
ini.setValue( "ui", "fallback_font", ui.fallbackFont );
|
||||
ini.setValue( "ui", "ui_color_scheme",
|
||||
ui.colorScheme == ColorSchemePreference::Light ? "light" : "dark" );
|
||||
ini.setValueB( "document", "trim_trailing_whitespaces", doc.trimTrailingWhitespaces );
|
||||
|
||||
@@ -29,6 +29,7 @@ struct UIConfig {
|
||||
std::string serifFont;
|
||||
std::string monospaceFont;
|
||||
std::string terminalFont;
|
||||
std::string fallbackFont;
|
||||
ColorSchemePreference colorScheme{ ColorSchemePreference::Dark };
|
||||
};
|
||||
|
||||
|
||||
@@ -221,15 +221,18 @@ void App::openFontDialog( std::string& fontPath, bool loadingMonoFont ) {
|
||||
if ( String::startsWith( newPath, mResPath ) )
|
||||
newPath = newPath.substr( mResPath.size() );
|
||||
if ( fontPath != newPath ) {
|
||||
fontPath = newPath;
|
||||
if ( !loadingMonoFont )
|
||||
if ( !loadingMonoFont ) {
|
||||
fontPath = newPath;
|
||||
return;
|
||||
}
|
||||
auto fontName =
|
||||
FileSystem::fileRemoveExtension( FileSystem::fileNameFromPath( fontPath ) );
|
||||
FontTrueType* fontMono = loadFont( fontName, fontPath );
|
||||
FileSystem::fileRemoveExtension( FileSystem::fileNameFromPath( newPath ) );
|
||||
FontTrueType* fontMono = loadFont( fontName, newPath );
|
||||
if ( fontMono ) {
|
||||
auto loadMonoFont = [&]( FontTrueType* fontMono ) {
|
||||
auto loadMonoFont = [&, newPath]( FontTrueType* fontMono ) {
|
||||
fontPath = newPath;
|
||||
mFontMono = fontMono;
|
||||
mFontMono->setEnableFallbackFont( false );
|
||||
mFontMono->setBoldAdvanceSameAsRegular( true );
|
||||
if ( mSplitter ) {
|
||||
mSplitter->forEachEditor(
|
||||
@@ -442,6 +445,13 @@ bool App::trySendUnlockedCmd( const KeyEvent& keyEvent ) {
|
||||
mSplitter->getCurEditor()->getDocument().execute( cmd );
|
||||
return true;
|
||||
}
|
||||
} else if ( mSplitter->curWidgetExists() &&
|
||||
mSplitter->getCurWidget()->isType( UI_TYPE_TERMINAL ) ) {
|
||||
UITerminal* terminal = mSplitter->getCurWidget()->asType<UITerminal>();
|
||||
std::string cmd = terminal->getKeyBindings().getCommandFromKeyBind(
|
||||
{ keyEvent.getKeyCode(), keyEvent.getMod() } );
|
||||
if ( !cmd.empty() )
|
||||
terminal->execute( cmd );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -536,28 +546,36 @@ App::~App() {
|
||||
eeSAFE_DELETE( mConsole );
|
||||
}
|
||||
|
||||
void App::checkWidgetPick( UITreeView* widgetTree ) {
|
||||
void App::checkWidgetPick( UITreeView* widgetTree, bool wasHighlightOver ) {
|
||||
Input* input = mWindow->getInput();
|
||||
if ( input->getClickTrigger() & EE_BUTTON_LMASK ) {
|
||||
Node* node = mUISceneNode->getEventDispatcher()->getMouseOverNode();
|
||||
WidgetTreeModel* model = static_cast<WidgetTreeModel*>( widgetTree->getModel() );
|
||||
ModelIndex index( model->getModelIndex( node ) );
|
||||
widgetTree->setSelection( index );
|
||||
mUISceneNode->setHighlightOver( false );
|
||||
mUISceneNode->setHighlightOver( wasHighlightOver );
|
||||
mUISceneNode->getEventDispatcher()->setDisableMousePress( false );
|
||||
} else {
|
||||
mUISceneNode->runOnMainThread( [this, widgetTree]() { checkWidgetPick( widgetTree ); } );
|
||||
mUISceneNode->runOnMainThread( [this, widgetTree, wasHighlightOver]() {
|
||||
checkWidgetPick( widgetTree, wasHighlightOver );
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
void App::createWidgetTreeView() {
|
||||
void App::createWidgetInspector() {
|
||||
if ( mUISceneNode->getRoot()->hasChild( "widget-tree-view" ) )
|
||||
return;
|
||||
UIWindow* uiWin = UIWindow::New();
|
||||
uiWin->setId( "widget-tree-view" );
|
||||
uiWin->setMinWindowSize( 600, 400 );
|
||||
uiWin->setWindowFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_RESIZEABLE | UI_WIN_MAXIMIZE_BUTTON );
|
||||
UIWidget* cont = mUISceneNode->loadLayoutFromString( R"xml(
|
||||
<vbox lw="mp" lh="mp">
|
||||
<hbox lw="mp" lh="wc">
|
||||
<pushbutton id="pick_widget" text='@string(pick_widget, "Pick Widget")' />
|
||||
<hbox lw="wc" lh="wc">
|
||||
<pushbutton id="pick_widget" icon="icon(cursor-pointer, 16dp)" text='@string(pick_widget, "Pick Widget")' text-as-fallback="true" />
|
||||
<CheckBox id="debug-draw-highlight" text='@string(debug_draw_highlight, "Highlight Focus & Hover")' margin-left="4dp" lg="center" />
|
||||
<CheckBox id="debug-draw-boxes" text='@string(debug_draw_boxes, "Draw Boxes")' margin-left="4dp" lg="center" />
|
||||
<CheckBox id="debug-draw-debug-data" text='@string(debug_draw_debug_data, "Draw Debug Data")' margin-left="4dp" lg="center" />
|
||||
</hbox>
|
||||
<treeview lw="mp" lh="fixed" lw8="1" />
|
||||
</vbox>
|
||||
@@ -574,12 +592,31 @@ void App::createWidgetTreeView() {
|
||||
UIPushButton* button = cont->find<UIPushButton>( "pick_widget" );
|
||||
button->addEventListener( Event::MouseClick, [&, widgetTree]( const Event* event ) {
|
||||
if ( event->asMouseEvent()->getFlags() & EE_BUTTON_LMASK ) {
|
||||
bool wasHighlightOver = mUISceneNode->getHighlightOver();
|
||||
mUISceneNode->setHighlightOver( true );
|
||||
mUISceneNode->getEventDispatcher()->setDisableMousePress( true );
|
||||
mUISceneNode->runOnMainThread(
|
||||
[this, widgetTree]() { checkWidgetPick( widgetTree ); } );
|
||||
mUISceneNode->runOnMainThread( [this, widgetTree, wasHighlightOver]() {
|
||||
checkWidgetPick( widgetTree, wasHighlightOver );
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
cont->find<UICheckBox>( "debug-draw-highlight" )
|
||||
->setChecked( mUISceneNode->getHighlightOver() )
|
||||
->addEventListener( Event::OnValueChange, [this]( const auto* ) {
|
||||
runCommand( "debug-draw-highlight-toggle" );
|
||||
} );
|
||||
|
||||
cont->find<UICheckBox>( "debug-draw-boxes" )
|
||||
->setChecked( mUISceneNode->getDrawBoxes() )
|
||||
->addEventListener( Event::OnValueChange,
|
||||
[this]( const auto* ) { runCommand( "debug-draw-boxes-toggle" ); } );
|
||||
|
||||
cont->find<UICheckBox>( "debug-draw-debug-data" )
|
||||
->setChecked( mUISceneNode->getDrawDebugData() )
|
||||
->addEventListener( Event::OnValueChange,
|
||||
[this]( const auto* ) { runCommand( "debug-draw-debug-data" ); } );
|
||||
|
||||
uiWin->center();
|
||||
}
|
||||
|
||||
@@ -753,6 +790,8 @@ UIMenu* App::createWindowMenu() {
|
||||
->setId( "monospace-font" );
|
||||
mWindowMenu->add( i18n( "terminal_font", "Terminal Font..." ), findIcon( "font-size" ) )
|
||||
->setId( "terminal-font" );
|
||||
mWindowMenu->add( i18n( "fallback_font", "Fallback Font..." ), findIcon( "font-size" ) )
|
||||
->setId( "fallback-font" );
|
||||
mWindowMenu->addSeparator();
|
||||
mWindowMenu
|
||||
->addCheckBox( i18n( "fullscreen_mode", "Full Screen Mode" ), false,
|
||||
@@ -928,6 +967,8 @@ UIMenu* App::createWindowMenu() {
|
||||
openFontDialog( mConfig.ui.monospaceFont, true );
|
||||
} else if ( item->getId() == "terminal-font" ) {
|
||||
openFontDialog( mConfig.ui.terminalFont, false );
|
||||
} else if ( item->getId() == "fallback-font" ) {
|
||||
openFontDialog( mConfig.ui.fallbackFont, false );
|
||||
} else if ( "zoom-in" == item->getId() ) {
|
||||
mSplitter->zoomIn();
|
||||
} else if ( "zoom-out" == item->getId() ) {
|
||||
@@ -1276,13 +1317,20 @@ UIMenu* App::createTerminalMenu() {
|
||||
"avoid keyboard shortcut overlapping between the terminal an the application." ) )
|
||||
->setId( "exclusive-mode" );
|
||||
|
||||
mTerminalMenu
|
||||
->add( i18n( "rename_session", "Rename Session" ), nullptr,
|
||||
getKeybind( "terminal-rename" ) )
|
||||
->setId( "terminal-rename" );
|
||||
|
||||
mTerminalMenu->addEventListener( Event::OnItemClicked, [&]( const Event* event ) {
|
||||
const std::string& id( event->getNode()->getId() );
|
||||
if ( "exclusive-mode" == id ) {
|
||||
if ( mSplitter->getCurWidget() &&
|
||||
mSplitter->getCurWidget()->isType( UI_TYPE_TERMINAL ) ) {
|
||||
mSplitter->getCurWidget()->asType<UITerminal>()->setExclusiveMode(
|
||||
if ( mSplitter->getCurWidget() && mSplitter->getCurWidget()->isType( UI_TYPE_TERMINAL ) ) {
|
||||
UITerminal* terminal = mSplitter->getCurWidget()->asType<UITerminal>();
|
||||
if ( "exclusive-mode" == id ) {
|
||||
terminal->setExclusiveMode(
|
||||
event->getNode()->asType<UIMenuCheckBox>()->isActive() );
|
||||
} else {
|
||||
terminal->execute( id );
|
||||
}
|
||||
}
|
||||
} );
|
||||
@@ -1864,6 +1912,19 @@ void App::createPluginManagerUI() {
|
||||
} )->showWhenReady();
|
||||
}
|
||||
|
||||
void App::debugDrawHighlightToggle() {
|
||||
mUISceneNode->setHighlightFocus( !mUISceneNode->getHighlightFocus() );
|
||||
mUISceneNode->setHighlightOver( !mUISceneNode->getHighlightOver() );
|
||||
}
|
||||
|
||||
void App::debugDrawBoxesToggle() {
|
||||
mUISceneNode->setDrawBoxes( !mUISceneNode->getDrawBoxes() );
|
||||
}
|
||||
|
||||
void App::debugDrawData() {
|
||||
mUISceneNode->setDrawDebugData( !mUISceneNode->getDrawDebugData() );
|
||||
}
|
||||
|
||||
void App::updateDocumentMenu() {
|
||||
if ( !mSplitter->getCurWidget() || !mSplitter->getCurWidget()->isType( UI_TYPE_CODEEDITOR ) ) {
|
||||
mSettingsMenu->getItemId( "doc-menu" )->setEnabled( false );
|
||||
@@ -2192,9 +2253,6 @@ std::map<KeyBindings::Shortcut, std::string> App::getLocalKeybindings() {
|
||||
{ { KEY_O, KeyMod::getDefaultModifier() }, "open-file" },
|
||||
{ { KEY_W, KeyMod::getDefaultModifier() | KEYMOD_SHIFT }, "download-file-web" },
|
||||
{ { KEY_O, KeyMod::getDefaultModifier() | KEYMOD_SHIFT }, "open-folder" },
|
||||
{ { KEY_F6, KEYMOD_NONE }, "debug-draw-highlight-toggle" },
|
||||
{ { KEY_F7, KEYMOD_NONE }, "debug-draw-boxes-toggle" },
|
||||
{ { KEY_F8, KEYMOD_NONE }, "debug-draw-debug-data" },
|
||||
{ { KEY_F11, KEYMOD_NONE }, "debug-widget-tree-view" },
|
||||
{ { KEY_K, KeyMod::getDefaultModifier() }, "open-locatebar" },
|
||||
{ { KEY_F, KeyMod::getDefaultModifier() | KEYMOD_SHIFT }, "open-global-search" },
|
||||
@@ -2295,14 +2353,14 @@ void App::createDocAlert( UICodeEditor* editor ) {
|
||||
const std::string& msg = R"xml(
|
||||
<hbox class="doc_alert" layout_width="wrap_content" layout_height="wrap_content" layout_gravity="top|right" gravity-owner="true">
|
||||
<TextView id="doc_alert_text" layout_width="wrap_content" layout_height="wrap_content" margin-right="24dp"
|
||||
text="The file on the disk is more recent that the current buffer.
Do you want to reload it?"
|
||||
text='@string(reload_current_file, "The file on the disk is more recent that the current buffer.
Do you want to reload it?")'
|
||||
/>
|
||||
<PushButton id="file_reload" layout_width="wrap_content" layout_height="18dp" text='@string("reload", "Reload")' margin-right="4dp"
|
||||
tooltip="Reload the file from disk. Unsaved changes will be lost." />
|
||||
tooltip='@string(tooltip_reload_file, "Reload the file from disk. Unsaved changes will be lost.")' />
|
||||
<PushButton id="file_overwrite" layout_width="wrap_content" layout_height="18dp" text='@string("overwrite", "Overwrite")' margin-right="4dp"
|
||||
tooltip="Writes the local changes on disk, overwriting the disk changes" />
|
||||
tooltip='@string(tooltip_write_local_changes, "Writes the local changes on disk, overwriting the disk changes")' />
|
||||
<PushButton id="file_ignore" layout_width="wrap_content" layout_height="18dp" text='@string("ignore", "Ignore")'
|
||||
tooltip="Ignores the changes on disk without any action." />
|
||||
tooltip='@string(tooltip_ignore_file_changes, "Ignores the changes on disk without any action.")' />
|
||||
</hbox>
|
||||
)xml";
|
||||
docAlert = mUISceneNode->loadLayoutFromString( msg, editor )->asType<UILinearLayout>();
|
||||
@@ -2494,15 +2552,10 @@ void App::onCodeEditorCreated( UICodeEditor* editor, TextDocument& doc ) {
|
||||
}
|
||||
} );
|
||||
doc.setCommand( "keybindings", [&] { loadFileFromPath( mKeybindingsPath ); } );
|
||||
doc.setCommand( "debug-draw-boxes-toggle",
|
||||
[&] { mUISceneNode->setDrawBoxes( !mUISceneNode->getDrawBoxes() ); } );
|
||||
doc.setCommand( "debug-draw-highlight-toggle", [&] {
|
||||
mUISceneNode->setHighlightFocus( !mUISceneNode->getHighlightFocus() );
|
||||
mUISceneNode->setHighlightOver( !mUISceneNode->getHighlightOver() );
|
||||
} );
|
||||
doc.setCommand( "debug-draw-debug-data",
|
||||
[&] { mUISceneNode->setDrawDebugData( !mUISceneNode->getDrawDebugData() ); } );
|
||||
doc.setCommand( "debug-widget-tree-view", [&] { createWidgetTreeView(); } );
|
||||
doc.setCommand( "debug-draw-boxes-toggle", [&] { debugDrawBoxesToggle(); } );
|
||||
doc.setCommand( "debug-draw-highlight-toggle", [&] { debugDrawHighlightToggle(); } );
|
||||
doc.setCommand( "debug-draw-debug-data", [&] { debugDrawData(); } );
|
||||
doc.setCommand( "debug-widget-tree-view", [&] { createWidgetInspector(); } );
|
||||
doc.setCommand( "go-to-line", [&] { mFileLocator->goToLine(); } );
|
||||
doc.setCommand( "load-current-dir", [&] { loadCurrentDirectory(); } );
|
||||
doc.setCommand( "menu-toggle", [&] { toggleSettingsMenu(); } );
|
||||
@@ -3535,8 +3588,10 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe
|
||||
|
||||
mFont = loadFont( "sans-serif", mConfig.ui.serifFont, "fonts/NotoSans-Regular.ttf" );
|
||||
mFontMono = loadFont( "monospace", mConfig.ui.monospaceFont, "fonts/DejaVuSansMono.ttf" );
|
||||
if ( mFontMono )
|
||||
if ( mFontMono ) {
|
||||
mFontMono->setEnableFallbackFont( false );
|
||||
mFontMono->setBoldAdvanceSameAsRegular( true );
|
||||
}
|
||||
|
||||
loadFont( "NotoEmoji-Regular", "fonts/NotoEmoji-Regular.ttf" );
|
||||
|
||||
@@ -3553,8 +3608,12 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe
|
||||
return;
|
||||
}
|
||||
|
||||
mFontMonoNerdFont =
|
||||
loadFont( "monospace-nerdfont", "fonts/DejaVuSansMonoNerdFontComplete.ttf" );
|
||||
mTerminalFont = loadFont( "monospace-nerdfont", mConfig.ui.terminalFont,
|
||||
"fonts/DejaVuSansMonoNerdFontComplete.ttf" );
|
||||
|
||||
mFallbackFont = loadFont( "fallback-font", "fonts/DroidSansFallbackFull.ttf" );
|
||||
if ( mFallbackFont )
|
||||
FontManager::instance()->setFallbackFont( mFallbackFont );
|
||||
|
||||
SceneManager::instance()->add( mUISceneNode );
|
||||
|
||||
@@ -3686,9 +3745,9 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe
|
||||
</style>
|
||||
<RelativeLayout id="main_layout" layout_width="match_parent" layout_height="match_parent">
|
||||
<Splitter id="project_splitter" layout_width="match_parent" layout_height="match_parent">
|
||||
<TabWidget id="panel" tabbar-hide-on-single-tab="true" tabbar-allow-rearrange="true">
|
||||
<TabWidget id="panel" tabbar-hide-on-single-tab="true" tabbar-allow-rearrange="true" min-tab-width="32dp" max-tab-width="32dp">
|
||||
<TreeView id="project_view" />
|
||||
<Tab text='@string("project", "Project")' owns="project_view" />
|
||||
<Tab text='@string("project", "Project")' owns="project_view" text-as-fallback="true" icon="icon(folder-open, 12dp)" />
|
||||
</TabWidget>
|
||||
<vbox>
|
||||
<RelativeLayout layout_width="match_parent" layout_height="0" layout_weight="1">
|
||||
@@ -3715,25 +3774,25 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe
|
||||
<TextInput id="search_replace" layout_width="match_parent" layout_height="18dp" padding="0" />
|
||||
</vbox>
|
||||
<vbox layout_width="wrap_content" layout_height="wrap_content" margin-right="4dp">
|
||||
<CheckBox id="case_sensitive" layout_width="wrap_content" layout_height="wrap_content" text="Case sensitive" selected="false" />
|
||||
<CheckBox id="lua_pattern" layout_width="wrap_content" layout_height="wrap_content" text="Lua Pattern" selected="false" />
|
||||
<CheckBox id="case_sensitive" layout_width="wrap_content" layout_height="wrap_content" text='@string(case_sensitive, "Case sensitive")' selected="false" />
|
||||
<CheckBox id="lua_pattern" layout_width="wrap_content" layout_height="wrap_content" text='@string(lua_pattern, "Lua Pattern")' selected="false" />
|
||||
</vbox>
|
||||
<vbox layout_width="wrap_content" layout_height="wrap_content" margin-right="4dp">
|
||||
<CheckBox id="whole_word" layout_width="wrap_content" layout_height="wrap_content" text="Match Whole Word" selected="false" />
|
||||
<CheckBox id="escape_sequence" layout_width="wrap_content" layout_height="wrap_content" text="Use escape sequences" selected="false" tooltip="Replace \\, \t, \n, \r and \uXXXX (Unicode characters) with the corresponding control" />
|
||||
<CheckBox id="whole_word" layout_width="wrap_content" layout_height="wrap_content" text='@string(match_whole_word, "Match Whole Word")' selected="false" />
|
||||
<CheckBox id="escape_sequence" layout_width="wrap_content" layout_height="wrap_content" text='@string(use_escape_sequences, "Use escape sequences")' selected="false" tooltip='@string(escape_sequence_tooltip, "Replace \\, \t, \n, \r and \uXXXX (Unicode characters) with the corresponding control")' />
|
||||
</vbox>
|
||||
<vbox layout_width="wrap_content" layout_height="wrap_content">
|
||||
<hbox layout_width="wrap_content" layout_height="wrap_content" margin-bottom="2dp">
|
||||
<PushButton id="find_prev" layout_width="wrap_content" layout_height="18dp" text="Previous" margin-right="4dp" />
|
||||
<PushButton id="find_next" layout_width="wrap_content" layout_height="18dp" text="Next" margin-right="4dp" />
|
||||
<PushButton id="find_prev" layout_width="wrap_content" layout_height="18dp" text='@string(previous, "Previous")' margin-right="4dp" />
|
||||
<PushButton id="find_next" layout_width="wrap_content" layout_height="18dp" text='@string(next, "Next")' margin-right="4dp" />
|
||||
<RelativeLayout layout_width="0" layout_weight="1" layout_height="18dp">
|
||||
<Widget id="searchbar_close" class="close_button" layout_width="wrap_content" layout_height="wrap_content" layout_gravity="center_vertical|right" margin-right="2dp" />
|
||||
</RelativeLayout>
|
||||
</hbox>
|
||||
<hbox layout_width="wrap_content" layout_height="wrap_content">
|
||||
<PushButton id="replace" layout_width="wrap_content" layout_height="18dp" text="Replace" margin-right="4dp" />
|
||||
<PushButton id="replace_find" layout_width="wrap_content" layout_height="18dp" text="Replace & Find" margin-right="4dp" />
|
||||
<PushButton id="replace_all" layout_width="wrap_content" layout_height="18dp" text="Replace All" />
|
||||
<PushButton id="replace" layout_width="wrap_content" layout_height="18dp" text='@string(replace, "Replace")' margin-right="4dp" />
|
||||
<PushButton id="replace_find" layout_width="wrap_content" layout_height="18dp" text='@string(replace_and_find, "Replace & Find")' margin-right="4dp" />
|
||||
<PushButton id="replace_all" layout_width="wrap_content" layout_height="18dp" text='@string(replace_all, "Replace All")' />
|
||||
</hbox>
|
||||
</vbox>
|
||||
</searchbar>
|
||||
@@ -3743,21 +3802,21 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe
|
||||
</locatebar>
|
||||
<globalsearchbar id="global_search_bar" layout_width="match_parent" layout_height="wrap_content">
|
||||
<hbox layout_width="match_parent" layout_height="wrap_content">
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" text="Search for:" margin-right="4dp" />
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" text='@string(search_for, "Search for:")' margin-right="4dp" />
|
||||
<vbox layout_width="0" layout_weight="1" layout_height="wrap_content">
|
||||
<TextInput id="global_search_find" layout_width="match_parent" layout_height="wrap_content" layout_height="18dp" padding="0" margin-bottom="2dp" />
|
||||
<hbox layout_width="match_parent" layout_height="wrap_content" margin-bottom="4dp">
|
||||
<CheckBox id="case_sensitive" layout_width="wrap_content" layout_height="wrap_content" text="Case sensitive" selected="true" />
|
||||
<CheckBox id="whole_word" layout_width="wrap_content" layout_height="wrap_content" text="Match Whole Word" selected="false" margin-left="8dp" />
|
||||
<CheckBox id="lua_pattern" layout_width="wrap_content" layout_height="wrap_content" text="Lua Pattern" selected="false" margin-left="8dp" />
|
||||
<CheckBox id="escape_sequence" layout_width="wrap_content" layout_height="wrap_content" text="Use escape sequences" margin-left="8dp" selected="false" tooltip="Replace \\, \t, \n, \r and \uXXXX (Unicode characters) with the corresponding control" />
|
||||
<CheckBox id="case_sensitive" layout_width="wrap_content" layout_height="wrap_content" text='@string(case_sensitive, "Case sensitive")' selected="true" />
|
||||
<CheckBox id="whole_word" layout_width="wrap_content" layout_height="wrap_content" text='@string(match_whole_word, "Match Whole Word")' selected="false" margin-left="8dp" />
|
||||
<CheckBox id="lua_pattern" layout_width="wrap_content" layout_height="wrap_content" text='@string(lua_pattern, "Lua Pattern")' selected="false" margin-left="8dp" />
|
||||
<CheckBox id="escape_sequence" layout_width="wrap_content" layout_height="wrap_content" text='@string(use_escape_sequences, "Use escape sequences")' margin-left="8dp" selected="false" tooltip='@string(escape_sequence_tooltip, "Replace \\, \t, \n, \r and \uXXXX (Unicode characters) with the corresponding control")' />
|
||||
</hbox>
|
||||
<hbox layout_width="match_parent" layout_height="wrap_content">
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" text="History:" margin-right="4dp" layout_height="18dp" />
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" text='@string(history, "History:")' margin-right="4dp" layout_height="18dp" />
|
||||
<DropDownList id="global_search_history" layout_width="0" layout_height="18dp" layout_weight="1" margin-right="4dp" />
|
||||
<PushButton id="global_search_clear_history" layout_width="wrap_content" layout_height="18dp" text="Clear History" margin-right="4dp" />
|
||||
<PushButton id="global_search" layout_width="wrap_content" layout_height="18dp" text="Search" margin-right="4dp" />
|
||||
<PushButton id="global_search_replace" layout_width="wrap_content" layout_height="18dp" text="Search & Replace" />
|
||||
<PushButton id="global_search_clear_history" layout_width="wrap_content" layout_height="18dp" text='@string(clear_history, "Clear History")' margin-right="4dp" />
|
||||
<PushButton id="global_search" layout_width="wrap_content" layout_height="18dp" text='@string(search, "Search")' margin-right="4dp" />
|
||||
<PushButton id="global_search_replace" layout_width="wrap_content" layout_height="18dp" text='@string(search_and_replace, "Search & Replace")' />
|
||||
</hbox>
|
||||
</vbox>
|
||||
<Widget id="global_searchbar_close" class="close_button" layout_width="wrap_content" layout_height="wrap_content" layout_gravity="top|right" margin-left="4dp" margin-top="4dp" />
|
||||
@@ -3832,6 +3891,7 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe
|
||||
{ "match-case", 0xed8d },
|
||||
{ "palette", 0xefc5 },
|
||||
{ "file-code", 0xecd1 },
|
||||
{ "cursor-pointer", 0xec09 },
|
||||
};
|
||||
for ( const auto& icon : icons )
|
||||
iconTheme->add( UIGlyphIcon::New( icon.first, iconFont, icon.second ) );
|
||||
|
||||
@@ -30,7 +30,7 @@ class App : public UICodeEditorSplitter::Client {
|
||||
|
||||
~App();
|
||||
|
||||
void createWidgetTreeView();
|
||||
void createWidgetInspector();
|
||||
|
||||
void init( const LogLevel& logLevel, std::string file, const Float& pidelDensity,
|
||||
const std::string& colorScheme, bool terminal, bool frameBuffer,
|
||||
@@ -111,10 +111,12 @@ class App : public UICodeEditorSplitter::Client {
|
||||
|
||||
const std::string& resPath() const { return mResPath; }
|
||||
|
||||
Font* getFontMonoNerdFont() const { return mFontMonoNerdFont; }
|
||||
Font* getTerminalFont() const { return mTerminalFont; }
|
||||
|
||||
Font* getFontMono() const { return mFontMono; }
|
||||
|
||||
Font* getFallbackFont() const { return mFallbackFont; }
|
||||
|
||||
const Float& getDisplayDPI() const { return mDisplayDPI; }
|
||||
|
||||
const std::string& getCurrentProject() const { return mCurrentProject; }
|
||||
@@ -147,6 +149,12 @@ class App : public UICodeEditorSplitter::Client {
|
||||
|
||||
void createPluginManagerUI();
|
||||
|
||||
void debugDrawHighlightToggle();
|
||||
|
||||
void debugDrawBoxesToggle();
|
||||
|
||||
void debugDrawData();
|
||||
|
||||
protected:
|
||||
EE::Window::Window* mWindow{ nullptr };
|
||||
UISceneNode* mUISceneNode{ nullptr };
|
||||
@@ -210,7 +218,8 @@ class App : public UICodeEditorSplitter::Client {
|
||||
std::string mCurrentProject;
|
||||
FontTrueType* mFont{ nullptr };
|
||||
FontTrueType* mFontMono{ nullptr };
|
||||
FontTrueType* mFontMonoNerdFont{ nullptr };
|
||||
FontTrueType* mTerminalFont{ nullptr };
|
||||
FontTrueType* mFallbackFont{ nullptr };
|
||||
efsw::FileWatcher* mFileWatcher{ nullptr };
|
||||
FileSystemListener* mFileSystemListener{ nullptr };
|
||||
Mutex mWatchesLock;
|
||||
@@ -348,7 +357,7 @@ class App : public UICodeEditorSplitter::Client {
|
||||
|
||||
void initPluginManager();
|
||||
|
||||
void checkWidgetPick( UITreeView* widgetTree );
|
||||
void checkWidgetPick( UITreeView* widgetTree, bool wasHighlightOver );
|
||||
|
||||
void onPluginEnabled( UICodeEditorPlugin* plugin );
|
||||
};
|
||||
|
||||
@@ -89,7 +89,10 @@ void GlobalSearchController::initGlobalSearchBar(
|
||||
luaPatternChk->setTooltipText( kbind.getCommandKeybindString( "toggle-lua-pattern" ) );
|
||||
|
||||
UICheckBox* escapeSequenceChk = mGlobalSearchBarLayout->find<UICheckBox>( "escape_sequence" );
|
||||
escapeSequenceChk->setTooltipText( kbind.getCommandKeybindString( "change-escape-sequence" ) );
|
||||
std::string kbindEscape = kbind.getCommandKeybindString( "change-escape-sequence" );
|
||||
if ( !kbindEscape.empty() )
|
||||
escapeSequenceChk->setTooltipText( escapeSequenceChk->getTooltipText() + " (" +
|
||||
kbindEscape + ")" );
|
||||
|
||||
UIWidget* searchBarClose = mGlobalSearchBarLayout->find<UIWidget>( "global_searchbar_close" );
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ UITerminal* TerminalManager::createNewTerminal( const std::string& title, UITabW
|
||||
}
|
||||
}
|
||||
UITerminal* term = UITerminal::New(
|
||||
mApp->getFontMonoNerdFont() ? mApp->getFontMonoNerdFont() : mApp->getFontMono(),
|
||||
mApp->getTerminalFont() ? mApp->getTerminalFont() : mApp->getFontMono(),
|
||||
mApp->termConfig().fontSize.asPixels( 0, Sizef(), mApp->getDisplayDPI() ), Sizef( 16, 16 ),
|
||||
"", {},
|
||||
!workingDir.empty()
|
||||
@@ -345,10 +345,10 @@ UITerminal* TerminalManager::createNewTerminal( const std::string& title, UITabW
|
||||
} );
|
||||
term->setCommand( "reopen-closed-tab", [&] { mApp->reopenClosedTab(); } );
|
||||
term->setCommand( "plugin-manager", [&] { mApp->createPluginManagerUI(); } );
|
||||
// debug-draw-highlight-toggle
|
||||
// debug-draw-boxes-toggle
|
||||
// debug-draw-debug-data
|
||||
// debug-widget-tree-view
|
||||
term->setCommand( "debug-draw-boxes-toggle", [&] { mApp->debugDrawBoxesToggle(); } );
|
||||
term->setCommand( "debug-draw-highlight-toggle", [&] { mApp->debugDrawHighlightToggle(); } );
|
||||
term->setCommand( "debug-draw-debug-data", [&] { mApp->debugDrawData(); } );
|
||||
term->setCommand( "debug-widget-tree-view", [&] { mApp->createWidgetInspector(); } );
|
||||
term->setFocus();
|
||||
return term;
|
||||
#endif
|
||||
|
||||
@@ -214,7 +214,9 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
|
||||
->loadFromFile( resPath + "fonts/NotoEmoji-Regular.ttf" );
|
||||
}
|
||||
|
||||
std::string fallbackFontPath( fallbackFontPathF.Get() );
|
||||
std::string fallbackFontPath( fallbackFontPathF
|
||||
? fallbackFontPathF.Get()
|
||||
: resPath + "fonts/DroidSansFallbackFull.ttf" );
|
||||
if ( FileSystem::fileExists( fallbackFontPath ) ) {
|
||||
FontTrueType* fallbackFont = FontTrueType::New( "fallback-font" );
|
||||
if ( fallbackFont->loadFromFile( fallbackFontPath ) )
|
||||
|
||||
Reference in New Issue
Block a user