diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-10-21 10:37:44 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-10-21 10:37:44 +0000 |
commit | 1f6ef95ca6bc8972d16b5b3c97e4fe4797fdf97d (patch) | |
tree | ea54001bf4fffec21472e88c680d70ae379e00d9 /src | |
parent | 139346a2f195ee352c09f9cbb4a3b644ac8b2700 (diff) | |
download | mana-1f6ef95ca6bc8972d16b5b3c97e4fe4797fdf97d.tar.gz mana-1f6ef95ca6bc8972d16b5b3c97e4fe4797fdf97d.tar.bz2 mana-1f6ef95ca6bc8972d16b5b3c97e4fe4797fdf97d.tar.xz mana-1f6ef95ca6bc8972d16b5b3c97e4fe4797fdf97d.zip |
Allowed for decreasing sizes in layout.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/layout.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp index 9d0b4791..228eac74 100644 --- a/src/gui/widgets/layout.cpp +++ b/src/gui/widgets/layout.cpp @@ -142,15 +142,16 @@ std::vector< int > Layout::compute(int dim, int upp) if (mSizes[dim][i] == FILL) ++nbFill; if (sizes[i] == FILL) sizes[i] = 0; else upp -= sizes[i]; + upp -= mPadding; } upp += mPadding; - if (upp <= 0 || nbFill == 0) return sizes; + if (nbFill == 0) return sizes; for (int i = 0; i < nb; ++i) { if (mSizes[dim][i] != FILL) continue; - int s = (upp + nbFill / 2) / nbFill; + int s = upp / nbFill; sizes[i] += s; upp -= s; --nbFill; |