diff --git a/include/eepp/ui/uislider.hpp b/include/eepp/ui/uislider.hpp index 76e464772..49055de26 100644 --- a/include/eepp/ui/uislider.hpp +++ b/include/eepp/ui/uislider.hpp @@ -34,11 +34,11 @@ class EE_API UISlider : public UIWidget { const Float& getValue() const; - virtual void setMinValue( const Float& MinVal ); + virtual void setMinValue( const Float& minVal ); const Float& getMinValue() const; - virtual void setMaxValue( const Float& MaxVal ); + virtual void setMaxValue( const Float& maxVal ); const Float& getMaxValue() const; diff --git a/src/eepp/ui/uislider.cpp b/src/eepp/ui/uislider.cpp index 2c0c95faf..eafb85a0d 100644 --- a/src/eepp/ui/uislider.cpp +++ b/src/eepp/ui/uislider.cpp @@ -369,26 +369,30 @@ const Float& UISlider::getValue() const { return mValue; } -void UISlider::setMinValue( const Float& MinVal ) { - mMinValue = MinVal; +void UISlider::setMinValue( const Float& minVal ) { + if ( minVal != mMinValue ) { + mMinValue = minVal; - if ( mValue < mMinValue ) - mValue = mMinValue; + if ( mValue < mMinValue ) + mValue = mMinValue; - fixSliderPos(); + fixSliderPos(); + } } const Float& UISlider::getMinValue() const { return mMinValue; } -void UISlider::setMaxValue( const Float& MaxVal ) { - mMaxValue = MaxVal; +void UISlider::setMaxValue( const Float& maxVal ) { + if ( maxVal != mMaxValue ) { + mMaxValue = maxVal; - if ( mValue > mMaxValue ) - mValue = mMaxValue; + if ( mValue > mMaxValue ) + mValue = mMaxValue; - fixSliderPos(); + fixSliderPos(); + } } const Float& UISlider::getMaxValue() const { diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index be0023512..7bc7174f8 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -244,9 +244,9 @@ void App::updateEditorTabTitle( UICodeEditor* editor ) { if ( editor->getData() ) { UITab* tab = (UITab*)editor->getData(); auto doc = editor->getDocumentRef(); - tab->setText( doc->getFilename() ); + std::string fileName( doc->getFilename() ); - if ( tab->getText() != doc->getDefaultFileName() && !isUniqueTabTitle( tab ) ) { + if ( fileName != doc->getDefaultFileName() && !isUniqueTabTitle( tab ) ) { auto tabsTitles = getUniqueNameForTabs( getTabWithSameTitle( tab ) ); for ( auto [ntab, title] : tabsTitles ) { ntab->setText( title ); @@ -255,6 +255,7 @@ void App::updateEditorTabTitle( UICodeEditor* editor ) { } } else if ( tab->getOwnedWidget()->isType( UI_TYPE_CODEEDITOR ) ) { tab->getOwnedWidget()->asType()->removeClass( NOT_UNIQUE_FILENAME ); + tab->setText( fileName ); } bool dirty = doc->isDirty();