[Commits] [wesnoth/wesnoth] 78f026: Fix: container_base with explicit minimum size can...

GitHub noreply at github.com
Sat Dec 17 16:13:10 UTC 2016


  Branch: refs/heads/grid-size-control
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 78f026280d30ec02a3b2e26b341e56422e6a8532
      https://github.com/wesnoth/wesnoth/commit/78f026280d30ec02a3b2e26b341e56422e6a8532
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2016-12-17 (Sat, 17 Dec 2016)

  Changed paths:
    M src/gui/widgets/container_base.cpp

  Log Message:
  -----------
  Fix: container_base with explicit minimum size can't shrink below that

Composite widgets, i.e. widgets which inherit container_base, such as the
unit preview pane, can have an explicit minimum size set in their
definition. The widget will request either that size or however much space
the child widgets want, whichever is higher.

If
* the minimum size was higher,
* there isn't enough space for that size, and
* there would be enough space for the underlying grid not to shrink,

then the attempt to reduce the size of the composite widget doesn't do
anything. The container_base tells the grid to shrink, but the grid is
already small enough to fit inside the given space. Thus, the grid doesn't
do anything. In addition, the container_base doesn't change its own size
afterwards.

This commit fixes the issue and allows composite widgets to shrink.





More information about the Commits mailing list