[Commits] [wesnoth/wesnoth] fb700d: Fix "failed to place a grid" messages when partial...

GitHub noreply at github.com
Fri Mar 24 18:54:05 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: fb700d775f0e98080247f39d8d7ae8aae805de00
      https://github.com/wesnoth/wesnoth/commit/fb700d775f0e98080247f39d8d7ae8aae805de00
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2017-03-24 (Fri, 24 Mar 2017)

  Changed paths:
    M src/gui/widgets/grid.cpp
    M src/gui/widgets/widget.hpp

  Log Message:
  -----------
  Fix "failed to place a grid" messages when partial relayout is used

The problem was that some widgets which wrap a grid didn't have their
cached sizes thrown away when the grid itself did. As a result, when the
parent grid of such a widget tried partial relayout, it discovered that the
widget fits just fine (according to the cached size) and attempted to lay
it out without shrinking it first. Then the grid found that it was given
much less space than it would prefer, and printed the error message.

Fixed by discarding cached sizes of such widgets.


  Commit: 9b1ca36b5c8ad353daf5881d65adfd8ba843381c
      https://github.com/wesnoth/wesnoth/commit/9b1ca36b5c8ad353daf5881d65adfd8ba843381c
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2017-03-24 (Fri, 24 Mar 2017)

  Changed paths:
    M src/gui/widgets/scroll_label.cpp
    M src/gui/widgets/scrollbar_container.cpp

  Log Message:
  -----------
  Remove layout_initialise() calls from content_resize_request()

The calls were there to work around automatic rewrapping of text caused by
a hack in `scroll_label::set_label()`. @Vultraz removed that hack in commit
ae76bb0efbc53f102cc772ace3941c5867e2c91c. After that, there wasn't any
reason to call `layout_initialise()` any more.

Well, other than that removal of scrollbars set as `AUTO_VISIBLE_FIRST_RUN`
relied on full layout initialization. I implemented a secondary, faster
mechanism for that.

This commit removes unnecessary code, and speeds up switching between
add-ons in the add-on manager further still.


Compare: https://github.com/wesnoth/wesnoth/compare/5397c1eabc21...9b1ca36b5c8a


More information about the Commits mailing list