Skip to content

Commit

Permalink
gui1: Fix incorrect menu item size constraints
Browse files Browse the repository at this point in the history
Regression from d1f026d.
  • Loading branch information
irydacea committed Mar 13, 2021
1 parent 0d5c2b1 commit 57b89d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/widgets/menu.cpp
Expand Up @@ -921,7 +921,10 @@ void menu::draw_row(const std::size_t row_index, const SDL_Rect& rect, ROW_TYPE
const SDL_Rect& text_size = font::pango_text_area(str,style_->get_font_size());
const std::size_t y = rect.y + (rect.h - text_size.h)/2;
const std::size_t padding = 2;
font::pango_draw_text(&video(),column,style_->get_font_size(),font::NORMAL_COLOR,str,
SDL_Rect text_rect = column;
text_rect.w = rect.w - (xpos - rect.x) - 2 * style_->get_thickness();
text_rect.h = text_size.h;
font::pango_draw_text(&video(), text_rect, style_->get_font_size(), font::NORMAL_COLOR, str,
(type == HEADING_ROW ? xpos+padding : xpos), y);

if(type == HEADING_ROW && sortby_ == int(i)) {
Expand Down

0 comments on commit 57b89d2

Please sign in to comment.