diff --git a/.ecode/project_build.json b/.ecode/project_build.json index 674aff317..a6aadfa91 100644 --- a/.ecode/project_build.json +++ b/.ecode/project_build.json @@ -476,7 +476,7 @@ "eepp-linux-ninja": { "build": [ { - "args": "--disable-static-build --with-debug-symbols --with-backend=SDL3 ninja", + "args": "--disable-static-build --with-debug-symbols --with-backend=SDL3 ninja", "command": "premake5", "working_dir": "${project_root}" }, diff --git a/include/eepp/ui/uiscenenode.hpp b/include/eepp/ui/uiscenenode.hpp index 6bf27f7ff..2733982ee 100644 --- a/include/eepp/ui/uiscenenode.hpp +++ b/include/eepp/ui/uiscenenode.hpp @@ -748,6 +748,7 @@ class EE_API UISceneNode : public SceneNode { CSS::StyleSheet mStyleSheet; bool mIsLoading{ false }; bool mUpdatingLayouts{ false }; + bool mStyleDuringLoad{ false }; UIThemeManager* mUIThemeManager{ nullptr }; UIIconThemeManager* mUIIconThemeManager{ nullptr }; std::vector mFontFaces; @@ -984,6 +985,8 @@ class EE_API UISceneNode : public SceneNode { /** @return The document / scene URI used to resolve paths from a complete URI (with * path+query+fragment+etc) */ URI getURIFromURL( const URI& url ) const; + + void updateStyleSheet( bool forceReloadStyle = true ); }; }} // namespace EE::UI diff --git a/src/eepp/ui/uiscenenode.cpp b/src/eepp/ui/uiscenenode.cpp index a902cabb3..3c7e52df5 100644 --- a/src/eepp/ui/uiscenenode.cpp +++ b/src/eepp/ui/uiscenenode.cpp @@ -371,6 +371,11 @@ UIWidget* UISceneNode::loadLayoutNodes( pugi::xml_node node, Node* parent, const innerClock.getElapsedTimeAndReset().asMilliseconds() ); } + if ( mStyleDuringLoad ) { + updateStyleSheet( false ); + mStyleDuringLoad = false; + } + for ( auto& widget : widgets ) widget->reloadStyle( true, true, true ); @@ -380,6 +385,7 @@ UIWidget* UISceneNode::loadLayoutNodes( pugi::xml_node node, Node* parent, const } mIsLoading = false; + SceneManager::instance()->setCurrentUISceneNode( prevUISceneNode ); if ( mVerbose ) { @@ -406,18 +412,13 @@ void UISceneNode::setStyleSheet( const std::string& inlineStyleSheet ) { setStyleSheet( parser.getStyleSheet() ); } -void UISceneNode::combineStyleSheet( const CSS::StyleSheet& styleSheet, bool forceReloadStyle, - URI baseURI ) { - mStyleSheet.combineStyleSheet( styleSheet ); - +void UISceneNode::updateStyleSheet( bool forceReloadStyle ) { bool mediaChanged = false; if ( !mStyleSheet.isMediaQueryListEmpty() && mStyleSheet.updateMediaLists( getMediaFeatures() ) ) { mediaChanged = true; } - processStyleSheetAtRules( styleSheet, baseURI ); - if ( mRoot && mRoot->getUIStyle() ) mRoot->getUIStyle()->resetGlobalDefinition(); @@ -428,6 +429,20 @@ void UISceneNode::combineStyleSheet( const CSS::StyleSheet& styleSheet, bool for reloadStyle(); } +void UISceneNode::combineStyleSheet( const CSS::StyleSheet& styleSheet, bool forceReloadStyle, + URI baseURI ) { + mStyleSheet.combineStyleSheet( styleSheet ); + + processStyleSheetAtRules( styleSheet, baseURI ); + + if ( mIsLoading ) { + mStyleDuringLoad = true; + return; + } + + updateStyleSheet( forceReloadStyle ); +} + void UISceneNode::combineStyleSheet( const std::string& inlineStyleSheet, bool forceReloadStyle, const Uint32& marker, URI baseURI ) { CSS::StyleSheetParser parser; diff --git a/src/eepp/ui/uiwidgetcreator.cpp b/src/eepp/ui/uiwidgetcreator.cpp index ed83504e2..7c0e54505 100644 --- a/src/eepp/ui/uiwidgetcreator.cpp +++ b/src/eepp/ui/uiwidgetcreator.cpp @@ -149,6 +149,7 @@ void UIWidgetCreator::createBaseWidgetList() { registeredWidget["del"] = UITextSpan::NewStrikethrough; registeredWidget["font"] = UITextSpan::NewFont; registeredWidget["code"] = UITextSpan::NewCode; + registeredWidget["tt"] = [] { return UITextSpan::NewWithTag( "tt" ); }; registeredWidget["mark"] = UITextSpan::NewMark; registeredWidget["div"] = UIRichText::NewDiv; registeredWidget["p"] = UIRichText::NewParagraph; diff --git a/src/modules/eterm/src/eterm/terminal/terminaldisplay.cpp b/src/modules/eterm/src/eterm/terminal/terminaldisplay.cpp index 771835fdc..b7553e162 100644 --- a/src/modules/eterm/src/eterm/terminal/terminaldisplay.cpp +++ b/src/modules/eterm/src/eterm/terminal/terminaldisplay.cpp @@ -1359,23 +1359,29 @@ void TerminalDisplay::drawGrid( const Vector2f& pos ) { auto advanceX = spaceCharAdvanceX * ( isWide ? 2.0f : 1.0f ); if ( glyph.mode & ATTR_WDUMMY ) { - if ( mVBForeground ) + if ( mVBForeground ) { mVBForeground->setQuadColor( mCurGridPos, Color::Transparent ); + dirtyFG = true; + } continue; } if ( glyph.u == 32 && !( glyph.mode & ( ATTR_UNDERLINE | ATTR_STRUCK ) ) ) { x += advanceX; - if ( mVBForeground ) + if ( mVBForeground ) { mVBForeground->setQuadColor( mCurGridPos, Color::Transparent ); + dirtyFG = true; + } continue; } if ( glyph.mode & ATTR_BOXDRAW ) { auto bd = TerminalEmulator::boxdrawindex( &glyph ); drawbox( x, y, advanceX, lineHeight, fg, bg, bd ); - if ( mVBForeground ) + if ( mVBForeground ) { mVBForeground->setQuadColor( mCurGridPos, Color::Transparent ); + dirtyFG = true; + } } else { auto* gd = mFont->getGlyphDrawable( glyph.u, mFontSize, glyph.mode & ATTR_BOLD, glyph.mode & ATTR_ITALIC, 0 ); diff --git a/src/modules/eterm/src/eterm/terminal/terminalemulator.cpp b/src/modules/eterm/src/eterm/terminal/terminalemulator.cpp index fe633c99e..7bc0966f6 100644 --- a/src/modules/eterm/src/eterm/terminal/terminalemulator.cpp +++ b/src/modules/eterm/src/eterm/terminal/terminalemulator.cpp @@ -2740,6 +2740,7 @@ int TerminalEmulator::twrite( const char* buf, int buflen, int show_ctrl ) { u = buf[n] & 0xFF; charsize = 1; } + if ( show_ctrl && ISCONTROL( u ) ) { if ( u & 0x80 ) { u &= 0x7f; diff --git a/src/tools/ecode/plugins/spellchecker/spellcheckerplugin.cpp b/src/tools/ecode/plugins/spellchecker/spellcheckerplugin.cpp index c27eab15e..dccc38b29 100644 --- a/src/tools/ecode/plugins/spellchecker/spellcheckerplugin.cpp +++ b/src/tools/ecode/plugins/spellchecker/spellcheckerplugin.cpp @@ -424,7 +424,8 @@ void SpellCheckerPlugin::drawAfterLineText( UICodeEditor* editor, const Int64& i for ( size_t i = 0; i < matches.size(); ++i ) { auto& match = matches[i]; - if ( match.lineHash != doc->getLineHash( index ) ) + if ( match.lineHash != doc->getLineHash( index ) || + doc->getLineLength( index ) > ( EE_1KB * 10 ) ) return; Text line( "", editor->getFont(), editor->getFontSize() );