Skip to content

Commit

Permalink
Merge pull request #61284 from ZeroInternalReflection/StringInputPopu…
Browse files Browse the repository at this point in the history
…pWidth

Fix popup for modifying string options
  • Loading branch information
dseguin authored Sep 27, 2022
2 parents 301a476 + 573ca9a commit 328359e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ void options_manager::cOpt::setNext()
int iMenuTextLength = utf8_width( sMenuText.translated() );
string_input_popup()
.width( iMaxLength > 80 ? 80 : iMaxLength < iMenuTextLength ? iMenuTextLength : iMaxLength + 1 )
.description( sMenuText.translated() )
.title( sMenuText.translated() )
.max_length( iMaxLength )
.edit( sSet );

Expand Down
10 changes: 6 additions & 4 deletions src/string_input_popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ void string_input_popup::draw( ui_adaptor *const ui, const utf8_wrapper &ret,
draw_border( w_full );
wnoutrefresh( w_full );

int pos_y = 0;
for( int i = 0; i < static_cast<int>( title_split.size() ) - 1; i++ ) {
mvwprintz( w_title_and_entry, point( i, pos_y++ ), _title_color, title_split[i] );
if( !_title.empty() ) {
int pos_y = 0;
for( int i = 0; i < static_cast<int>( title_split.size() ) - 1; i++ ) {
mvwprintz( w_title_and_entry, point( i, pos_y++ ), _title_color, title_split[i] );
}
trim_and_print( w_title_and_entry, point( 0, pos_y ), titlesize, _title_color, title_split.back() );
}
trim_and_print( w_title_and_entry, point( 0, pos_y ), titlesize, _title_color, title_split.back() );
}

const int scrmax = _endx - _startx;
Expand Down

0 comments on commit 328359e

Please sign in to comment.