diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2013-05-10 10:28:03 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-10 13:19:56 +0200 |
commit | 015acded4a6be165c30d088747f740933fa79483 (patch) | |
tree | b8688828c3b6e5eac7b355ee9f8b2d9f2581842d /src/controls/SplitView.qml | |
parent | 9402917fac71d71a96154c11cb401534fa3b7ea3 (diff) | |
download | qtquickcontrols-015acded4a6be165c30d088747f740933fa79483.tar.gz |
Remove unneeded checks for -1 (infinity) in SplitView
With commit 16558ac71509fe51a4cf18f238e4f61b37323fe4
Layout.maximumWidth and Layout.maximumHeight now returns
Number.POSITIVE_INFINITY instead of -1.
As described in that commit, comparisons against those properties
does not need any special handling for -1 anymore.
Change-Id: I8d4bba0fa87f9c67ac30dd40a8be8cb99abba283
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/controls/SplitView.qml')
-rw-r--r-- | src/controls/SplitView.qml | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/controls/SplitView.qml b/src/controls/SplitView.qml index 0c50bc3b..fc43874e 100644 --- a/src/controls/SplitView.qml +++ b/src/controls/SplitView.qml @@ -231,9 +231,9 @@ Item { function clampedMinMax(value, minimum, maximum) { - if (minimum !== -1 && value < minimum) + if (value < minimum) value = minimum - if (maximum !== -1 && value > maximum) + if (value > maximum) value = maximum return value } @@ -286,8 +286,7 @@ Item { var fillItem = __items[fillIndex] var superfluous = root[d.size] - d.accumulatedSize(0, __items.length, false) var s = Math.max(superfluous, fillItem.Layout[minimum]) - if (fillItem.Layout[maximum] !== -1) - s = Math.min(s, fillItem.Layout[maximum]) + s = Math.min(s, fillItem.Layout[maximum]) fillItem[d.size] = s } |