A couple of minor changes.

This commit is contained in:
Martín Lucas Golini
2025-03-07 00:14:41 -03:00
parent 48dbedafef
commit 0dba4a222b
3 changed files with 13 additions and 3 deletions

View File

@@ -56,8 +56,10 @@ UIApplication::UIApplication( const WindowSettings& windowSettings, const Settin
? appSettings.monospaceFont
: FontTrueType::New( "monospace", "assets/fonts/DejaVuSansMono.ttf" );
if ( monospaceFont && monospaceFont->getType() == FontType::TTF )
if ( monospaceFont && monospaceFont->getType() == FontType::TTF ) {
static_cast<FontTrueType*>( monospaceFont )->setEnableDynamicMonospace( true );
FontFamily::loadFromRegular( static_cast<FontTrueType*>( monospaceFont ) );
}
if ( appSettings.emojiFont == nullptr )
FontTrueType::New( "NotoEmoji-Regular", "assets/fonts/NotoEmoji-Regular.ttf" );

View File

@@ -59,7 +59,7 @@ UIListBox::UIListBox( const std::string& tag ) :
mVScrollBar->setEnabled( false )->setVisible( false );
mVScrollBar->addEventListener( Event::OnSizeChange, cb );
mVScrollBar->addEventListener( Event::OnValueChange,
[this] ( auto event ) { onScrollValueChange( event ); } );
[this]( auto event ) { onScrollValueChange( event ); } );
mHScrollBar = UIScrollBar::NewHorizontal();
mHScrollBar->setParent( this );
@@ -68,7 +68,7 @@ UIListBox::UIListBox( const std::string& tag ) :
mHScrollBar->setEnabled( false )->setVisible( false );
mHScrollBar->addEventListener( Event::OnSizeChange, cb );
mHScrollBar->addEventListener( Event::OnValueChange,
[this] ( auto event ) { onHScrollValueChange( event ); } );
[this]( auto event ) { onHScrollValueChange( event ); } );
mDummyItem = createListBoxItem( "" );
mDummyItem->setSize( 0, 0 );
@@ -699,6 +699,12 @@ UIListBoxItem* UIListBox::getItem( const Uint32& Index ) const {
return mItems[Index];
}
const String& UIListBox::getItemText( const Uint32& Index ) const {
eeASSERT( Index < mItems.size() );
return mTexts[Index];
}
UIListBoxItem* UIListBox::getItemSelected() {
if ( mSelected.size() ) {
if ( NULL == mItems[mSelected.front()] )