diff --git a/bin/assets/plugins/aiassistant.json b/bin/assets/plugins/aiassistant.json index ab9352a70..2ca5ba9d7 100644 --- a/bin/assets/plugins/aiassistant.json +++ b/bin/assets/plugins/aiassistant.json @@ -96,35 +96,40 @@ "api_url": "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions", "models": [ { + "name": "gemini-1.5-pro", "display_name": "Gemini 1.5 Pro", - "max_tokens": 2000000, - "name": "gemini-1.5-pro" + "max_tokens": 2000000 }, { + "name": "gemini-1.5-flash", "display_name": "Gemini 1.5 Flash", - "max_tokens": 1000000, - "name": "gemini-1.5-flash" + "max_tokens": 1000000 }, { + "name": "gemini-2.0-pro-exp", "display_name": "Gemini 2.0 Pro", - "max_tokens": 2000000, - "name": "gemini-2.0-pro-exp" + "max_tokens": 2000000 }, { + "name": "gemini-2.0-flash", "display_name": "Gemini 2.0 Flash", - "max_tokens": 1000000, - "name": "gemini-2.0-flash" + "max_tokens": 1000000 }, { + "name": "gemini-2.0-flash-thinking-exp", "display_name": "Gemini 2.0 Flash Thinking", - "max_tokens": 1000000, - "name": "gemini-2.0-flash-thinking-exp" + "max_tokens": 1000000 }, { + "name": "gemini-2.0-flash-lite-preview", "display_name": "Gemini 2.0 Flash Lite", "max_tokens": 1000000, - "name": "gemini-2.0-flash-lite-preview", "cheapest": true + }, + { + "name": "gemini-2.5-pro-exp-03-25", + "display_name": "Gemini 2.5 Pro Experimental 03-25", + "max_tokens": 1000000 } ] }, diff --git a/include/eepp/ui/uiscrollview.hpp b/include/eepp/ui/uiscrollview.hpp index a73aef89e..32c876e90 100644 --- a/include/eepp/ui/uiscrollview.hpp +++ b/include/eepp/ui/uiscrollview.hpp @@ -37,6 +37,8 @@ class EE_API UIScrollView : public UITouchDraggableWidget { UIWidget* getContainer() const; + Node* getScrollView() const; + virtual bool applyProperty( const StyleSheetProperty& attribute ); virtual std::string getPropertyString( const PropertyDefinition* propertyDef, @@ -44,6 +46,10 @@ class EE_API UIScrollView : public UITouchDraggableWidget { virtual std::vector getPropertiesImplemented() const; + bool isAutoSetClipStep() const; + + void setAutoSetClipStep( bool setClipStep ); + protected: ScrollViewType mViewType; ScrollBarMode mVScrollMode; @@ -54,6 +60,7 @@ class EE_API UIScrollView : public UITouchDraggableWidget { Node* mScrollView; Uint32 mSizeChangeCb; Uint32 mPosChangeCb; + bool mAutoSetClipStep{ true }; virtual Uint32 onMessage( const NodeMessage* Msg ); diff --git a/src/eepp/ui/abstract/uiabstracttableview.cpp b/src/eepp/ui/abstract/uiabstracttableview.cpp index 8fd6feb09..c8e38daef 100644 --- a/src/eepp/ui/abstract/uiabstracttableview.cpp +++ b/src/eepp/ui/abstract/uiabstracttableview.cpp @@ -141,8 +141,6 @@ void UIAbstractTableView::resetColumnData() { ColumnData& col = columnData( i ); col.minWidth = 0; col.maxWidth = 0; - if ( !col.manuallySet ) - col.width = 0; } } diff --git a/src/eepp/ui/doc/languages/cpp.cpp b/src/eepp/ui/doc/languages/cpp.cpp index bb5761e89..af9422ad3 100644 --- a/src/eepp/ui/doc/languages/cpp.cpp +++ b/src/eepp/ui/doc/languages/cpp.cpp @@ -9,7 +9,7 @@ void addCPP() { { "C++", { "%.cpp$", "%.cc$", "%.cxx$", "%.c++$", "%.hh$", "%.inl$", "%.hxx$", "%.hpp$", "%.h++$", - "%.tcc$" }, + "%.tcc$", "%.C$", "%.H$", "%.h++$", "%.ino$", "%.cu$", "%.cuh$" }, { { { "R%\"(xml)%(", "%)(xml)%\"" }, { "string", "keyword2", "keyword2" }, "XML" }, { { "R%\"(css)%(", "%)(css)%\"" }, { "string", "keyword2", "keyword2" }, "CSS" }, diff --git a/src/eepp/ui/doc/languages/json.cpp b/src/eepp/ui/doc/languages/json.cpp index 202f319b6..b6e797212 100644 --- a/src/eepp/ui/doc/languages/json.cpp +++ b/src/eepp/ui/doc/languages/json.cpp @@ -24,6 +24,7 @@ void addJSON() { { { "false", "literal" }, { "true", "literal" }, + { "null", "literal" }, }, "//", diff --git a/src/eepp/ui/doc/syntaxtokenizer.cpp b/src/eepp/ui/doc/syntaxtokenizer.cpp index 351d07166..248c6c57f 100644 --- a/src/eepp/ui/doc/syntaxtokenizer.cpp +++ b/src/eepp/ui/doc/syntaxtokenizer.cpp @@ -264,7 +264,7 @@ _tokenize( const SyntaxDefinition& syntax, const std::string& text, const Syntax size_t size = text.size(); std::string patternStr; - std::string patternText; + std::string_view patternText; while ( i < size ) { if ( curState.currentPatternIdx != SYNTAX_TOKENIZER_STATE_NONE ) { @@ -383,7 +383,11 @@ _tokenize( const SyntaxDefinition& syntax, const std::string& text, const Syntax } patternText = textv.substr( start, end - start ); - SyntaxStyleType type = curState.currentSyntax->getSymbol( patternText ); + SyntaxStyleType type = + curMatch < pattern.types.size() && + pattern.types[curMatch] == SyntaxStyleTypes::Symbol + ? curState.currentSyntax->getSymbol( std::string{ patternText } ) + : SyntaxStyleEmpty(); if ( !skipSubSyntaxSeparator || !pattern.hasSyntax() ) { pushToken( tokens, type == SyntaxStyleEmpty() @@ -435,7 +439,11 @@ _tokenize( const SyntaxDefinition& syntax, const std::string& text, const Syntax end = start + ( strEnd - strStart ); } patternText = textv.substr( start, end - start ); - SyntaxStyleType type = curState.currentSyntax->getSymbol( patternText ); + SyntaxStyleType type = + curMatch < pattern.types.size() && + pattern.types[curMatch] == SyntaxStyleTypes::Symbol + ? curState.currentSyntax->getSymbol( std::string{ patternText } ) + : SyntaxStyleEmpty(); if ( !skipSubSyntaxSeparator || !pattern.hasSyntax() ) { pushToken( tokens, type == SyntaxStyleEmpty() @@ -447,7 +455,7 @@ _tokenize( const SyntaxDefinition& syntax, const std::string& text, const Syntax } if ( pattern.hasSyntax() ) { pushSubsyntax( curState, retState, pattern, patternIndex + 1, - patternText ); + std::string{ patternText } ); } else if ( pattern.patterns.size() > 1 ) { setSubsyntaxPatternIdx( curState, retState, patternIndex + 1 ); } diff --git a/src/eepp/ui/uiimage.cpp b/src/eepp/ui/uiimage.cpp index f7b8a6dc1..b14fa8de4 100644 --- a/src/eepp/ui/uiimage.cpp +++ b/src/eepp/ui/uiimage.cpp @@ -88,18 +88,20 @@ UIImage* UIImage::setDrawable( Drawable* drawable, bool ownIt ) { void UIImage::onAutoSize() { if ( NULL != mDrawable ) { - if ( ( mFlags & UI_AUTO_SIZE ) && Sizef::Zero == getSize() ) - setInternalSize( mDrawable->getSize().asInt().asFloat() ); + if ( ( mFlags & UI_AUTO_SIZE ) && Sizef::Zero == getPixelsSize() ) + setInternalPixelsSize( mDrawable->getPixelsSize().asInt().asFloat() ); - Sizef size( getSize() ); + Sizef size( getPixelsSize() ); if ( mWidthPolicy == SizePolicy::WrapContent ) - size.x = ( (int)mDrawable->getSize().getWidth() + mPadding.Left + mPadding.Right ); + size.x = + ( (int)mDrawable->getPixelsSize().getWidth() + mPaddingPx.Left + mPaddingPx.Right ); if ( mHeightPolicy == SizePolicy::WrapContent ) - size.y = ( (int)mDrawable->getSize().getHeight() + mPadding.Top + mPadding.Bottom ); + size.y = ( (int)mDrawable->getPixelsSize().getHeight() + mPaddingPx.Top + + mPaddingPx.Bottom ); - setSize( size ); + setPixelsSize( size ); } } @@ -124,7 +126,7 @@ void UIImage::calcDestSize() { mDestSize = pxSize; } } else if ( mDrawable ) { - mDestSize = mDrawable->getSize(); + mDestSize = mDrawable->getPixelsSize(); } mDestSize = mDestSize.floor(); diff --git a/src/eepp/ui/uiscrollview.cpp b/src/eepp/ui/uiscrollview.cpp index dfe8ee4b3..dad17be91 100644 --- a/src/eepp/ui/uiscrollview.cpp +++ b/src/eepp/ui/uiscrollview.cpp @@ -136,6 +136,10 @@ UIWidget* UIScrollView::getContainer() const { return mContainer; } +Node* UIScrollView::getScrollView() const { + return mScrollView; +} + void UIScrollView::containerUpdate() { if ( NULL == mScrollView ) return; @@ -195,13 +199,17 @@ void UIScrollView::containerUpdate() { ( mVScroll->isVisible() ? mVScroll->getSize().getWidth() : 0 ), mHScroll->getSize().getHeight() ); - if ( mVScroll->isVisible() && 0 != mScrollView->getSize().getHeight() ) - mVScroll->setPageStep( (Float)mContainer->getSize().getHeight() / - (Float)mScrollView->getSize().getHeight() ); + if ( mVScroll->isVisible() && 0 != mScrollView->getSize().getHeight() ){ + mVScroll->setPageStep( mContainer->getSize().getHeight() / + mScrollView->getSize().getHeight() ); + + if ( mAutoSetClipStep ) + mVScroll->setClickStep( mVScroll->getPageStep() / 4.f ); + } if ( mHScroll->isVisible() && 0 != mScrollView->getSize().getWidth() ) { - mHScroll->setPageStep( (Float)mContainer->getSize().getWidth() / - (Float)mScrollView->getSize().getWidth() ); + mHScroll->setPageStep( mContainer->getSize().getWidth() / + mScrollView->getSize().getWidth() ); } updateScroll(); @@ -365,4 +373,12 @@ Uint32 UIScrollView::onMessage( const NodeMessage* Msg ) { return UITouchDraggableWidget::onMessage( Msg ); } +bool UIScrollView::isAutoSetClipStep() const { + return mAutoSetClipStep; +} + +void UIScrollView::setAutoSetClipStep( bool setClipStep ) { + mAutoSetClipStep = setClipStep; +} + }} // namespace EE::UI diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index 9c9d117a8..816b0a6e2 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -3451,6 +3451,12 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe Http::setThreadPool( mThreadPool ); DisplayManager* displayManager = Engine::instance()->getDisplayManager(); Display* currentDisplay = displayManager->getDisplayIndex( 0 ); + + if ( currentDisplay == nullptr ) { + std::cerr << "Display not found, exiting" << std::endl; + return; + } + mIncognito = incognito; mPortableMode = portable; mDisplayDPI = currentDisplay->getDPI(); @@ -3613,7 +3619,7 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe Log::info( "%s (codename: \"%s\") initializing", ecode::Version::getVersionFullName(), ecode::Version::getCodename() ); - if ( mWindow->isOpen() ) { + if ( mWindow && mWindow->isOpen() ) { // Only verify GPU driver availability on Windows. // macOS will have at least a fallback renderer // Linux will have at least Mesa drivers with LLVM Pipe diff --git a/src/tools/ecode/plugins/aiassistant/chatui.cpp b/src/tools/ecode/plugins/aiassistant/chatui.cpp index c7ab4977c..27e067435 100644 --- a/src/tools/ecode/plugins/aiassistant/chatui.cpp +++ b/src/tools/ecode/plugins/aiassistant/chatui.cpp @@ -130,7 +130,7 @@ DropDownList.role_ui { - +