Skip to content

Commit

Permalink
Workaround for bug #24780, courtesy of gfgtdf
Browse files Browse the repository at this point in the history
This isn't the cleanest fix, but it suffices for now.
  • Loading branch information
Vultraz committed Aug 12, 2016
1 parent 265e41d commit f5210fa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/gui/widgets/scrollbar_container.cpp
Expand Up @@ -324,10 +324,22 @@ tpoint tscrollbar_container::calculate_best_size() const
assert(content_grid_);
const tpoint content = content_grid_->get_best_size();

const tpoint result(
tpoint result(
vertical_scrollbar.x + std::max(horizontal_scrollbar.x, content.x),
horizontal_scrollbar.y + std::max(vertical_scrollbar.y, content.y));

//
// Workaround for bug #24780. This should probably be moved somewhere more specific to
// the listbox, but for now it suffices.
//
if(const tgrid* header = find_widget<const tgrid>(&grid(), "_header_grid", false, false)) {
result.y += header->get_best_size().y;
}

if(const tgrid* footer = find_widget<const tgrid>(&grid(), "_footer_grid", false, false)) {
result.y += footer->get_best_size().y;
}

DBG_GUI_L << LOG_HEADER << " vertical_scrollbar " << vertical_scrollbar
<< " horizontal_scrollbar " << horizontal_scrollbar << " content "
<< content << " result " << result << ".\n";
Expand Down

0 comments on commit f5210fa

Please sign in to comment.