diff --git a/src/eepp/ui/uilinearlayout.cpp b/src/eepp/ui/uilinearlayout.cpp index fc6325c6d..5d422cfae 100644 --- a/src/eepp/ui/uilinearlayout.cpp +++ b/src/eepp/ui/uilinearlayout.cpp @@ -278,10 +278,12 @@ void UILinearLayout::packVertical() { if ( !( 0 != getLayoutWeight() && getParent()->isType( UI_TYPE_LINEAR_LAYOUT ) && getParent()->asType()->getOrientation() == UIOrientation::Horizontal ) ) { - setInternalPixelsWidth( maxX ); - mPacking = false; - packVertical(); - notifyLayoutAttrChangeParent(); + if ( mMinWidthEq.empty() || PixelDensity::dpToPx( mMinSize.getWidth() ) < maxX ) { + setInternalPixelsWidth( maxX ); + mPacking = false; + packVertical(); + notifyLayoutAttrChangeParent(); + } } } @@ -399,10 +401,12 @@ void UILinearLayout::packHorizontal() { if ( !( 0 != getLayoutWeight() && getParent()->isType( UI_TYPE_LINEAR_LAYOUT ) && getParent()->asType()->getOrientation() == UIOrientation::Vertical ) ) { - setInternalPixelsHeight( maxY ); - mPacking = false; - packHorizontal(); - notifyLayoutAttrChangeParent(); + if ( mMinHeightEq.empty() || PixelDensity::dpToPx( mMinSize.getHeight() ) < maxY ) { + setInternalPixelsHeight( maxY ); + mPacking = false; + packHorizontal(); + notifyLayoutAttrChangeParent(); + } } } diff --git a/src/tools/ecode/applayout.xml.hpp b/src/tools/ecode/applayout.xml.hpp index 43a3d7279..ba89512c7 100644 --- a/src/tools/ecode/applayout.xml.hpp +++ b/src/tools/ecode/applayout.xml.hpp @@ -149,6 +149,7 @@ TableView#locate_bar_table > tableview::row:selected > tableview::cell:nth-child #status_bar { background-color: var(--list-back); padding-top: 1dp; + min-height: 16dp; } #status_bar > .status_but { padding: 0dp 5dp 0dp 4dp; diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index 766dd316d..4acf67a2d 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -2690,7 +2690,7 @@ void App::consoleToggle() { mSplitter->getCurWidget()->setFocus(); } -void App::initProjectTreeView( std::string path ) { +void App::initProjectTreeView( std::string path, bool openClean ) { mProjectViewEmptyCont = mUISceneNode->find( "project_view_empty" ); mProjectViewEmptyCont->find( "open_folder" ) ->on( Event::MouseClick, [this]( const Event* event ) { @@ -2834,7 +2834,7 @@ void App::initProjectTreeView( std::string path ) { mSettings->updateProjectSettingsMenu(); } } - } else if ( mConfig.workspace.restoreLastSession && !mRecentFolders.empty() ) { + } else if ( mConfig.workspace.restoreLastSession && !mRecentFolders.empty() && !openClean ) { loadFolder( mRecentFolders[0] ); } else { updateOpenRecentFolderBtn(); @@ -3008,7 +3008,7 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe const std::string& colorScheme, bool terminal, bool frameBuffer, bool benchmarkMode, const std::string& css, bool health, const std::string& healthLang, FeaturesHealth::OutputFormat healthFormat, const std::string& fileToOpen, - bool stdOutLogs, bool disableFileLogs ) { + bool stdOutLogs, bool disableFileLogs, bool openClean ) { DisplayManager* displayManager = Engine::instance()->getDisplayManager(); Display* currentDisplay = displayManager->getDisplayIndex( 0 ); mDisplayDPI = currentDisplay->getDPI(); @@ -3336,7 +3336,7 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe showStatusBar( false ); mTerminalManager->createNewTerminal(); } else { - initProjectTreeView( file ); + initProjectTreeView( file, openClean ); } mFileToOpen = fileToOpen; @@ -3476,6 +3476,9 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) { { "convert-lang-output" }, "" ); args::Flag disableFileLogs( parser, "disable-file-logs", "Disables writing logs to a log file", { "disable-file-logs" } ); + args::Flag openClean( parser, "open-clean", + "Open a new instance of ecode without recovering the last session", + { "open-clean", 'x' } ); std::vector args; try { @@ -3543,7 +3546,8 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) { pixelDenstiyConf ? pixelDenstiyConf.Get() : 0.f, prefersColorScheme ? prefersColorScheme.Get() : "", terminal.Get(), fb.Get(), benchmarkMode.Get(), css.Get(), health || healthLang, healthLang.Get(), - healthFormat.Get(), file.Get(), verbose.Get(), disableFileLogs.Get() ); + healthFormat.Get(), file.Get(), verbose.Get(), disableFileLogs.Get(), + openClean.Get() ); eeSAFE_DELETE( appInstance ); Engine::destroySingleton(); diff --git a/src/tools/ecode/ecode.hpp b/src/tools/ecode/ecode.hpp index 1d61a83e5..e20a43020 100644 --- a/src/tools/ecode/ecode.hpp +++ b/src/tools/ecode/ecode.hpp @@ -31,7 +31,7 @@ class SettingsMenu; class App : public UICodeEditorSplitter::Client { public: - App( const size_t& jobs = 0, const std::vector& args = {} ); + explicit App( const size_t& jobs = 0, const std::vector& args = {} ); ~App(); @@ -39,7 +39,7 @@ class App : public UICodeEditorSplitter::Client { const std::string& colorScheme, bool terminal, bool frameBuffer, bool benchmarkMode, const std::string& css, bool health, const std::string& healthLang, ecode::FeaturesHealth::OutputFormat healthFormat, const std::string& fileToOpen, - bool stdOutLogs, bool disableFileLogs ); + bool stdOutLogs, bool disableFileLogs, bool openClean ); void createWidgetInspector(); @@ -499,7 +499,7 @@ class App : public UICodeEditorSplitter::Client { void initLocateBar(); - void initProjectTreeView( std::string path ); + void initProjectTreeView( std::string path, bool openClean ); void initImageView();